Can someone help me to make an automation? I have pir sensors allover my house and I want to make some automations scenes, for example:
If three PIRs sensors where triggered in the following order PIR 2 -> PIR 1 -> PIR 3, all in less than 1 minutes, do that. If the order will be PIR 3 -> PIR 2 -> PIR 1 in 30 seconds, do something else.
I don’t know how to aproach this automation.
Thank you in advance.
hmmm, interesting aproach, I did not think about wait for trigger, but… what if other sensor will be triggered meanwhile? Cand this ignore other sensors? I think so, right?
Not sure…
I actually have never used this wait for trigger in HA, only in Node red.
In Node red it’s easier to control the flow.
I’m not sure what happens if they are triggered in the wrong order, if that still counts as “done”.
Now that I think about it.
Triggers in HA is “or”. So probably if either one is triggered.
I would probably use Node red for this.
If you define multiple triggers within a single wait_for_trigger then any one of the triggers will continue to the next action unless triggers are specifically called out as an “and”.
Because the sequence of sensors coming on is important, use a series of wait_for_trigger actions with a single trigger for each sensor, in the order to come on. Set the first wait_for_trigger time_out to your duration for all sensors to be triggered. Then each subsequent wait_for_trigger time_out use a template for the remaining duration {{ wait.remaining }}. Set the continue_on_timeout to false for each wait_for_trigger.