Automation - How to repeat notification

Hi. I am struggling to understand automations/notifications. I cant get this notification to repeat until the door is closed. Can someone please guide me in the rigt direction?

alias: 'Alarm ved åpen kjøleskapdør '
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.contact_sensor
    to: 'on'
    for:
      hours: 0
      minutes: 1
      seconds: 0
condition: []
action:
  - device_id: aa237b31bb17a27b90f4e4bd6fa14043
    domain: mobile_app
    type: notify
    message: Lukk kjøleskapdøra!
    title: Alarm - Åpent kjøleskap
  - device_id: e905e768dd8403ebf03be6ec0727a47d
    domain: mobile_app
    type: notify
    message: Lukk kjøleskapdøra!
    title: Alarm - Åpent kjøleskap
  - service: media_player.play_media
    data:
      media_content_id: http://192.168.1.90:8123/local/kjoleskapalarm.mp3
      media_content_type: music
    target:
      entity_id: media_player.kjokken
  - repeat:
      until:
        - condition: state
          entity_id: binary_sensor.contact_sensor
          state: 'off'
          for:
            hours: 0
            minutes: 1
            seconds: 0
      sequence: []
mode: single

you need to put the stuff you want to be repeated under the “sequence:” section of the “repeat:”

You could also look into using an alert instead. They’re designed for repeated notifications like this.

Are alerts still a thing since it’s mostly configuration.yaml based ? Is there any future for them ?

Yes, alerts are still a thing.

Whether they have a future or not isn’t clear, but they work today and will for at least the next 6 months (the deprecation cycle).

1 Like