Repeating Alert if Mode Set (input_boolean)

I’ve read numerous alert methods on here and still can find and get my alert method working.

I want to be alerted every 5min if a door is left open via Pushover, my setup is here:
You’ll see for testing I changed to input_boolean as a sensor and reduced to 10 seconds.

I get the first alert at 10 seconds, then never again :frowning:

# Door Left open
- alias: "Main Door Left Open Alert"
  trigger:
  - entity_id: input_boolean.test_sensor
    platform: state
    to: 'on'
    for:
      seconds: 10
  condition:
  - condition: template
    # Only do every 300 seconds (5 min)
    value_template: '{{ (as_timestamp(now()) - as_timestamp(states.automation.main_door_left_open_alert.attributes.last_triggered
      | default(0)) | int > 10)}}'
  - condition: state
    entity_id: input_boolean.notify_main_door
    state: 'on'
  action:
  - data:
      message: "Door Left Open"
      title: ''
    service: notify.pushover_service

How do I get it to repeat? The Alert feature of HA doesn’t appear to allow conditions :frowning:

Automations don’t repeat like that. Alerts do. Try this…

alert:
  main_door:
    name: 'Main Door Left Open Alert'
    done_message: 'Main Door Closed'
    entity_id: input_boolean.notify_main_door
    state: 'on'
    repeat: 5
    notifiers:
      - pushover_service

sure, that works, but how do I disable it if i have set my input_boolean.alert_door_open to off?

Closing the door will make it stop.

@NotoriousBDG you are missing my point/needs.

I do not want to receive an alert if I set a switch to ‘off’, but if the switch is ‘on’ then i want an alert every 5min or until the door is closed. I have setup a seperate boolean input for that “feature” to control when alerts should be sent.

I see. Try using a repeating trigger then… This will trigger the automation every 5 minutes. You just need to ensure your conditions are only true when you want the notification to send.

trigger:
- platform: time
  minutes: '/5'

Here is the code I have for notifying me every 30 minutes that my garage door is still open:

automation:
  - alias: 'North GD Open Notification'
    trigger:
      - platform: state
        entity_id: sensor.n_gd_pos_template
        to: 'Open'
        for:
          minutes: 30
      - platform: event
        event_type: timer.finished
        event_data:
          entity_id: timer.north_garage_door
    condition:
      condition: state
      entity_id: sensor.n_gd_pos_template
      state: 'Open'
    action:
      - service: notify.pushbullet_notify
        data:
          message: 'The North Garage Door Is Still Open'
      - service: timer.start
        entity_id: timer.north_garage_door

timer:
  north_garage_door:
    duration: '00:30:00'
2 Likes