Supervisor Addon Updates Persistent Notification

I really like the way that the available HACS updates pending notification works. It will show you what integrations are available to update, the current installed version and the latest version available to install. It will pop up if something is released in HACS, or upon starting HA

The code for this can be found at ;

However, I wanted something similar to do the same function for Supervisor Addons. I did look at Update notifications! Core, HACS, Supervisor and Addons and it was very good but the notifications just show you

Updates available for X HA addons

Therefore, I have merged the two automations to show the same information for the Addons as the HACS integrations


To achieve this I used the sensor created by @CentralCommand at Update notifications! Core, HACS, Supervisor and Addons

    # Sensor to track available updates for supervisor & addons
- platform: command_line
  name: Supervisor
  command: 'curl http://supervisor/supervisor/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"newest_version","current_version","update_available","addons":[.data.addons[] | select(.update_available)]}'''
  value_template: "{{ value_json.addons | length }}"
  unit_of_measurement: pending update(s)
   - update_available
   - newest_version
   - current_version
   - addons

But instead tweaked the HACS notification automation slightly to display this information

alias: Notify - Supervisor - HA
  - platform: state
    entity_id: sensor.supervisor
  - platform: homeassistant
    event: start
  - condition: template
    value_template: '{{ states(''sensor.supervisor'') != ''unknown''}}'
  - condition: template
    value_template: '{{ (states(''sensor.supervisor'') | float) != 0}}'
  - service: persistent_notification.create
      title: Updates pending in Supervisor
      notification_id: supervisor-update
      message: |-
        {% for repo in state_attr('sensor.supervisor', 'addons') %}
          **{{ }}** _{{ repo["version"] }}_ -> _{{ repo["version_latest"] }}_
        {% endfor %}
mode: single

I hope others may find this useful too.

1 Like