Legacy Rule Machine

Does the latest update require you update your rules? I have had these rules running forever and I seem to be having issues now with the latest update. The rule turns on lights and then depending on the time, turns them off after a period of time. The lights are turning on but not turning off anymore.

The log shows the motion activating and firing the rule. It does the right action by turning the lights on and firing the delayed turnoff, but in this case where it should turn the lights off in 2 min and that fired as part of the earlier condition, nothing happens. This is a Rule 4.0

Existing RM legacy rules should still function exactly the same as they always have. The Hubitat team has not mentioned any required RM rule upgrades that I can recall. In fact, they have actually stated just the opposite. Essentially, if a rule is working, there is no reason to rebuild it in RM5.x.

7 Likes

@Panda Trigger your rule, or run the rule action, and see if the rule is scheduling the Off as expected.

Additionally, you have two 1-minute gaps in your rule where nothing is going to happen. Between 5:00 AM and 9:00 PM is valid from 5:00.000 AM and 8:59.999 PM. I'd change the second IF-THEN to 9:00 PM and 5:00 AM.

2 Likes

@pseudonym Thanks for the time criteria. It didn't affect me here since I better not be walking around at 4:59am but I do have some other rules where this could get me.

Still don't understand this issue but will do some resetting and see if helps. I cant see why its doing what it is.

I'd take a look at Motion and Mode Lighting app. I think it will easily do what you want.

2 Likes

You could just make the second IF a Else to the first IF.

For that matter you could move the Cancel and the ON outside the IF. Then the first IF turns off in 30 minutes and the else turns off in 2. If you want to make it a bit simpler.

This is what I would do as well.

I think it would need to be an ELSE-IF since there's an AND that looks at the mode but yes, the common actions could be moved outside of the IF-THEN to simplify the rule.

After thinking about this more, I don't think you can move the common actions outside of the IF-THEN statements. Since there is an AND condition, there is a mode where you don't want the lights to come on when the motion goes active.

The And for mode is the same for both IFs. So the only thing that differentiates the two is the time.

After a another look I think the mode part of The IF should be made a required expression.

I just remembered this is about using a legacy rule so required expressions are not available. So the mode part would need to be a IF at the beginning of the rule.

Well your rule could be re-written to shorten it, but as-is it should work. But your log entry shows that at 11:44:54.843 it has a line turning off the lights with a 2 minute delay. But there is no lights off showing 2 minutes later.

Rule 4.0 didnā€™t have a bug in the delays that I know of. Something is wrong with your rule. You could try just hitting ā€œUpdate Ruleā€ or ā€œDoneā€ again to see if that helps. If the rule is messed up, clicking ā€œUpdate Ruleā€ or ā€œDoneā€ again might fix it. Of course any changes you make to simplify the rule would require clicking update rule anyway.

As far as simplifying goes, to avoid redundant stuff, just exit the rule if the mode IS Automations off, using a one-line Simple Conditional Action. Then you could do the rest like terminal3 suggested, just have the conditional statement handle the one thing that is different for different times, the delay length.

If Mode is Automations Off Exit Rule.
Cancel Delayed actions
On Group Living Room
If time is between 5 am and 9 pm then
Off: Group Living Room ā€”> Delayed 0:30:00 (cancellable)
Else
Off: Group Living Room ā€”> Delayed 0:02:00 (cancellable)
End-if

But as I mentioned, your rule should work the way it is, and your log shows it isnā€™t. So you might just try hitting Update and/or Done again, and it might fix it.

1 Like

@geroose Well I did a shutdown and rebooted the hub. Now the rule is back working. Kinda wish there had been an issue so the hours I spent trying to debug this was worth something.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.