Current and Latest version sensors for local install and docker images

I have in my yaml the following sensors defined

- platform: version
  name: Current Version
  source: local

- platform: version
  name: Latest Version
  image: default
  source: docker

I’m using docker-compose and

image: homeassistant/home-assistant:latest

to pull the latest image from dockerhub.

Are my sensors setup correctly so that Current version is reporting the correct installed version and Latest version is reporting the correct version number from what is currently published for homeassistant/home-assistant:latest on docker hub?

I have these working sensors for installed and available version. I’m using docker as well.

  - platform: version
    name: HASS Available
    source: docker
    beta: true

  - platform: version
    name: HASS Installed

If beta is true it will also take beta versions into consideration.

I’m not using HASS though. Isn’t that going to be deprecated?

HASS is the name I gave to the sensor and it stands for home assistant. You probably mean Hassbian, which has been deprecated.

On my side I looked at this page: Version - Home Assistant

and clicked the “Add integration” button. I then picked the local version and did it again with the Docker hub version.

Additionally, in case anyone reading this with the end goal of:

  1. Sending a notification on his phone when an update is available
- id: 'THE_AUTOMATION_GENERATED_ID'
  alias: New version of Home Assistant available
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.docker_hub_update_available
    to: 'on'
  condition: []
  action:
  - device_id: YOUR_DEVICE_ID_HERE
    domain: mobile_app
    type: notify
    title: Home Assistant update
    message: A new version is available.\n{{ states("sensor.current_version") }} ➡️
      {{ states("sensor.docker_hub") }}
    data:
      tag: home_assistant_update_available
  mode: single
  1. Display a card conditionally on a dashboard
type: conditional
conditions:
  - entity: binary_sensor.docker_hub_update_available
    state: 'on'
card:
  type: markdown
  content: |-
    A new version is available.
      
    **{{ states("sensor.current_version") }} ➡️ {{
          states("sensor.docker_hub") }}**
  title: Home Assistant
2 Likes