Improved Conditions: giving you a more flexible and powerful way to run your logic

If you are a long-time Apilio user, you probably have used the option to automatically evaluate a Logicblock whenever one of the connected Variables changes. With this new update, we are supercharging our conditions and you’ll be able to use them as triggers for your logic going forward!

Using variables to run Logicblocks (legacy)

To prepare for this update, we started by moving that original option to evaluate the Logicblock from the Logicblock to the Conditions. You can find that previous announcement here. This is what the original setting looked like in the Logicblock:

But in any logic you build, Variables and Conditions can only be true or false. Your Logicblock will only consider if a Condition is true or false when deciding to run some actions. So from what we’ve seen you all automate in Apilio these past few years, you wanted to drive your logic based on a condition change rather than a variable update. We noticed this was the case because with the legacy setup:

  • The Logicblock can be evaluated when the Condition is not ready: I have a presence sensor that is sending an update, but I only want to run my logic if the presence sensor hasn’t sent any new updates in the last 5 minutes: if I run my Logicblock only when the sensor sends the data, the Condition is still false, and nothing happens.

  • The Logicblock can be evaluated many times unnecessarily: you probably have an IFTTT trigger that checks a Logicblock every 15 minutes, because the variable is not what you need to check: it’s the condition!

:point_right: So we realised that the best solution would be to check your Condition and not your Variable. This wasn’t originally implemented because it was quite complex, so it was postponed…until recently!

New! Using conditions to run logicblocks

Going forward, you’ll be able to “Evaluate a Logicblock if the Condition changes”. In most cases, you can just leave this checkbox ticked and use it as your trigger for your logic. It will make your automations have fewer applets in many cases.

We are keeping the legacy config for those of you who had already enabled it, but you can switch to the new triggering conditions easily.

:warning: :warning: (maybe boring) technical details ahead! :man_teacher:t3: :warning: :warning:

What are the underlying differences between running my logic “on condition change” rather than “on variable update”?

  1. If you re-update a variable without changing the value (variable was true and you get another event to set it to true again), the condition usually doesn’t change, so there will be no Logicblock run triggered. (Exception: See #2)
  2. If you specify a timeout or a delay on the condition, these will be taken into account on every update. We know many of you had requested this feature in the past :man_technologist:t3: You can read more about how it works here: How to setup time constraints for Conditions: delays and timeouts

I want to change to the new conditions! How do I change my legacy setting?

  • If you don’t want to change your setup right now, you don’t need to do anything. The old setting is kept for existing conditions.
  • If you like to upgrade you existing condition to the new setting, you can do it by:
    • Edit your condition and uncheck the setting “Trigger Logicblocks using this condition whenever the variable is updated” (this is the legacy setting)

Trigger when the variable is updated

  • Save the condition an re-open it for editing. You will see the new setting now
    Trigger this logicblock when the condition changes

:bulb: Related articles