Updater card to show new version?

Hi,

i’m using Hassio, and when an update is available, i have the updater.updater entity being created somehow. I can add a card or a badge in lovelace to notify me that an update is available.

That all works well until i actually update, and once i’m on the latest version, it seems the updater.updater entity doesn’t exist anymore, and the UI elements break.

Do you know what i can do to have a Lovelace badge showing only when there is an update available ? Or a Lovelace card maybe (even though the badge looks much nicer).

Or is it a problem in the backend where updater.updater should always exist, but have a different state if there is no update available ?

Thanks !

2 Likes

Yeah, it only exists when there’s an update available and when there’s not it’s just not there and messes up its Lovelace entity. I ended up deleting it from the frontend and just rely on the automated alert.

I have an automatic persistent notification. Got this by looking at @frenck’s code (thanks a lot!!!):

in configuration.yaml:

sensor:
#Hassio version detection sensors
  - platform: version
    name: version_available
    source: hassio
    image: raspberrypi3
    
  - platform: version
    name: version_current   

in automation.yaml (or if you do not have it split out, the same configuration.yaml):

- alias: system_upgrade_alert
  trigger:
platform: state
entity_id: sensor.version_available
  condition:
- condition: template
  value_template: >-
    {{
      states('sensor.version_available')
      !=
      states('sensor.version_current')
    }}
  action:
- service: notify.ios_iphone_rene
  data_template:
    title: Upgrade time!
    message: >-
      There is a Home Assistant upgrade for Hass.io pending!
      Version {{ states('sensor.version_available') }} just got released!
    data:
      attachment:
        content-type: png
        url: https://raw.githubusercontent.com/home-assistant/home-assistant-assets/master/logo-round-192x192.png
- service: persistent_notification.create
  data_template:
    title: Upgrade time!
    message: >-
      There is a Home Assistant upgrade for Hass.io pending!
      Version {{ states('sensor.version_available') }} just got released!
    notification_id: hassio_upgrade

This is based on the version sensor:

2 Likes

that’s an awful lot of configuration for something that should be built-in, isn’t it ?

1 Like

You will get the message in the frontend, but no automatic push message to push notification to your devices.

or you can just use a conditional or entity-filter card to only display the entity when it is actually active.

I do this

sensor:
  #==============================
  #=== Installed hass.io version
  #==============================
  - platform: version
    name: Installed Version

  #================================
  #=== Latest Available HA Version
  #================================
  - platform: version
    name: Latest Available Version
    beta: false
    image: raspberrypi3
    source: hassio

Then in Lovelace

          - entity: sensor.installed_version
            name: Hassio Installed Version
            icon: mdi:home-assistant
          - entity: sensor.latest_available_version
            name: Hassio Current Version
            icon: mdi:home-assistant

image

6 Likes

My config:

configuration.yaml

sensor:
  - platform: version
    source: docker # change to your source

  - platform: version
    source: local

binary_sensor:
  - platform: template
    sensors:
      up_to_date:
        value_template: "{{ states('sensor.current_version') == states('sensor.latest_version') }}"

lovelace card config:

type: conditional
conditions:
  - entity: binary_sensor.up_to_date
    state: 'off'
card:
  type: entities
  entities:
    - sensor.latest_version

1 Like

Hi Everyone,

I’m new to HA relatively and I hope this is the right thread to ask my question. Currenty I use HA on an RBpi running Raspbian and installed within Python virtualenv (ver. 3.7.3).
My problem is that the installed version entity always shows the same version (0.103.6 was the initial version I installed HA) even after a fresh upgrade.
Can someone tell me what did I wrong or what to do to solve this?

THX

Version sensors:

  - platform: version
# Installed version
    name: HA telepített verzió
  - platform: version
# Available version
    name: HA elérhető verzió
    image: default
    source: pypi

Lovelace (customize.yaml):

sensor.ha_telepitett_verzio:
  friendly_name: Telepített verzió
  icon: mdi:home-assistant
sensor.ha_elerheto_verzio:
  friendly_name: Elérhető verzió
  icon: mdi:cloud-download

The card looks like this at the moment:
Screenshot_20200121_200919

Hi @Klogg, I get your config but could you help me with a couple of things please, I understand the sensor part goes in configuration.yaml but where you say “then in Lovelace” I don’t understand, do you add this script as a card, what card template do you use? Sorry noob and steep learning curve but getting there.

Edit: I figured out how to show each state as badges but not a card.

That depends on whether you configure Lovelace manually or via the UI.
I am guessing you let the UI manage it in which case I can’t help with the specifics as I do it manually but hopefully the following should help you get there (or someone else can point you in the right direction).

In one of your views you need to include an entities card like this:

      - type: entities
        show_header_toggle: false  # <-- this is optional. See the docs.
        entities:
          - entity: sensor.installed_version
            name: Hassio Installed Version
            icon: mdi:home-assistant
          - entity: sensor.latest_available_version
            name: Hassio Current Version
            icon: mdi:home-assistant