How to use conditions in Apilio to create smarter routines

When creating a Logicblock (a routine) with Apilio, you’ll have to define two important bits:

:arrow_right: your list of conditions: the rules that must be met
:arrow_right: your list of actions: the results you want to get

In this article we are going to see how lists of conditions are created, how you can combine your different conditions and why Apilio allows for a very powerful way of customising your home routines just how you like them.

Types of conditions

In Apilio, we have several different flavours of Conditions:

  • Time conditions:
    • time events or time frames
  • Conditions applied to Variables:
    • Boolean, string or numeric, depending on the variable they apply to

Time conditions restrict when your logic can run, for example: every Monday and Wednesday at 9AM, every day in February, between 10AM and 11AM, etc.

Conditions applied to Variables are conditions that check the status of your smart devices or services to allow you to make decisions. For example: a Variable stores whether your phone is connected to your home wifi. Your Condition then knows you are home as long as the variable says that you are connected to the wifi.

Instant (triggers) or static conditions

To execute the Actions listed in a Logicblock, every rule specified by the Conditions must be met.

Conditions can either be something that happens:

  • (in an instant :zap:) It’s 10AM:When an instant condition is met (is true), the logicblock will be evaluated and all the conditions will be checked. As this only happens in an instant, this makes it a trigger for your logicblock. These conditions are pure triggers.
  • (during a time frame :eye:) It’s between sunset and 12PM or I’m at work: these conditions stay true for a while instead of being true just in an instant, like the previous one.


You can turn a :eye: into a :zap:: When a condition is true over a period of time, in Apilio you can also transform it into a trigger. If you do this, when the condition changes (from false to true or from true to false), the logicblock will be evaluated. This is enabled by default as this works for most routines at home.

How to create a list of conditions for a logicblock

Once you have all your conditions ready, you can select the ones you want in your logicblock, you will need at least one trigger which can be a native one such as the ones highlighted with :zap: below (it can also be an external IFTTT trigger):

Combining them with the “simple AND” works for most home routines: every condition must be true for the actions to run.

If you would like to add some flexibility to your Conditions, such as “if this AND [this OR this and this]”, you can do so using complex Conditions. We have an article explaining how to set up complex Conditions here.

:bulb: Related articles

3 Likes

It’s unmodified since and modified within, not how you describe it.

1 Like

Thanks for spotting this, we’ll do a quick - ahem - edit.

Thanks a lot! :slight_smile: This is now fixed

2 Likes

A post was split to a new topic: Using Unmodified Since at the condition level?

I’ve updated this post to include the newly released time conditions :slight_smile:

And we now have two dedicated articles for the different types of conditions that I hope will be useful:

  • One for the new time conditions:
  • One for the existing conditions that are applied to variables
1 Like