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.
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
If you look at %device% after a wait, it will be equal to "Timeout" if the wait event never occurred and it timed out.
Is that documented somewhere, or did you just happen to notice this as a side-effect of WAIT?
Not sure where/if it's documented, but there has been some discussion on the forum about it.
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.
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