Automation door state every 5 minutes

Try this:

alias: 'Door Monitor'
mode: restart
trigger:
- platform: state
  entity_id: binary_sensor.door
  to: 'on'
  for: '00:05:00'
action:
- repeat:
    while: "{{ is_state('binary_sensor.door', 'on') }}"
    sequence:
    - service: notify.somebody
      data:
        title: Door left open.
        message: Please close the door.
    - delay: '00:05:00'

How it works

  • It triggers when the door’s state is on for 5 minutes.
  • It immediately sends a notification then repeats it every 5 minutes as long as the door’s state remains on.
3 Likes