#Timed alerts based on open state?

1 messages · Page 1 of 1 (latest)

calm vault
#

I'm incredibly new to all of this, but am hoping to add some simple alerts and need to know how.

How do I set a garage door to start a timer when open?
Then send an alert if it has been open for a certain amount of time (10 minutes, then 20, then 30).
But to reset and stop the timer once it is closed, so it doesn't keep sending alerts or break next time the garage opens.

Does this already exist, or do I need someone who understands using YAML?
Thank you in advance for helping me learn!

shrewd sierra
#

Although you could do it with a timer, it could simply be:

description: ""
mode: single
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.garage_door
    to:
      - "on"
    for:
      hours: 0
      minutes: 10
      seconds: 0
conditions: []
actions:
  - repeat:
      while:
        - condition: state
          entity_id: binary_sensor.garage_door
          state:
            - "on"
      sequence:
        - action: notify.mobile_app_your_phone
          metadata: {}
          data:
            message: Door open!
        - delay:
            hours: 0
            minutes: 10
            seconds: 0
            milliseconds: 0

This is yaml but just made with the UI 🙂

calm vault
#

I'd be able to set this up using the included features, or I'd need to put this into YAML?

shrewd sierra
#

You can all click this together in the UI. But yaml is easier to share. In the automation editor UI you can switch back and forth between visual mode and yaml mode. So make a new automation, go to yaml mode, paste all yaml above and switch back to visual mode 🙂