I need some help in getting a rest sensor setup.
I have this setup in the config file.
sensor:
- platform: rest
resource: "http://192.168.1.41/vip.php?apiKey=KEY&cmd=req_extended_status"
name: Ram
value_template: "'{{ value_json.results.device.deviceStatus }}'"
The curl of the URL returns the below json data. However the the sensor entity says “unknown” and the attributes just say “Friendly Name: Ram”. The logs say that the value template I have set isn’t valid json data. I’m stuck at this point. Any help would be greatly appreciated.
{"errors":[],"results":{"commandResponseValue":{"valueName":"SET_EXTENDED_STATUS","valueType":"FIXME: SET_EXTENDED_STATUS","valueUnit":"changed","numericalValue":null,"textValue":"SupportChanged"},"device":{"action":"req_extended_status","latitude":"0" ,"longitude":"0", "address":null,"speed":"0.00 mph","fastestSpeed":null,"heading":0,"commandSequenceNumber":"223","odometerEstimate":null,"totalDistanceDriven":null,"rssi":"-67","satellites":"9","timeOfFix":"2022-07-18T04:51:00.000Z","updateTime":null,"deviceStatus":{"doorsLocked":true,"doorsOpen":false,"remoteStarterActive":false,"ignitionOn":false,"trunkOpen":false,"hoodOpen":false,"panicOn":false,"securitySystemTriggered":false,"securitySystemArmed":true,"valetOn":null,"dtcCodePresent":false,"engineStateChanged":false,"appMessage":"020000DF001F7500D003010090","appMessageD2D":"xxxx","deviceInterface":{"interfaceType":"02","interfaceTypeDesc":"D2D","partnerId":null,"customerDeviceCapabilities":null}},"displayMessage":null,"batteryVoltage":12.705}}}