francisp
(Francis)
March 9, 2023, 5:38pm
1
I have this sensor :
- platform: rest
unique_id: os_agent_rest_installed8123
name: OS Agent Version Installed
resource: http://localhost:8123/api/hassio/host/info
value_template: "{{ value_json.data.agent_version }}"
scan_interval: 604800
headers:
Authorization: 'Bearer eyJ0exxxxx'
User-Agent: Home Assistant
Content-Type: application/json
On 2023.3.1 and before, I get
on 2032.3.2 i get
2023-03-09 18:24:28.620 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.data.state }}'
2023-03-09 18:24:34.984 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.data.agent_version }}'
I don’t have a solution, but I do have similar error.
- platform: rest
resource: http://192.168.1.20:8123/api/hassio/addons/15d21743_samba_backup/info
name: sambabackup
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
francisp
(Francis)
April 7, 2023, 3:05am
3
With 2023.4.0, I don’t need it any more. There is a fix, as there is now an integrated os agent version sensor in the supervisor integration.
An issue was created but it doesn’t seem to be fixed yet or maybe it has in 2023.4 I have yet to upgrade.
francisp
(Francis)
April 8, 2023, 4:34am
5
They are available in 2024.4
Got it. Fixed now.
They could have said in the error something like, the sensor may have automatically been created. You may delete your current sensor.