Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

RESTful and XML Integration

$
0
0

@Stejo wrote:

Hi,

I´m trying to use the RESTful integration to get out data from a boiler. The result is in XML format, but as I understood it should convert to JSON according to this page https://xmltodict-debugger.glitch.me/

My config is:

- platform: rest
  resource: http://192.168.xxx.xxx:8080/user/var/120/10251/0/0/12242
  name: eta_tanktopp_temp
  device_class: temperature
  json_attributes:
    - strValue

The XML result is as following:

<?xml version="1.0" encoding="utf-8"?>
<eta version="1.0" xmlns="http://www.eta.co.at/rest/v1">
  <value uri="/user/var/120/10251/0/0/12242" strValue="79" unit="°C" decPlaces="0" scaleFactor="10" advTextOffset="0">792</value>
</eta>

And when using the converter I get the following:

{
  "eta": {
    "@version": "1.0",
    "@xmlns": "http://www.eta.co.at/rest/v1",
    "value": {
      "#text": "792",
      "@advTextOffset": "0",
      "@decPlaces": "0",
      "@scaleFactor": "10",
      "@strValue": "79",
      "@unit": "°C",
      "@uri": "/user/var/120/10251/0/0/12242"
    }
  }
}

I would like the sensor to get the @strValue, what is it I do wrong and do not understand?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>