I have a motion sensor that has the ability to go off multiple times what I'm looking for is to only get 1 alert per 20 minutes and not multiple alerts. I see there's an app called Notifications that I can set "How Frequently" to be notified but not seeing anything like that in RM
To do this in RM you'd setup a Required Expression of Private Boolean True. Then you'd have the motion trigger. The first action of your rule should be Set Private Boolean False (this will stop any further triggers as the Required Expression would then be false). And the last action of your rule should be Set Private Boolean True, delayed 20:00. This last one re-enables the triggers 20 minutes after the rule runs.
Thanks for the info. Does this look right??
That should work, although I'd make the Set PB False the first action, just to reduce the chance of double triggers.
There is a drawback to this method. If you reboot the hub during that 20 minute delay, the rule can get hung and stop triggering. The delay gets canceled on the restart and the Boolean stays false. I use this method in several rules, but I have a rule that resets all the private Booleans on a system restart.
I wish having the Boolean reset on restart was an option for any rule but it is not, so anytime I make a new rule using this method I have to remember to add it to my restart rule.
This is not true. Scheduled jobs are not touched by reboot. The only problem is if the hub is not running at the time the scheduled job is supposed to run.
You are right the delay does not get canceled, a better choice of words would have been it gets missed.
If a hub reboots and the delay has less than a minute or two left a reboot most definitely can cause the rule to hang. So my original point stands, if you use this method it's best to have a a plan for missed Boolean updates.
Can you share how you created the rule to reset the Boolean on restarts?
The trigger is a location event > systemStart
Set Private Boolean of any rule using this method to true.
Thanks, I actually searched the forum after posting the ask and found out how. I meant to remove my reply. Thanks again.