When creating a Logicblock (a routine) with Apilio, you’ll have to define two important bits:
your list of conditions: the rules that must be met
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 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 ) 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 ) 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 into a : 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 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.