HASS & HACS conditional update display card

Hi everybody,

this is just some yaml code for a card that will display whether there are HASS or HACS updates (and if there are HACS updates, show the amount). If there aren’t any, the card will be invisible. It uses custom:button-card to display the available updates, but you can use it without this as well.

Perhaps anybody has a use case for it. I check HACS regularly, but tbh forget to check if HASS updates are available (I used to have a card like this with my previous HASS instance, but forgot to recreate it when setting up on a new server… and every now and then realize that there is a newer version available - now I won’t forget to update any longer because the update card takes up a lot of space and is bright :wink: ).

EDIT: I added the current HASS version number to the card as well. You cannot see it in the example images, because I just changed the card now after posting the initial post.

Code at the bottom. Example images:

Both HASS and HACS updates

After updating one HACS integration

After updating all HACS integrations

After updating HASS

Code

type: vertical-stack
cards:
  - type: conditional
    conditions:
      - entity: binary_sensor.updater
        state: 'on'
    card:
      type: 'custom:button-card'
      entity: binary_sensor.updater
      icon: 'mdi:swap-vertical'
      color: '#41bdf5'
      color_type: card
      label: |
        [[[
          return states['binary_sensor.updater'].attributes.newest_version;
        ]]]
      name: Update available
      tap_action:
        action: more-info
      styles:
        card:
          - font-size: 24px
  - type: conditional
    conditions:
      - entity: sensor.hacs
        state_not: '0'
    card:
      type: 'custom:button-card'
      entity: sensor.hacs
      icon: 'mdi:unfold-more-horizontal'
      color: '#f541d6'
      color_type: card
      show_label: true
      show_name: false
      label: |
        [[[
         return states['sensor.hacs'].state + " HACS Updates available";
        ]]]
      tap_action:
        action: more-info
      styles:
        card:
          - font-size: 24px
4 Likes