Duration vs timeout?

What is the difference? I haven't really used wait much before and this is all new stuff.

Using a timeout on a wait for expression means it will wait for the amount of time you specify and then continue, even if the expression is false.

Example wait for power > 5 with a timeout of 5 min.
The rule waits for power greater then 5 or 5 mins whichever is first

Using a duration means the expression must remain true for the amount of time of the duration.

Wait for power > 5 with duration of 5 mins
Waits for power > 5 for 5 mins. It will not continue until the power stays greater then 5 for 5 mins.

3 Likes

Ok so duration allows for "blips" of true conditions but doesn't move on till those blips are of a specified length. Timeout gives up on the first blip or timer ending.

Duration then has the potential to leave a rule in limbo for very long periods of time the. Correct?

Yes, this is correct. Consider the case of basic motion controlled lighting. You don't want the lights to turn off until after motion has stopped for x minutes, and there has been no new motion. Each new motion event cancels the wait, and when motion is inactive again, the timer starts over. This will go on indefinitely.

1 Like