If you don’t give any info on how you set up your sensor and automation, I (nor anyone else) can help you troubleshoot.
did the sensor show up in your states dev tool? Are the attributes included?
If you don’t give any info on how you set up your sensor and automation, I (nor anyone else) can help you troubleshoot.
did the sensor show up in your states dev tool? Are the attributes included?
I have everything setup as described,
sensor & switch are in dev tools.
but i have already updated that addon. so you don’t see an update now.
What is the state of the automation? Did you include initial_state: false
in the automation setup?
for some reason, my rest sensors for my add-ons dont have the “last_version” attribute anymore?
i only see “version” in the states … someone else got this too ?
EDIT : ok, seems the attribute is changed, its now : version_latest
I think the latest supervisor update may be at the root of this change. Thanks for digging into it, I hadn’t had the chance yet.
I’m getting this error… Why?
Logger: homeassistant.components.rest.sensor
Source: components/rest/sensor.py:249
Integration: rest (documentation, issues)
First occurred: 11:28:10 PM (1 occurrences)
Last logged: 11:28:10 PM
Empty reply found when expecting JSON data
Can you share your config?
I looks like the sensor is making the call but its getting nothing in return.
Here it is… the !secret llt is the long result i got from creating a new LLT
Is this still working? I get “REST result could not be parsed as JSON” in logs.
Yes, post your config, maybe I can help troubleshoot.
Found my error, typo
Did you solve this problem? I have it too with my config:
resource: http://192.168.50.54:8123/api/hassio/addon/core_deconz/info
name: deconz
value_template: '{{ value_json.data.state }}'
scan_interval: 60
headers:
Authorization: !secret llt
Content-Type: application/json
json_attributes_path: "$.data"
json_attributes:
- version
- version_latest
Logger: homeassistant.components.rest.sensor
Source: components/rest/sensor.py:249
Integration: rest (documentation, issues)
First occurred: 10:20:31 PM (6 occurrences)
Last logged: 10:25:39 PM
Empty reply found when expecting JSON data
Any ideas?
I am having problems with this…
secret llt
is a long lived token. To obtain a long lived token, go to your users profile page and scroll all the way to the bottom. Create a token and copy it in to your config. Once you close the window with the LLT you cannot view the token again so be sure to record it. My secret is formatted as follows: llt: "Bearer adfasdfadsfadsfasdfasdfasdfNiJ9.eyJpc3adfasdfasdfTZlZWQ0Nzsuperlongstring of numberslettersetc"
Be sure to add the Bearer
before the token and place the entire thing in quotes.
When I go to the bottom of the page an click create token, it asks for a name I name it Bearer, then I click ok. It produces a llt. I copy this to my secrets file looking like this.
‘Bearerjbf;qkbgfbrgbgbrbgbgbgbbgbergbgbrbg’
Is this what I am supposed to do?
Also when creating the sensor the resource has an http address:8123, I am using Nabu Casa, what do I add.
Thanks for the help.
Add a space after bearer in the secret.
If you are are using nabu casa you should be able to use just the ip with http for this internal call. Just as shown in the example.
Thanks for the quick response.
If you don’t mind a few more questions
In the sensor you have the following…
- platform: rest
resource: http://192.168.1.2:8123/api/hassio/addons/a0d7b954_adguard/info
name: adguard
In the text you say
For example this adguard add-on URL ends in /hassio/addon/a0d7b954_adguard
Notice the url… /hassio/addons/ versus /hassio/addon/
My url for adguard is /hassio/addon/
Which do I use for the sensor url?
Also mine does not have the /api/ (but I left it in the url)
carltonb
Interesting.
The URL when i go to an add-on says addon
while my sensor says addons
I wonder if there was a change at some point but they both still work. Not sure on this one. I would go addons
as I know that currently works for the rest api. The only thing you need to pull from the URL on the supervisor page is the add-on name (ie. a0d7b954_adguard)
the /api/
comes from the developer docs.
What typo was that? I have the exact same problem
EDIT: Found it myself. It’s /api/hassio/addons not /api/hassio/addon. The later did not work for me.
since today; this sensor is broken? Prevviously it compared the installed adoon vs addon available, and it gave an integer back when a new version was available
not it prompts that all my addons are outdated?
- platform: command_line
name: Supervisor Addon 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 }}"
scan_interval: 1440
json_attributes:
- newest_version
- current_version
- addons
output it gives : 5
newest_version: 2020.10.0
current_version: 2020.10.0
addons:
- name: Samba share
slug: core_samba
description: Expose Home Assistant folders with SMB/CIFS
state: started
version: 9.3.0
version_latest: 9.3.0
update_available: false
repository: core
icon: true
logo: true
- name: SSH & Web Terminal
slug: a0d7b954_ssh
description: SSH & Web Terminal access to your Home Assistant instance
state: started
version: 7.6.0
version_latest: 7.6.0
update_available: false
repository: a0d7b954
icon: true
logo: true
- name: deCONZ
slug: core_deconz
description: Control a Zigbee network with ConBee or RaspBee by Dresden Elektronik
state: started
version: 6.4.1
version_latest: 6.4.1
update_available: false
repository: core
icon: true
logo: true
- name: Check Home Assistant configuration
slug: core_check_config
description: Check current Home Assistant configuration against a new version
state: stopped
version: 3.6.0
version_latest: 3.6.0
update_available: false
repository: core
icon: true
logo: true
- name: motionEye
slug: a0d7b954_motioneye
description: 'Simple, elegant and feature-rich CCTV/NVR for your cameras'
state: started
version: 0.10.2
version_latest: 0.10.2
update_available: false
repository: a0d7b954
icon: true
logo: true
friendly_name: Supervisor Addon updates
any idea what i need to change?
@pergola.fabio you likely want to ask your question in the thread linked below. This thread doesn’t utilize the method you posted.