I am trying to integrate Heatermeter into HA, and need to parse a long JSON result into HA. I have brought the JSON into the template editor, and figured out the correct templates, but the sensor dosen’t work. I want to get a sensor for the set temp, then each of the four “C” values.
Sensor.yaml code:
- platform: rest
name: hm_set
resource: http://www.json-generator.com/api/json/get/bUqTKMCRea
value_template: '{{ value_json[set] }}'
- platform: rest
name: hm_pit
resource: http://www.json-generator.com/api/json/get/bUqTKMCRea
value_template: '{{ value_json.temps.0.c }}'
JSON code:
{
"time": 1553700649,
"set": 240,
"lid": 0,
"fan": {
"c": 0,
"a": 0,
"f": 0
},
"adc": [
0,
0,
0,
0,
0,
0
],
"temps": [
{
"n": "Pit",
"c": null,
"a": {
"l": 180,
"h": 260,
"r": "l"
}
},
{
"n": "Flat",
"c": 76,
"a": {
"l": -40,
"h": 195,
"r": null
}
},
{
"n": "Probe 2",
"c": 85,
"a": {
"l": -40,
"h": -200,
"r": null
}
},
{
"n": "Point",
"c": 90,
"a": {
"l": -40,
"h": 195,
"r": "h"
}
}
]
}