Hi!
I have another beginner question.
From a “Technische Alternative UVR1611 + CMI” heating control I receive the following JSON-data (shown in abbreviated form)
{
"Header":{
"Version":5,
"Device":"80",
"Timestamp":1627911243
},
"Data":{
"Inputs":[
{
"Number":1,
"AD":"A",
"Value":{
"Value":40.0,
"Unit":"1"
}
},
{
"Number":2,
"AD":"A",
"Value":{
"Value":70.5,
"Unit":"1"
}
},
{
"Number":3,
"AD":"A",
"Value":{
"Value":34.9,
"Unit":"1"
}
}
],
"Outputs":[
{
"Number":1,
"AD":"A",
"Value":{
"State":0,
"Value":0,
"Unit":"0"
}
},
{
"Number":2,
"AD":"A",
"Value":{
"State":0,
"Value":0,
"Unit":"0"
}
},
{
"Number":3,
"AD":"D",
"Value":{
"Value":0,
"Unit":"0"
}
},
{
"Number":4,
"AD":"D",
"Value":{
"Value":0,
"Unit":"0"
}
},
{
"Number":5,
"AD":"D",
"Value":{
"Value":0,
"Unit":"0"
}
},
{
"Number":6,
"AD":"A",
"Value":{
"State":1,
"Value":30,
"Unit":"0"
}
}
]
},
"Status":"OK",
"Status code":0
}
Now I like to add a sensor via REST-Api, that shows me for instance the value of input number 1 - 40.0.
But when adding a sensor with the configuation
value_template: ‘{{states.sensor.SENSORNAME.Data.Inputs[1].Value[1].Value}}’
it can’t receive any data, although it should be “40.0”?
I’ve tried several different ways to implement value_template, but it won’t work (“Header” and “Status” are no problem to receive).
Can you help me figuring out my mistake?
Kind regards,
gstoetti94
EDIT
Thanks to @koying and @Hellis81 there is the solution:
cmi34_tkollektor:
value_template: '{{ state_attr("sensor.cmi34","Data")["Inputs"][0]["Value"]["Value"] }}'
friendly_name: 'TKollektor'