[Solved] Automatically dismiss update notification when installed: doesn't work

Hi all,

I am creating a persistant notification when a new HA update becomes available. Now, I want to dismiss this notification automatically once the update was installed. I ended up with the following (in automations.yaml) but the problem is that it always dismisses the notification although the update has not been installed yet:

- alias: 'Update installed'
  trigger:
    - platform: state
      entity_id: sensor.installed_hassio_version
  condition:
    - condition: template
      value_template: "{{ states('sensor.installed_hassio_version') != states('sensor.latest_hassio_version') }}"
  action:
    - service: persistent_notification.dismiss
      data:
        notification_id: update_available

update_available is the notification ID. When I trigger this automation manually, it always deletes it immediately. sensor.installed_hassio_version holds the currently installed HassIO version and sensor.latest_hassio_version is the latest version available.

Do you have any idea what is going wrong here? If you need more infos, please let me know! :slight_smile:

Why?
If you update HA, it needs to be restarted, and persistent notifications don’t get restored, so they don’t show up after restart.

When you trigger an automation manually, only the action part will run, so that’s normal.

1 Like

Ahh thank you very much! Didn’t know that (both). Actually, your reply convinced my to simply test it and it worked well (which may also be related to the fact that there is nothing to be deleted after reboot since not restored anyway :smiley: ).

Thanks again, very helpful!