[Released] Rule 4.0

Is there additional documentation on how to use this "private boolean" ?? I think this will be useful somehow because I currently have a rule that only the light in the zone where is motion detected will be turned on and all others will be triggered by that to be turned off then when I move to another zone the previous zone light will be off and the new zone will be turned on. I have created a home mode called "follow me" so when I activate that mode it will only work in that way (mainly only when there is only 1 person at home) but the problem is that when this is running the hub will have performance issues and not sure if this is because if I am moving from zone to zone fast then many off commands are sent to all the other zones and I am thinking on "private boolean" as an option based on what you described in your post

There's not much to it. Each rule possesses a Private Boolean, that starts out true. You can see its current value by looking in Restrictions. It can be used as a restriction to disable a rule. It can be used as a private variable for the rule's own use. It can be set by the rule, and it can be set by other rules. It can be used as a condition, and it can be used as a trigger event. Very useful for a single bit!

Its original purpose was to replace the need for a virtual switch to keep track of some state.

1 Like

Hi, loving RM 4.0, but I have one question. What does the "cancel" option (toggle) do in actions, since it was stated that "cancel on truth change" doesn't exist any longer? I see you've used it in your examples a couple of times, so obviously an important concept to understand.

There is a new action called “Cancel Delayed Actions”. That action will cancel all the actions where the cancel flag was set. Here is the example out of the description above


Thanks Daniel. I do understand this no problems. What I am not sure about is the "Cancel" toggle in Actions. See Photo

There are two types of delays, those with Cancel selected and those without. As @dan.t says, Cancel Delayed Actions cancels those that have Cancel selected. Delays without Cancel can also be cancelled with the Stop Actions This Rule action (or by another rule). Think of the Cancel toggle as making that delay eligible to be cancelled by Cancel Delayed Actions.

There is a parallel mechanism for Repeats, those with Stop selected and those without. Stop Repeat Actions will stop any repeat with Stop selected, but not a repeat without it selected. And, Stop Actions will stop all repeats (can be done by another rule).

Got it. Perfect explanation. Thanks for the quick response.

With RM 4.0 is there a way to repeat actions until something happen? Example if my water sensor detects water (would mean is raining) and the window is open then to keep sending me notifications every x period of time until the window is closed ? In RM 3.0 there is the repeat option but with option to stop the cycle after n times but no based on an event

Actually there is a way to do this in 3.0, and the same way exists in 4.0. Use a Simple Conditional Action just at the end of the actions to be repeated, with Stop Repeating Actions as the action. That tests the condition, and if true, the repetitions stop.

There is also a while loop for repeats, by putting a Simple Conditional Action on the Repeat itself. You can read about those in the Rule 3.0 writeup here: [Released] Rule Machine 3.0

My next project is all new documentation for Rule Machine, which will consolidate all of this sort of information.

1 Like

Ok will try and yes full documentation will help a lot. Thanks

Preliminary documentation is now up. See it here: Rule-4.0 - Hubitat Documentation

This can be pulled up with the ? icon in the upper right of every rule.


This probably should be absolutely obvious, but I can't figure out how I upgrade to Rule 4?

Click on Rule Machine and then you'll see this. It will allow you to clone or create a new rule. Due to the changes, you can't upgrade, more close from 3.0 to 4.0.


You cannot convert an existing rule to a 4.0 rule. You have to recreate the rule as a 4.0 rule. But the real question is why? If the old rules are working, then they will continue to work.

As Bruce said

"Because Rule 4.0 is a pretty sharp departure from classic RM, both Rule-3.0 and Rule-4.0 will be available for some time. We will retire Rule-3.0 in the future. "

While I believe that anything pre 4.0 will be around for quite a while, it's nice to get a start on the inevitable. Besides, it's fun :smile:


That's not what he meant: both 3.0 and 4.0 will be around for new rules for a while. Eventually 3.0 will go away for creating new rules, like 2.5 and the original version did--but they have yet to revoke support for existing rules, nor have they ever announced plans to, and in fact Bruce often brags about how many of his rules are still the original "Rule" version.

In other words, I see nothing "inevitable" here. :slight_smile:

Ah geez, didn't know it came across as bragging. More like, who has time to redo things that just work?


That's easy... the answer is @homeauto2112 !!! :rofl::joy::stuck_out_tongue_winking_eye:

@homeauto2112 - in all seriousness, thank you for all of your hard work converting your rules to 4.0 and helping find bugs along the way. Your effort is truly appreciated by me and the community!


I have to play more, but when setting up precense or motion sensors. I can’t find the options to select all inactive or active or all precense. I can only get it to work with any.

There is a bug right now (fix coming soon) with presence in a trigger event. "All" is only a choice for a condition, in a conditional action. It's not meaningful for a trigger event.