Hello community,
I know there are many topics regarding JSON, RESTsensor and its whole parsing stuff. I have read many of them and I think my configuration is correct, but Home Assistant is still showing “unknown” as value. Can you give me a hint?
The JSON response inside the body of my POST response:
{
"devices": [
{
"deviceid": "xxx",
"lastseen": 1617546078,
"lowbattery": false,
"measurement": {
"idx": 44341,
"ts": 1617546077,
"c": 1617546078,
"lb": false,
"t1": 17.9,
"t2": 10.2
}
}
],
"success": true
}
And my configuration.yaml
- platform: rest
method: POST
resource: https://www.data199.com/api/pv1/device/lastmeasurement?deviceids=xxx
# value_template: '{{value_json.devices[0].measurement.t1}}'
# value_template: '{{ value_json["devices"][0]["measurement"]["t1"] }}'
name: "Teich Versuch 3"
unit_of_measurement: "Try"
scan_interval: 60
I have tried both commented lines, I have tried the parameter ?deviceids via payload instead of resource… the entity is always “unknown”. I wanted to try less nested values of the JSON like “lastseen” but also just “unknown”…