Update notifications! Core, HACS, Supervisor and Addons (now a blueprint!)

Warning - this code requires supervisor version 213
Supervisor is still in early stages and so clearly changes must be expected. If you haven’t updated to 213 yet then you’ll need to change .data.version_latest above to .data.last_version as it appears the response schema to this API was changed in that release.

Trying to get this to work but dont get all the information in the sensor. Missing the newest version.

newest_version: null
current_version: '243'
addons: []
friendly_name: Supervisor updates

My code:

  - platform: command_line
    name: Supervisor updates
    command: 'curl http://supervisor/supervisor/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"newest_version":.data.last_version,"current_version":.data.version,"addons":[.data.addons[] | select(.version != .installed)]}'''
    value_template: "{{ value_json.addons | length }}"
    json_attributes:
    - newest_version
    - current_version
    - addons

Change your command from
‘.data.last_version’
to
‘.data.version_latest’
and you should be good to go.

Did that and now its working. Update the text on the top! :+1:

Someone know how to extract the same information except from operating-system?

This is how i do it. Version can be found on the home assistant web page under Integrations tab.

https://www.home-assistant.io/integrations/version/

The command_line sensor can be found further up the page.


- platform: version
  name: Available OS
  source: hassio
  image: raspberrypi3
  beta: false

- platform: command_line
  name: HassOS Current
  command: 'curl http://supervisor/host/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"hassos":.data.operating_system}'''
  value_template: "{{ value_json.hassos[7:] }}"

1 Like

Logger: pyhaversion
Source: /usr/local/lib/python3.8/site-packages/pyhaversion/init.py:184
First occurred: September 16, 2020, 8:16:36 PM (174 occurrences)
Last logged: 10:56:39 AM

Error parsing version information from Hassio, ‘hassos-cli’

I’m receiving the above error when using your code.

Not my code as stated, but you are right, there are a lot of errors, not just with this command_line sensor but with all of mine since Supervisor 244 update!
Quick and easy out is to utilise version with the local setting and see what changes 0.115 and another supervisor brings.


- platform: version
  name: HassOS Current
  source: local
  

Not relevant at all, the library used in Home Assistant needed an adjustment, that has been fixed in 0.115

1 Like

No problem thanks for the update. Waiting to see 0.115 update.

I’m not sure what to update. The code up top is this:

# Sensor to track available updates for supervisor & addons
- platform: command_line
  name: Supervisor updates
  command: 'curl http://supervisor/supervisor/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"newest_version":.data.version_latest,"current_version":.data.version,"addons":[.data.addons[] | select(.version != .installed)]}'''
  value_template: "{{ value_json.addons | length }}"
  json_attributes:
  - newest_version
  - current_version
  - addons

That correctly has .data.version_latest in there. Maybe the note is confusing? I was trying to say your supervisor must be version >= 213 to use this code as is. If you’re running supervisor version < 213 then you’ll need to adjust that one bit.

Honestly I think I can just remove that note at this point. Supervisor auto-updates so I don’t know how someone would be < 213 anymore.

FWIW, the HA containers have been breeding again and there is a new one called observer…

1 Like

I know you posted this a few months ago but I just saw it and have a question.
As a test I copied the code as you have listed.
remote_ui is in a folder switches/cloud.yaml
button card was put in lovelace
And then lovelace was all setup.
All looks good but I do not have the lock on the remote ui. Killed my system 2x’s trying to understand it.
What might I be doing wrong.

1 Like

So based on what you said in regards to the notifiers if my Telegram Notifier is
notify.telegram_chef
Would I put in telegram_chef or just telegram

notifiers:
  - telegram_chef
or
 - telegram

I’m sorry you’ve had such a hard time trying to make this work. The lines

lock:
  enabled: true

are the part of the custom button card configuration that enable the lock, as shown here

Did you by chance not scroll down to copy all of the code in my previous post?

That would be telegram_chef in your case. :slight_smile:

Dang yaml spacing. I had what you have but I had this

lock:
enabled: true

instead of this

lock:
  enabled: true

Again thanks for a fresh pair of eyes.

Thank you for the help

1 Like

Yup, spacing in YAML can be tricky! Glad you found the problem. :slight_smile:

hi @CentralCommand, very nice work! I have one question, how do I fill out the fields in node-red for example to the notify me:

image

I’m trying to find it out by listening to the messages in node-red but I didn’t succeed yet. Thanks for your help!

I see that entity_id is depreciated do you need to change your code?

think I didnt miss it in reading all of the above, but can we also create a sensor for the current and available OS version?

none of the supervisor sensors nor eg this

  - platform: rest
    name: Hassio Rpi4 config
    resource: !secret resource_hassio_rpi4_config
####    authentication: basic
    value_template: > #components|list|count}}
      {{value_json.version}}
    json_attributes:
      - components
      - unit_system
      - config_dir
    headers:
      Content-Type: application/json
      Authorization: !secret api_bearer_token
      User-Agent: Home Assistant REST sensor
    scan_interval: 3600

point to the version for Operating system. Since this tends to update rather frequently, without signaling in the frontend, it would really be nice to create a sensor for that.

1 Like