Wait for Trigger in automation help for doorbell

Hi All,

I am trying to set up an automation so send an alert to my doorbell if i dont open my door.

Example,

Doorbell is pressed,

Notifcation sent to mobile, and audio to some speakers in the house.

If i dont open the door within 20 seconds then i want the automation to then send a comand to the doorbell to say a particular text.

I can get it all working except for the wait for the door to open part. I can get it so it wants for the door to open then speaks the text but not if i dont open the door.

The Trigger seems to wait for a change and i am looking for something to track no change in that 20 second window to then carry on with the automation.

Thanks,

Show your current code, pasted as properly-formatted YAML.

You could do this:

  - delay:
      hours: 0
      minutes: 0
      seconds: 20
      milliseconds: 0
  - if:
      - condition: state
        entity_id: your_door_sensor
        state: "off"
        for:
          hours: 0
          minutes: 0
          seconds: 20
    then:
      - service: your_service_call

Thanks, I have no idea why i didnt think of this.

Personally, I’d use a wait for trigger. It’s a lot more compact.

But there is no trigger to wait for as your waiting for a trigger to not happen so i could not get that to work.

You’ll wait for the door’s state to be open with a timeout. If it times out, set the wait for trigger to continue and send the notification. Otherwise, it will abort.