Wait for event timeout

So the more I read, the more I get lost And the more I try it, the more confused I get. I'm sure I'm overthinking it, but please help. Also, I'm sorry for the basic question.

Wait events. I did a simple test rule.

Trigger: door opens
Turn on light
Wait for event: door closes, timeout 20 seconds
Turn off lights

It turns off the lights whether the wait times out or the door closes. I guess I've crossed over somewhere to thinking that if the wait times out, it wouldn't continue.

If I add a conditional after the wait and say if the door closes, turn off light, else, exit rule, it works. But then I have to add the same (similar) action twice (wait for this event and if this event happens). Is there a way to make this easier?... something more along the lines of, wait for this event until the timeout else do this.

This should help!

Wait for (the lack of) event - RM5? - #2 by bertabcd1234?

1 Like

ive been trying wait events/conditions for a motion notify on my tv. i have my liv room lights to go off after 30m if no motion, then turn tv off. if motion active, it resets the timer and u get another 30m. problem is, watching a movie and not moving for 30m shuts off everything and we have no clue. so i added a notify on the tv to say, 30m is almost up, trigger the motion basically. this works but if we trigger the motion 5 times in 30m, tv notifies 5 times also. so i have been playing around with the wait for events/condition. (wait for 25 minutes to say, trigger the motion or all is off). i havent been successful yet, but i just started playing with it. I will update when i get it right, maybe it will help.

or maybe this, he beat me to the reply...

1 Like

That is basically what you need to do and the example shown in the link is a good one. In your case a simple conditional if door open exit rule after the wait would work as well. No need for a IF then ELSE

Waits only stop if the rule is re-triggered. But the rule starts over and, in your rule, the the wait would start again. Although in your rule that would never happen because the only way to re-trigger would be to first shut the door.

1 Like

Maybe I missed it somewhere, but it doesn't look like you ever stated what you want the rule to actually do. If you don't want it to turn off the light at all until the door is closed, just remove the timeout. If you want to wait for the door to remain closed for 20 seconds rather than instantly, use "duration" instead of "timeout." If you want to do something different (but still something) in each case, @terminal3's suggestion to add an ELSE to my rule linked to above should work. But if all you're doing in the ELSE is an "Exit Rule," that sounds like effectively nothing to me (unless you have more actions after this) and thus the same as the first possibility I mentioned.

So...a few options depending on what you really need. :slight_smile:

2 Likes

Download the Hubitat app