Automatic reset persistent notification? Dismiss?

HI,
i have an automation with a persistent notification that i would like to dismiss automatically when the trigger is solved.

- alias: Espresso bijvullen
  id: '1511601478447'
  trigger:
    platform: numeric_state
    entity_id: sensor.espresso_keuken_actueel
    above: 0
    below: 1
    for:
      minutes: 1
  condition: []
  action:
    - service: notify.notify
      data:
        title: 'Espresso bijvullen:'
        message: Espresso staat aan maar heeft geen water meer!
    - service: notify.ios_telefoonmhb
      data:
        message: Espresso needs refilling.
    - service: persistent_notification.create
      data:
        message : 
          "Espresso staat aan maar heeft geen water meer!"
        title: Espresso bijvullen

It is based on the power usage of the sensor/switch, which as you can see in the trigger is called when power is between 0 (off) and 1 (on but no water to heat). If above 1(1,6 actually but 1 would do just fine) (minimal power usage when in operation) the espresso machine is allright :wink:

Obviously I’d love to have only one automation, but I am struggling how to adjust the above with the Dismiss action. Could you please have a look with me?

Thanks,
Marius

Hi. Did you solve it?
I have a similar problem that I can’t figure.

You can probably use template sensor or variables from here: https://github.com/rogro82/hass-variables
It will function and handle the “dismissed” state.
Then use it as condition in your automation.

had forgotten about that one… always take care it doesn’t trigger :wink:

maybe this will work, will check in a minute:

- alias: Espresso bijvullen
  id: '1511601478447'
  trigger:
    platform: numeric_state
    entity_id: sensor.espresso_keuken_actueel
    above: 0
    below: 1
    for:
      minutes: 1
  condition: []
  action:
    - service: notify.notify
      data:
        title: 'Espresso bijvullen:'
        message: Espresso staat aan maar heeft geen water meer!
    - service: notify.notify #ios_telefoonmhb
      data:
        message: Espresso needs refilling.
    - service: persistent_notification.create
      data:
        message : 
          "Espresso staat aan maar heeft geen water meer!"
        title: Espresso bijvullen
        notification_id: "espresso notification"
    - condition: numeric_state
      entity_id: sensor.espresso_keuken_actueel
      above: 10
    - service: persistent_notification.dismiss
      data:
        notification_id: "espresso notification"
        message: "Enjoy!"

maybe better change the last message into:

- service: notify.notify
  data:
    title: "Espresso refilled."
    message: "Enjoy!"

otherwise we’ll have a new persistent notification to dismiss…

I was looking for a way to dismiss a notification WHEN a numeric value goes under a certain value.

Now I have a (maybe too) simple delay on the dismissal of the notification, based on the _id.
If the value is still over that value when the notification is dismissed, a new notification is created, with the same ID.
Not the cleanest way, but if I put the dismissal condition in the flow, and the value is under the threshold, the notify is NEVER dismissed

What am I missing?