Rule action to cancel repeat notifications from occuring for x minutes in RM-4.0

I have a door contact sensor installed on the back yard door in my home which notifies my phone each time it's been opened. Because we have several dogs needing to be let in and out, that door is sometimes opened and closed 4-8 times within a short amount of time (let's say 10 minutes). I am trying to figure out a rule in RM-4.0 to notify once the door opens, but ignore/cancel any other notifications until 10 minutes have passed.

Something like this would probably do it. Basically, the door opens. If it's been at least 10 minutes since the last notification, it sends a new notification. Otherwise it waits for 10 minutes. Private Boolean acts as a switch to keep it from sending notifications until the 10 minutes is up.

Not to criticize,but I think the else needs to go. The private Boolean reset would only happen every other time the door was opened.

1 Like

Fair enough. Consider it stricken.

1 Like

You could also just use the built-in Notifications app, which has an option to alert only once every so many minutes.

1 Like

I tried your suggestion without the ELSE statement as per @napalmcsr. Unfortunately, I still get notifications every time the doors opened under the 10 minute delay.

That's a good idea as well, but I would like to begin learning how to use the rule machine and this seems like a good place to start.

Your IF statement should be "If Private Boolean is true THEN". See my example above. The private boolean is what keeps the rule from running except every 10 minutes.

You have "If contact sensor open." That will cause the if to be true every time the door is opened. You already know the door is opened because that's your trigger.

Thank you! I should have read your example more carefully. It appears to be working now.

2 Likes

Great! Glad to hear it.

PB (in Rule 4) no longer inhibits rule actions. I learned this after experimenting for 2 days.

1 Like

It never truly did: you still had to set Private Boolean as a restriction. (That was really the only way to make use of it in early versions, though.) It's just that there are no restrictions now since you can do everything they did plus more with the conditionals that were introduced in Rule 3.0 and 4.0. :slight_smile: