How conditions applied to variables work in detail

In Apilio, you will specify Conditions to create a list of rules that must be met before your actions can run. For example, you must be home between Sunset and 12PM in order for Apilio to turn the lights on.

Your Conditions can also be based on the state of a smart device or service, for example if you are close to home, or if your phone is connected to your home wifi. To allow you to connect with almost 700 brands of devices and services, Apilio is natively integrated with IFTTT.

IFTTT will send the status of your chosen devices to Apilio, and store it “in memory” in what we call Variables, and you can then create conditions that check what the variable is storing at any given time.

What’s a Condition applied to a variable?

For example, you can have a Variable store whether your phone is connected to your home wifi. You can then create a condition to check if your phone is connected (or disconnected) from your wifi, and use that information in a Logicblock.

Why do you need a variable?

Instead of integrating with a handful of brands, we leverage IFTTT’s integration platform so you can interconnect all the big brands on the market.

This also means that you only have to connect your accounts in these brands (for example, LIFX, or TP-Link, or Neatmo) with IFTTT, but then you’ll be able to control your devices from Apilio, and combine them all in routines as you wish.

In Apilio we have three types of Variables to allow you to store many different types of information:

Three types of Conditions for Variables

Since we have three types of variables in Apilio so you can store different types of information, we also have three types of Conditions applied to Variables. Let’s see how each one works.

Boolean Variable Conditions

  • A Boolean Variable Condition will check whether a Boolean Variable is true or false. For example, the Boolean Variable ‘connected_to_home_wifi’ can only be true or false, and if we have a Condition to check whether we are home, this Condition can only result in true (when the phone is connected) or false (when the phone is not connected to the wifi).

String Variable Conditions

  • A String Variable Condition is determined by comparing a string to a reference string that you must define. You can check whether your string variable contains or does not contain your reference string:
    • If we have a Condition to check if a string contains a specific reference string, the Condition will be true when the string contains the reference and will be false when it does not. For example, each day we can receive the weather forecast for the day and if we want to check whether the weather today will be humid, we could check if today’s forecast is contained in the string ‘Snow, Rain, Fog’. If the weather is ‘Fog’, this string is contained within the reference string and, as a result, the condition is true.
    • If we have a Condition to check if a string does not contain a specific reference string, the Condition will be true when the string does not contain the reference, and it will be false when the string does contain the reference string.

Numeric Variable Conditions

  • A Numeric Variable Condition is determined by comparing a Numeric Variable to a numeric reference. The Numeric Variable can either be equal to, greater than, greater or equal than, less than, or less or equal than the secondary Numeric Variable to check whether the condition is true or false, just like we just did for String Variable Conditions.

:bulb: Related articles