Executing an automation until either condition is true

I have recently installed a Eufy alarm and am disappointed at the alarm volume. So, I have added some sirens which I need to trigger if the Eufy alarm is triggered.

So far this is working fine:

  1. Eufy alarm sends ‘triggered event’ (this is an event not a persistent state)
  2. This causes ‘Alarm Triggered’ automation to start (trigger: Device, Homebase triggered)
  3. Automation turns on smart plugs which have screamer sirens plugged in
  4. After 30s Eufy stops alarming (assuming no further sensor activity)
  5. After 30s the automation also stops (turn on siren, wait 30s, turn off siren)

This is all fine except when someone accidentally triggers the alarm (usually the child rushing in). If we disarm Eufy at the keypad (or app), Eufy stops - but the automation continues for remainder of the 30s.

So my question essentially is:

- How can I tell the automation to continue for 30s unless Eufy enters a state of ‘disarmed’?

I’m a bit of a noob at this - hence why there are no yaml postings - I’m trying to do this all through the UI.

Any other approaches/suggestions also welcomed.

Thanks!

Use wait for trigger in the action part. First turn on the sirens. Then wait for trigger, alarm disarmed and as last action turn off sirens.
Use the timeout to define the wanted siren on time and check continue after timeout.

If timeout occurs, alarm was not disarmed but siren turns off.

This just an example I built quick in ui editor.

action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.sonos_master_bedroom_crossfade
  - wait_for_trigger:
      - platform: state
        entity_id:
          - light.bedleds_channel_1
        to: '5'
    timeout: '30'
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.0xbc33acfffe5910fb_l2

1 Like

Perfect thanks! I should have explored the Action Types a bit more.