[Released] Rule 4.0

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.

2 Likes

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.

26%20PM

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:

2 Likes

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?

4 Likes

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!

5 Likes

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.

I assume that any issues in RM 4.0 has nothing to do with RM 3.0 so it is ok to update hub and my rules in 3.0 will work as usual right?

1 Like

I wonder if Bruce really has "original" RM rules running (and by "original", I mean the ST version)?

Correct, and there were a few bug fixes in 3.0. See the release notes: Hub Update 2.1.2

The following Rule 3.0 notifies me every 30 minutes, when my gate is left open for 30 minutes. When the gate is closed, the delay and repeat stop.
How would I do the same in 4.0?

The "original" ST version was never released on Hubitat. It had undergone substantial development by the time that Hubitat Elevation was released. That said, most of my rules are pre Rule-2.5, so in some sense are descendants of the original.