# HomeyScript XML SOAP

**URL:** <https://community.homey.app/t/homeyscript-xml-soap/2234>\
**Category:** Developers\
**Created:** [September 28, 2018, 9:27pm UTC](https://community.homey.app/t/homeyscript-xml-soap/2234 "2018-09-28T21:27:21Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Bassie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bassie/32/10496_2.png) [@Bassie](https://community.homey.app/u/Bassie)\
**Post date:** [December 12, 2018, 3:25pm UTC](https://community.homey.app/t/homeyscript-xml-soap/2234/7 "2018-12-12T15:25:40Z")

</div>

I use this in a HomeyScript to get some JSON-data from a rooted Eneco Toon, for use in a flow:

```
var url = "http://192.168.1.30/happ_thermstat?action=getThermostatInfo";
(async () => {
     const rawResponse = await fetch(url, {
    method: 'GET',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    },
  });
  const content = await rawResponse.json();
 //console.log(content);

  if (content.currentTemp !== null && content.currentTemp != '') {
    var currentTemp = content.currentTemp/100;
    var setTemp = content.currentSetpoint/100;
    var states = Array("Comfort", "Thuis", "Slapen", "Weg");
    var state = states[content.activeState];
    if (content.activeState == -1) {
      state = "Not Set";
    }
    await setTagValue("toon_current", {type: "number", title: "Temperatuur op Toon®"}, currentTemp);
    await setTagValue("toon_set", {type: "number", title: "Ingestelde temp. op Toon®"}, setTemp);
    await setTagValue("toon_status", {type: "string", title: "Status op Toon®"}, state);
  }
})();
return true;
```

---

_[View the full topic](https://community.homey.app/t/homeyscript-xml-soap/2234)._
