Automation door state every 5 minutes

Hello,

Who can help me with a automation for the following?

I have a door contact sensor (lets call it binary_sensor.door).
When the door is open for 5 minutes it must send a pushover notification that the door is still open. After 5 minutes it needs to check it again and also send notification again and repeat this until the door is closed.

If the door is closed within the first 5 minutes, there should not any notification being sent.

Anyone can create this?

Check alerts out. Should be what you need.

1 Like

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

This works perfectly. Thank you!

3 Likes

That one really helped, thanks a bunch!