How to accomplish "wait for event" and then do something when it doesn't happen

Wait for event

when event happens do this....

but if event doesn't happen within this time frame then do this....

I can't seem to wrap my head around how to pull this off.

Reverse your thoughts, i.e. start a timer, if expires do…., if event before expires stop timer and do….., restart timer

3 Likes

If you look at %device% after a wait, it will be equal to "Timeout" if the wait event never occurred and it timed out.

4 Likes

Is that documented somewhere, or did you just happen to notice this as a side-effect of WAIT?

1 Like

Not sure where/if it's documented, but there has been some discussion on the forum about it.

1 Like

I was using that timeout but I couldn't seem to sort out of how to get a different action to execute if it times out versus completes.

I know I use this in some rule but I can't remember which one, or I would post it as an example.

Basically after the wait set a string variable equal to %device%. If the variable contains "Timeout" then do one thing, else do another thing.

3 Likes

I'd be really interested in seeing that when you can.

i would do something like:

wait for event: door open
if door = open then do stuff
end if
if door = closed then do something else
end if
1 Like

That's what I kinda came up with.

2 Likes