Wrong Version Showing?

I just updated to version 0.70.1 but my rest sensor id still showing 0.70?

# Version and Availability
  - platform: rest
    resource: https://raw.githubusercontent.com/home-assistant/hassio/dev/version.json
    name: Hass Current Version
    value_template: '{{ value_json.homeassistant }}'

I think you should request a version bump

Gaaaaaa!!! They changed the location of the version json…

The json is now located here: https://s3.amazonaws.com/hassio-version/stable.json

I changed my sensors to this:

# Version and Availability
  - platform: rest
    resource: https://s3.amazonaws.com/hassio-version/stable.json
    name: Hass Current Stable Version
    value_template: '{{ value_json.homeassistant.default }}'

  - platform: rest
    resource: https://s3.amazonaws.com/hassio-version/beta.json
    name: Hass Current Beta Version
    value_template: '{{ value_json.homeassistant.default }}'

  - platform: version
    name: Hass Installed Version

  - platform: template
    sensors:
      hass_update_available:
        friendly_name: 'Hass Update Available'
        value_template: >-
          {%- if states.sensor.hass_current_stable_version.state != states.sensor.hass_installed_version.state and states.sensor.hass_current_stable_version.state != "unavailable"-%}
             Yes
          {%- else -%}
             No
          {%- endif -%}
        icon_template: >-
          {%- if states.sensor.hass_current_stable_version.state != states.sensor.hass_installed_version.state and states.sensor.hass_current_stable_version.state != "unavailable"-%}
            mdi:alert-box
          {% else %}
            mdi:approval
          {% endif %}

Hope it’s right… but it seems to be returning the right value.

I also changed my automation to:

- id: '1509933513624'
  alias: Update Available
  trigger:
  - entity_id: sensor.hass_current_stable_version
    platform: state
  condition:
  - condition: template
    value_template: '{{ states.sensor.hass_current_stable_version.state != "unavailable"
      and states.sensor.hass_current_stable_version.state
      != states.sensor.hass_installed_version.state }}'
  action:
  - data:
      message: Home Assistant {{ states.sensor.hass_current_stable_version.state }} is now
        available
      title: Home Assistant Update
    service: notify.notify
1 Like

How did you find this? Are you sure that’s the official location?

Perhaps the file in the repo should be deleted, to prevent mismatch.

I was told this on the Discord by @marius. He said @pvizeli had a post for it somewhere. It seems to be correct anyway. The URL for stable and Beta seems correct and the old thread is showing superseded information.

I like this automation, because for hassio the Updater component is of no use and I don’t like manually monitoring the hassio dashboard.

Thanks. It works well. It only looks at stable though for a notification. The sensors on the frontend show if there’s a beta anyway.

Really? It works for me.

- id: update_available 
  alias: 'Update Available Notifications'
  trigger:
    platform: state
    entity_id: updater.updater
  action:
    service: notify.ios_iphone
    data:
      message: 'Update for Home Assistant is available.'
      data:
        push:
          sound: "Update.wav"

It does work technically, but hassio updates usually follow in some days. This is what the Updater docs say:

The updater component will check daily for new releases. It will show a badge in the frontend if a new version is found. As Hass.io has its own schedule for release it doesn’t make sense to use this component on Hass.io.

You can keep it configured, however, to help the developers:

The updater component will also collect basic information about the running Home Assistant instance and its environment.

1 Like

I was wondering if there is a specific reason you are using a template sensor instead of a template binary sensor?

I think your automation will not be triggered. The entity_id should be sensor.hass_current_stable_version. :wink:

Unfortunately there is one drawback: at system start, the automations do not get triggered. I currently have 0.69.1 installed, the sensor shows 0.70.1 is available. I guess the automations are not yet available before the sensors get their initial value.

Yes you’re right. I need to change that as well. Thanks for the pickup.

Inspired by @DavidFW1960 I created my own updates.yaml package

I created a binary sensor for showing available updates. This would create an opportunity to use an alert instead of an automation.

Here’s the tweet about versions…

<@379453042640027649> it was a tweet https://twitter.com/pvizeli/status/1001530293004701696 found it in the end :smiley:

We use now s3.amazonaws.com/hassio-version/ with ‘stable.json’, ‘beta.json’ or ‘dev.json’ to receive version information for hass.io - The old file version.json from github will be not updated anymore

Fixed it and edited the post too. Thanks!

Is there a reason I should use a template binary sensor instead?

I’m going to take a look at your package in the next day or so too…

Copied and edited your package and it works great! (Changed text to English lol)

Just wondering what this is??

    binary_sensor.hass_update_available:
      <<: *customize
      friendly_name: 'Update Available Hass'
      device_class: safety

and

binary_sensor:
  - platform: template
    sensors:
      hass_update_available:
        value_template: >-
          {{ states.sensor.hass_current_stable_version.state != 'unavailable' and 
             states.sensor.hass_current_stable_version.state > states.sensor.hass_installed_version.state
              }}

Why safety? All I see is a shield. Is it a shield because I’m up to date and ‘safe’ and does it go to a cross and unsafe when I need to update?

I also added the dev stream.

My updated package can be found here..

I am experimenting with device_class.

The safety class shows a shield when ‘safe’ and an ‘mdi:alert’ icon when unsafe.

If you omit the device class you will get the default check box.

I am currently running hassio 0.69.1 and looking at the alert icon. :blush:

Fair enough… the safe/unsafe thing is what is confusing me mostly I think…