It is exactly that.
I am trying to update my Hassio back again , checking for available versions to do so and manage updates in the various available methods.
Managed to get back to 0.61 via the Curl command but it won’t update to 0.61.1 like that or the Hassio updater.
I use the following to ascertain current version of Hass.io (running on a RPi3), and the latest available version, and then to send an alert when a new version is available. Please note that this works for the release of Hass.io updates, and not for the general release. I think that is what people were asking for was it not?
##sensors.yaml file
- platform: rest
resource: https://raw.githubusercontent.com/home-assistant/hassio/dev/version.json
name: HA Latest Version
value_template: '{{ value_json.homeassistant }}'
- platform: version
name: HA Installed Version
- platform: template
sensors:
ha_update_available:
friendly_name: 'HA Update Available'
value_template: >-
{%- if states.sensor.ha_latest_version.state != states.sensor.ha_installed_version.state -%}
Yes
{%- else -%}
No
{%- endif -%}
icon_template: >-
{%- if states.sensor.ha_latest_version.state != states.sensor.ha_installed_version.state -%}
mdi:alert-box
{% else %}
mdi:approval
{% endif %}
## automations.yaml
- alias: Update Notification
action:
- data:
message: "New Home Assistant version {{ states.sensor.ha_latest_version.state}}\
\ is available for download.\r\n\r\nYou are currently running {{ states.sensor.ha_installed_version.state}}.\r\
\n\r\nhttps://home-assistant.io/blog/categories/release-notes/"
title: New Home Assistant version
service: notify.my_email
condition: []
id: '1515492307283'
trigger:
- entity_id: sensor.ha_update_available
from: 'No'
platform: state
to: 'Yes'
A couple of false positives over the last 48 hours, caused by the REST sensor returning “unavailable” for one reason for another (could be my internet connection or the webpage itself … not really sure). Updated the template sensor for “HA Update Available” to check for this.
- platform: template
sensors:
ha_update_available:
friendly_name: 'HA Update Available'
value_template: >-
{%- if states.sensor.ha_latest_version.state != "unavailable" and states.sensor.ha_latest_version.state != states.sensor.ha_installed_version.state -%}
Yes
{%- else -%}
No
{%- endif -%}
icon_template: >-
{%- if states.sensor.ha_latest_version.state != "unavailable" and states.sensor.ha_latest_version.state != states.sensor.ha_installed_version.state -%}
mdi:alert-box
{% else %}
mdi:approval
{% endif %}
Yeah this was also driving me crazy - the notifications - so I had already added that condition to my notifications. Thanks for this though. Works great.
Due to the way updates are not being “staged” to be betas for a week before becoming “stable” releases, my sensors are reporting a new version when there in fact is no update.
Current sensor is returning 0.66.0.b2 when the latest hassio stable release is in fact 0.65.6
same but I fixed it with a new condition in my automation (to turn off the notifications). You can amend the sensor in config l guess.
- alias: Update Available
trigger:
- entity_id: sensor.hass_current_version
platform: state
condition:
- condition: template
value_template: '{{ states.sensor.hass_current_version.state != "unavailable"
and "b" not in states.sensor.hass_current_version.state and states.sensor.hass_current_version.state
!= states.sensor.hass_installed_version.state }}'
action:
- data:
message: Home Assistant {{ states.sensor.hass_current_version.state }} is now
available
title: Home Assistant Update
service: notify.notify
This is a nice enhancement, Thanks! The only thing I am trying to play with is the ability to get a repeating notification if I restart HA. For example, I see there is currently an update available for me but it will not trigger the notification because it’s not changing the state from No to Yes when I restarted HA because it is already Yes. So is there a way to maybe change the default state to “No” when HA restarts to have it change to “Yes” and then trigger the automation?
It has changed some, the update shows up under the dashboard as you discovered. It will show the new version and the current version. Remember that the new version for Hassio shows up a day or two after the release.
To find out the current version that you are running (when an update is not pending) go to the developer tools on the bottom of the left column and click on the information (about) button on the right. It will show the current software version.
No, I don’t want automated updates as I want the opportunity to read the release notes to check for breaking change it before performing the update. However, it is a sort of semi-automated update without having to visit the web interface.
Interestingly, talking about snapshots, it is possible to call the snapshot making process from services, so it will be possible to automate the whole process.