Sticky trigger not working?

I am trying to get my front door to only notify once the door is left open for a period of time and then send additional reminders until the door is closed. However, if the door is closed I want it to stop any and all notifications. I "think" i might be getting false alerts though and am trying to figure out where to start. So, being new to this I first have to question the setup of the rule. Please see attached snapshot and let me know what might be missing.

Sidenote: I think i may have stumbled across something as I am writing this... As setup after the trigger event is set off at 10 sec it goes into doing whatever is set in the rule. But, what if the door is shut at 15 sec? I believe my rule still stays in the trigger state and goes until done. How do I get it to stop once the state of the contact closes? Do I have to put in multiple wait rules so that it will constantly check for a state change?

I am sure there is a way to do what you want in RM, but did you know the stock Notifications app does this already with its standard options? Here is my setup for my Garage Door. After 10 minutes of being open it sends out alerts every 30 minutes until it is closed. It works perfectly.

The only thing you cannot do in this app is have a different alert after the initial one as you are trying to do in RM.

1 Like

I will try this again in the mean time as well. Having different verbiage at different intervals is not necessary but it is fun to play with and the look on peoples faces when it goes off makes it worth it. Haha.

I have one setup in notifications that I have paused because I "thought" it was doing the same thing. So, I thought maybe it was me not setting it up correctly and that the notification app might not be the correct app to handle the task. I will go back and revisit this and confirm as well. Thanks.

For this question, this new feature might help you

Check the section called "Cancel Pending Actions when Required Expression Becomes False"
You would need to set a required expression that the door is open, so when it closes everything gets canceled.

You're not using Custom Attribute as the trigger are you? That has a known problem with "Stays for"

1 Like

I am not.

I tried using the "expression" in both true and false states and neither of them work. I am clearly missing something but cant get to it.

I don't think you need the required expression as the trigger will only happen when the door opens which implies it was closed before the trigger event happened. Try it without that. And set the stays for time to the max time you actually want before getting the notification. If you can tolerate 15 seconds then put that time. Let us know how that works for you

I believe the goal was to cancel the "delay 10" and skip the "do you live in a barn" notification if the door was closed during the delay period, so the required expression make sense for that purpose. However, I think the rule should be set to "Canceled pending actions when Required Expression becomes True".

In other words, if the door is closed (required expression = true, ready to trigger), and the door is then opened so that the rule triggers (which then causes the required expression to be false), the first two actions act, then the rule goes to the delay and starts waiting for 10 seconds. If the required expression remains false (door stays open), then after 10 seconds, play the last notification, but if the required expression becomes true during or before the delay expires (i.e., the door is closed causing required expression to be true), then skip the rest of the delay and don't play the last notification

There are multiple ways to solve this. The one I would recommend is to change the “Delay” to a “wait” for expression - “Front Door Contact Sensor” contact open with duration of 1 minute. That way, the next event will only occur If the door was left open for that amount of time.

When the rule triggers again later, it will automatically cancel the wait.

this is exactly what i am trying to get to happen

So, after reading this i thought aww yeah this is the fix. Just tried it and it didnt work either. I can get get it to do the first part and then it stops. Here is a copy of what I just tried. It read the first command but then after leaving the door open for 15-20 sec it still did not fire off the 2nd part after the wait command.

1 Like

Hmmm… It’s possible it is waiting for a second event, which is why it’s not working - my bad!

Here’s another option that really should work:

Change the Wait for event to a wait for an elapsed time
Then, add an if condition: “if Sensor contact open, then” before the “Notify Echo…”

With that one, it will only play the notification if the door is open after the wait has completed.

i have been playing with every possible option and variation I can come up with to see what it does and how it acts and I am at a loss at trying to understand what it is doing and why.

Here is what I just came up with....the wait appears to be wanting it to do another trigger event. If i have the contact closed and then open it for 5 sec it will trigger the first thing. Then i close the contact and then reopen it and then it triggers the 2nd event as well as the initial 1st event.

I will try your last idea now.

1 Like

Yes, wait for event does exactly that, it waits, for a (new) event. If it is already in that state it wont see a new event to trigger it. Wait for Expression just checks if it is true or not, no trigger needed but I don't think you get the sticky option there (maybe you do?)

If you just make it a regular delay wait for 10 seconds (no event or condition), and then also make door open as a required expression which cancels all pending events, that would be one solution to get it to work.

Could also wait for event door closed, not sticky, but with a 10 second timeout. Then right after that do an IF door closed exit rule, after that do what you want to happen if its still open.

1 Like