Corf
1
Hi, i got a rest sensor that gives me the following output:
[{"uuid":"c597f74b-c217-e811-80c2-000d3ab14a80","hasDefaultValues":false,"name":"Stue","nodeUuid":"c497f74b-c217-e811-80c2-000d3ab14a80","targetTemperature":19.0}]
i’m looking to extract only the targetTemperature property, but the following doesnt seem to work:
"{{ value_json[0].targetTemperature }}"
It is giving me a
Error rendering template: UndefinedError: value_json is undefined
Any ideas?
What about?
{{ value[0].targetTemperature }}
Corf
3
Getting the following:
Error rendering template: UndefinedError: ‘value’ is undefined
Please post the config of your rest sensor.
Corf
5
- platform: rest
name: ngenic
resource: https://app.ngenic.se/api/v3/tunes/XXXXXXX/rooms
headers:
Authorization: Bearer XXXXXXX
123
(Taras)
6
Shoudn’t the configuration of your RESTful sensor contain a value_template
?
value_template: "{{ value_json[0].targetTemperature }}"
Corf
7
Thanks, that solved it!
I originally had the value_template in there, but removed it in order to get the full payload into HA so i could experiement in the template editor.