Show HACS & Add-ons Updates on Lovelace

image

Info

The Supervisor integration (added release 2021.4) made it possible to show both HACS and Add-on updates in a card I added to my main lovelace view.
I also have other hardware that expose a binary_sensor with the words firmware_update and it gets picket up too.

Requirements

  • HACS Installed and sensor.hacs enabled
  • auto-entities card (available via HACS)
  • Home Assistant Supervisor and enabled binary_sensor entities for desired Add-ons (available since core release 2021.4)
  • Optional: I actually use Vertical Stack in Card (available via HACS) instead of vertical-stack for a sleeker design
type: vertical-stack
cards:
  - type: conditional
    conditions:
      - entity: sensor.hacs
        state_not: '0'
    card:
      type: markdown
      content: >-
        {% for repo in state_attr('sensor.hacs', 'repositories') %}

        **{{ repo.display_name }}** _{{ repo["installed_version"] }}_ -> _{{ repo["available_version"] }}_

        {% endfor %}
      title: Hacs Updates
  - type: custom:auto-entities
    card:
      type: entities
      title: Add-on Updates
      show_header_toggle: false
    filter:
      include:
        - entity_id: binary_sensor.*update*
          state: 'on'
          options:
            secondary_info: last-changed
      exclude: []
    sort:
      method: entity_id
    show_empty: false

The HACS markdown card is inspired by the notification recipe written by HACS Team.

4 Likes

Nice, thnx!