In Apilio, you can store numbers so you can create conditions that depend on numeric thresholds or values. For example you could store your room temperature or humidity and open/close windows or turn on or off your AC if the temperature or humidity values go over or under certain numbers.
A numeric variable can store things like: 0, 7, 999.99, -7.09
How to setup your numeric variable and keep it updated
To create a new numeric variable, go to https://app.apilio.com/numeric_variables and click/tap “new variable”. You’ll be able to set a name, the current number stored in this variable and add a tag if you want to organise this variable in any of your current tag groups.
In Apilio, you can update numeric variables via IFTTT or webhooks.
Comparisons with numeric variables
Numeric conditions use two numeric variables, so you can make comparisons between them. You can either have two variables that are constantly changing, or have one variable that changes and keep the second one as a constant in Apilio: you set the original value and this is never changed by any external service.
We are going to use two variables in our examples below. The variable “temperature” will be set to 18 initially, but will change dynamically thanks to the input of an external sensor. Our second variable will be “threshold_temp” and it will be set to 20. We will keep this as a constant that will be our reference.
Equal to
Useful when you want your condition to trigger when your number is a specific one:
- Temperature is 18
- Temperature threshold is 20
- Variable “temperature” equal to “threshold_temp” = 18 equal to 20 = this condition is false
Not equal to
This will trigger everytime that your variable is not a match to the comparison number. It will only be false when the variable is an exact match for the comparison one.
- Temperature is 18
- Temperature threshold is 20
- Variable “temperature” not equal to “threshold_temp” = 18 not equal to 20 = this condition is true
Greater than
Triggers when your number is above a certain threshold value setup in your comparison variable.
- Temperature is 18
- Temperature threshold is 20
- Variable “temperature” greater than “threshold_temp” = 18 greater than 20 = this condition is false
Greater or equal than
This is like the previous one, but it will also trigger if the variable is an exact match with the threshold value.
- Temperature is 18
- Temperature threshold is 20
- Variable “temperature” greater or equal than “threshold_temp” = 18 greater or equal than 20 = this condition is false
Less than
Triggers when your number is below a certain threshold value setup in your comparison variable.
- Temperature is 18
- Temperature threshold is 20
- Variable “temperature” less than “threshold_temp” = 18 less than 20 = this condition is true
Less or equal than
This is like the previous one, but it will also trigger if the variable is an exact match with the threshold value.
- Temperature is 18
- Temperature threshold is 20
- Variable “temperature” less or equal than “threshold_temp” = 18 less or equal than 20 = this condition is true
Inside range between
Triggers when your number is within a range of two comparison variables.
- Temperature is 21
- Lower temperature threshold is 20
- Upper temperature threshold is 25
- Variable “temperature” inside range between 20 and 25 = this condition is true
Outside range between
Triggers when your number is outside a range of two comparison variables.
- Temperature is 18
- Lower temperature threshold is 20
- Upper temperature threshold is 25
- Variable “temperature” outside range between 20 and 25 = this condition is true
Related articles