Restriction Options for Basic Rule, Simple Automation Rule and Rule 5.1

Basic Rule and Simple Automation Rule

In the 2.3.1 release there is a new option in each of the two automation apps having to do with Restrictions. As they have worked prior, if a Restriction is in effect, the app would not do any actions. This causes a problem for automations that start prior to a restriction going into effect, but not finishing until after. For example, if an app is restricted to only turn on lights from motion in Day mode, and they are turned on just before leaving, and it then becomes Away mode, the lights would not turn off once it was no longer Day mode.

To address this situation, there is now an option in the Restrictions setup for each app, like this:

With the toggle in the off position, the app works the way it has in the past, and no actions will run while restricted. The new option allows the toggle to be turned on, and as it shows, only restrict the trigger, not the following actions. With the toggle selected, the case above where the lights would want to turn off after the mode change will now work as desired.

Rule 5.1

There is a corresponding new option for Rule 5.1 Required Expression. As they have worked prior, Required Expressions only affected the trigger of the rule, not subsequent actions -- just the reverse of the way Restrictions have worked as described above. The new option allows the Required Expression becoming false after the rule is triggered to act the way Restrictions work in Basic Rule without its new toggle, namely, to cancel any pending actions of the rule:

In this example, we want all actions to stop once the mode changes away from day (opposite the cited example above). By putting the toggle to the on position, the reach of the Required Expression is now to both the trigger and subsequent actions. Should it become false, those subsequent actions will be cancelled.

Importing Basic Rule or Simple Automation Rule into Rule Machine

It is worth noting that Rule Machine now has the ability to import either a Basic Rule or a Simple Automation Rule (see this post), creating a corresponding Rule 5.1 that does the same automation. Because of the way Restrictions behave without the new toggle, Rule 5.1 needed this new Required Expression option in order for an imported Basic Rule or Simple Automation rule to work properly. Note carefully, if the Restriction toggle is off in the Basic Rule or Simple Automation Rule, the Required Expression toggle will be on. And conversely, if the Restriction toggle in the Basic Rule or Simple Automation Rule is on, the Required Expression toggle will be off, effectively only 'restricting' the trigger of the rule pursuant to the Required Expression (the original Required Expression functionality).

13 Likes

Download the Hubitat app