Clear notifications

Hi,

I have a few sensors, like water leak sensors and they send alarm notifications to pushover like:

- alias: Water Leak Toilet Upstairs
  trigger:
  - entity_id: binary_sensor.lumi_lumi_sensor_wleak_aq1_19913602_ias_zone
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - service: notify.pushover
    data:
      title: Water Leak Toilet Upstairs
      message: Water Leak Toilet Upstairs
      data: 
        priority: 1
        sound: persistent

Is is a smarter way to clear the notification when the sensor is dry (offf) than having another automation rule (the opposite i.e. from on to off) - i.e having the same automation but dual messages or something lika that?

Use an alert.
This will give you a repeating notification until the sensor changes back to off. Let me know if you need help setting it up.

Thanks @Burningstone

Got it working by (for others wondering the same :wink: ):

configuration.yaml

notify:
  - name: pushover
    platform: pushover
    api_key: yyyyyyyyyyyyyyyyyyyyyyyyyyy
    user_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

## ....etc

alert: !include alert.yaml

alert.yaml

water-leak-laundry:
  name: Water leak Laundry
  done_message: Water leak Laundry cleared
  entity_id: binary_sensor.lumi_lumi_sensor_wleak_aq1_adaf3702_ias_zone
  state: "on"
  repeat: 1
  can_acknowledge: false
  skip_first: false
  data: 
    priority: 1 # check every minute
    sound: persistent
  notifiers:
    - pushover
1 Like

is it possible to add some conditions for the alert? I like to use this function as a window open reminder, if it is cold outside