"OR" operation across multiple "Wait For" in an automation

Afternoon folks,

I’ve created an automation that I want it to wait at a certain point before proceeding, but I want that waiting period to be controlled by three separate “wait for” statements (one “wait for time to pass”, one “wait for a template” and one “wait for a trigger”).

I’d like the three wait statements to behave in an “OR” like configuration. I.e. whenever the first of those three waiting conditions succeeds, regardless of which one it is, I’d like the automation to continue.

I’ve been experimenting with different configurations, but so far with no luck.

Does anyone happen to know if what I’m trying to do is possible?

Thanks!

I’d suggest using a wait for template.

I have some wait templates with ‘and’ and ‘or’ combined and they work as expected.

In simple terms something like this should for fill the basic requirements:

  - wait_for_trigger:
      - platform: template
        value_template: ""
      - platform: state
        entity_id: []
    timeout:
      hours: 0
      minutes: 2
      seconds: 0
      milliseconds: 0
    continue_on_timeout: true

Triggers are ‘or’ by nature and using a wait for trigger with a continue on time out for fills the time element. So if either of the 2 triggers are true then the automation continues OR if the time out occurs the automation will also continue if neither of the two triggers have occured in the meantime.

If not then post up the yaml of what you currently have.