ETA heating: Problems reading outdoor temperature via REST and displaying it as a sensor in Home Assistant
Hello,
I wanted to display the outdoor temperature in Home Assistant (Docker Version). For this I access the REST API from our ETA heating (Pellets Compact PC-20):
<?xml version="1.0" encoding="UTF-8"?>
<eta version="1.0" xmlns="http://www.eta.co.at/rest/v1">
<value advTextOffset="0" unit="°C" uri="/user/var/40/10241/0/0/12197" strValue="13,6" scaleFactor="10" decPlaces="1">136</value>
</eta>
Using Free Online XML to JSON Converter - FreeFormatter.com I converted the XML to JSON so I know the structure for Home Assistant:
{
"@version": "1.0",
"value": {
"@advTextOffset": "0",
"@unit": "°C",
"@uri": "/user/var/40/10241/0/0/12197",
"@strValue": "13,6",
"@scaleFactor": "10",
"@decPlaces": "1",
"#text": "136"
}
}
With https://jsonpathfinder.com/ I searched for the path (x.value["@strValue"])
In the configuration.yaml I created a sensor:
sensor:
- platform: rest
name: "Aussentemperatur"
unique_id: "AussenVerbr"
resource: http://IP-FROM-ETA:8080/user/var/40/10241/0/0/12197
value_template: "{{ value_json['@value']['@strValue'] }}"
unit_of_measurement: "°C"
device_class: "temperature"
scan_interval: 300
method: GET
Unfortunately, the sensor in Home Assistant only says “unknown” for the value.
I have tried different specifications for value_template, but I do not get the value displayed. Does anyone have an idea what I am doing wrong?
Many thanks in advance.