Updating HA/Hass.io, checking for available versions and managing updates

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 %}
1 Like

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.

… and back to the drawing board on this one.

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
2 Likes

Great idea. I modified my template sensor to look as follows:-

- platform: template
  sensors:
    ha_update_available:
      friendly_name: 'HA Update Available'
      value_template: >-
        {%- if states.sensor.ha_latest_version.state != "unavailable" -%}
          {%- if states.sensor.ha_latest_version.state != states.sensor.ha_installed_version.state and "b" not in states.sensor.ha_latest_version.state -%}
            Yes
          {%- else -%}
            No
          {%- endif -%}
        {%- endif -%}

I won’t know for sure that the sensor and resulting alerts are working until the next update becomes available. Should work though.

Thanks for the idea to test for the “b” in the latest version … much appreciated.

1 Like

@aheath, @DavidFW1960
Hey guys,
Great ideas, but not what this original thread was about. You may want to start a new thread.

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?

This was great while it lasted but “https://raw.githubusercontent.com/home-assistant/hassio/dev/version.json” no longer gives current version of hassio.

This is how the current json files provides ‘{“hassio”: “105”, “homeassistant”: “0.70.0”}’, but the current version is actually 0.71.0.

Nm, I found your new topic Wrong Version Showing? with updated link: https://s3.amazonaws.com/hassio-version/stable.json

You can download and try the package linked here as well if you would like…

Is this advanced feature still available? I don’t see it on my hassio

It’s on the system tab now.

On mine it just showed up again and it’s on the hassio dashboard.

Yes in the system tab

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.

Is it still possible to get a notification when a new Hass.io version is released?

One of the former posts mentioned that this isn‘t possible any more.
Is there a „new“ way to do this?

I’m eager to know this as well. I’m then trying to update HASS via a command: How to update HASSIO via command or script

I’m guessing you want to automate updates?

When I was running HassOS I’d like to do a snapshot backup before running an upgrade, just incase the update breaks something

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.

Yes. I have snapshots automatically created at 3am every morning.

I realize this is an old topic but I am a bit confused over Version vs Release. I was running happily along with 0.84 on my Pi 3B+ with recent snapshots so I could get back to the same working place (Silly me for not getting it off the SD card.)

My SD card flat out died 3 days ago and I have all my yaml files on my computer but I have no idea where the snapshot files were and thought I’d get to it soon… I could read the SD card, but not write it so I made a copy (both file copy and img file). I put in a spare SD card and put the image back but no joy. It get’s further during the boot process but lots of FS errors.

So I realized I needed to build the whole system again and since it was running great at 0.84, I would start there and get that image file. Except there is no image for that version. I looked at the creation date of the files on my file copy and it was Dec of 2018. So I went to the downloads page and the closest dated release image I see is release 1.13 (not 0.84).

So while I think this is probably the correct release, I have zero confidence that it contains Hassio 0.84.Can someone cross reference releases with Hassio versions?

P.S. I don’t want to go to the latest release because I don’t know if all my addins like Alexa tts service will still work and I would like to upgrade in a controlled fashion.

Thanks in advance.