Wait for condition OR Wait for event

I don't really understand the difference between Wait for condition and Wait for event. I've read the docs, but it still isn't clear to me.

Should I use wait for condition or wait for event in the following rule?

Here is advice from staff when either would work and you're not sure:

But the specific difference really boils down to "event" vs. "condition." With "event," the rule will wait there until an event is generated that matches what you're waiting for (a "closed" event from the sensor, had you done this instead). A condition is just a state (generally the result of an event). The difference is that with a "Wait for condition," the rule will proceed either when an event ("closed" as above) is received that causes this condition to become true or if the condition is already true (i.e., the gate is already closed).

In your specific case, either option would probably produce the same outcome. But given the advice from staff above (and the fact that it's highly unlikely the gate will already be closed by the time you get to that "Wait," which will be there more or less immediately after opening), I'd use "Wait for event."

PS - Also keep in mind that any "Wait" in your actions that is currently waiting will be cancelled if any of your triggers match, which (like with any rule) will also cause your actions to start running again from the beginning. This is different from "Delay" actions that must be specifically cancelled. This means you do not need the "Cancel Wait" in your actions.

PPS - Unless you have level prestaging enabled, a "Set Level" command ("Dim..." in your rule) will normally turn on the bulb, so you could probably get rid of your "On..." line too unless you know that you need it.

4 Likes