Home Assistant update notifications

For whatever reason the builtin updater.updater sensor doesn't seem to trigger notifications for me. So I built my own..

The sensor is as follows:

  - platform: rest
    name: ha_docker_version
    resource: 'https://registry.hub.docker.com/v2/repositories/homeassistant/home-assistant/tags'
    value_template: >-
      {% set results = value_json.results %}
      {%-set res-%}
      {%-set pipe = joiner('|')-%}
      {% for result in results if not result.name |regex_search("[a-z]",ignorecase=TRUE) -%} 
        {{ pipe()}}{{result.name}}      
      {% else %}        
      {% endfor -%}
      {% endset -%}
      {% set res = res.split('|')|list -%}
    scan_interval: 1800  

The automation is as follows:

- alias: 'Update Available Notifications'
    - platform: template
      value_template: >
        {{ states.sensor.ha_docker_version.state > states.sensor.current_version.state }}
    - service: notify.notify_tzvi
        title: '*Update Available ({{ states.sensor.ha_docker_version.state }})!*'
        message: 'Time to update Home Assistant!'

And in Lovelace I have the following card:

 - type: entities
   title: "Home Assistant Versions"
     - entity: sensor.current_version
       name: Current Version
     - entity: sensor.ha_docker_version
       name: DockerHub Version

Just to note, I use HA in Docker, so the sensor check the Docker registry for updates. Additionally, you'll need to have your notification component setup as well.

The code was compiled from the Home Assistant forums.