Hi community, I am pretty new to OpenHAB and currently learning my first steps and ran into a “problem”. So I have a HTTP Binding and I am retrieving an XML from my heating unit. The XML looks as follows:
<eta xmlns="http://www.eta.co.at/rest/v1" version="1.0">
<value uri="/user/var/120/10101/0/0/12197" strValue="9,2" unit="°C" decPlaces="1" scaleFactor="10" advTextOffset="0">92</value>
</eta>
So I want to extract the attribute strValue (9,2) and also send this value to InfluxDB and in the end visualize the values with Grafana. Here now comes my problem, I can extract the value with XPATH - but since the XML returns the wrong number notation (comma instead of a point for decimal points) Grafana interprets this as String and would not plot the values. Thus, I want to send the properly formatted value already to InfluxDB.
My item working definition is as follows:
String ETA_Outside_Temp "Temp [%s C]" { http="<[http://somehost/user/var/120:60000:XPATH(//*[local-name()='eta']/*[local-name()='value']/@strValue"}}
Now I thought that I can easily use XPATH functions, such as replace, to directly return a properly formatted number:
Number ETA_Outside_Temp "Temp [%.1f C]" { http="<[http://somehost/user/var/120:60000:XPATH(replace(//*[local-name()='eta']/*[local-name()='value']/@strValue, ",", ".") "}}
But then I get the following error in the openhab.log: “mismatched input '”, "’ expecting RULE_ID
Maybe someone can help me out on how to properly use XPATH functions (if that is possible at all) or point me to the right direction on how to solve this?
Thanks, Chris