# 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:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrik](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrik/32/1236_2.png) [@Patrik](https://community.homey.app/u/Patrik)\
**Post date:** [September 28, 2018, 9:27pm UTC](https://community.homey.app/t/homeyscript-xml-soap/2234/1 "2018-09-28T21:27:22Z")

</div>

Hi,  
Is it possible to post XML SOAP from the HomeyScript app with JavaScript?  
Just need it for a sending a “wake up” to my sat receiver.

Regards  
Patrik

---

<div class="post-metadata">

**Author:** ![Patrik](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrik/32/1236_2.png) [@Patrik](https://community.homey.app/u/Patrik)\
**Post date:** [October 4, 2018, 4:34pm UTC](https://community.homey.app/t/homeyscript-xml-soap/2234/2 "2018-10-04T16:34:08Z")

</div>

Or if there is someone how can make an app with this.

POST /upnpfun/ctrl/uuid\_1586d400-1dd2-11b2-8862-e8f2e2b2314c/04 HTTP/1.1  
Host: \<ip\_of\_device\>:8080  
Content-Type: text/xml  
SOAPACTION: “urn:adbglobal.com:service:X\_ADB\_RemoteControl:1#ProcessInputEvent”  
Cache-Control: no-cache  
Postman-Token: 72423203-45e2-4665-9173-44fc59179e5b

\<s:Envelope s:encodingStyle=“[http://schemas.xmlsoap.org/soap/encoding/](http://schemas.xmlsoap.org/soap/encoding/)” xmlns:s=“[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)”\>  
\<s:Body\>  
\<u:ProcessInputEvent xmlns:u=“urn:adbglobal.com:service:X\_ADB\_RemoteControl:1”\>  
code=115  
\</u:ProcessInputEvent\>  
\</s:Body\>  
\</s:Envelope\>

The different input code translation:  
116 =\> “POWER”  
, 174 =\> “HOME”  
, 361 =\> “VOD”  
, 365 =\> “EPG”  
, 367 =\> “APP”  
, 395 =\> “LIST”  
, 114 =\> “VOL-”  
, 113 =\> “MUTE”  
, 115 =\> “VOL+”  
, 103 =\> “UP”  
, 108 =\> “DOWN”  
, 105 =\> “LEFT”  
, 352 =\> “OK”  
, 106 =\> “RIGHT”  
, 357 =\> “OPT”  
, 358 =\> “INFO”  
, 402 =\> “PROG+”  
, 403 =\> “PROG-”  
, 158 =\> “BACK”  
, 385 =\> “RADIO”  
, 102 =\> “PORTAL”  
, 388 =\> “TEXT”  
, 398 =\> “RED”  
, 399 =\> “GREEN”  
, 400 =\> “YELLOW”  
, 401 =\> “BLUE”  
, 128 =\> “STOP”  
, 207 =\> “PLAY”  
, 119 =\> “PAUSE”  
, 167 =\> “REC”  
, 168 =\> “\<\<”  
, 159 =\> “\>\>”  
, 2 =\> “[1]”  
, 3 =\> “[2]”  
, 4 =\> “[3]”  
, 5 =\> “[4]”  
, 6 =\> “[5]”  
, 7 =\> “[6]”  
, 8 =\> “[7]”  
, 9 =\> “[8]”  
, 10 =\> “[9]”  
, 11 =\> “[0]”];

---

<div class="post-metadata">

**Author:** ![Chris\_Peters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_peters/32/1851_2.png) [@Chris\_Peters](https://community.homey.app/u/Chris_Peters)\
**Post date:** [November 28, 2018, 8:17pm UTC](https://community.homey.app/t/homeyscript-xml-soap/2234/4 "2018-11-28T20:17:15Z")

</div>

Hi Patrik, good question, I’m also looking for a way to send a GET or POST request from Homey to in my case an Ethernet Power Relay

Hope someone has an idea how to do this; I’m trying to write an app and will than try to use normal javascript, see if that works, will let you know

Chris

---

<div class="post-metadata">

**Author:** ![Chris\_Peters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_peters/32/1851_2.png) [@Chris\_Peters](https://community.homey.app/u/Chris_Peters)\
**Post date:** [November 28, 2018, 8:34pm UTC](https://community.homey.app/t/homeyscript-xml-soap/2234/5 "2018-11-28T20:34:32Z")

</div>

Here **[https://apps.athom.com/app/com.athom.homeyscript](https://apps.athom.com/app/com.athom.homeyscript)** it says that HomeyScript supports fetch; with that you should be able to do a POST

Chris

---

<div class="post-metadata">

**Author:** ![Patrik](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrik/32/1236_2.png) [@Patrik](https://community.homey.app/u/Patrik)\
**Post date:** [December 5, 2018, 8:17pm UTC](https://community.homey.app/t/homeyscript-xml-soap/2234/6 "2018-12-05T20:17:59Z")

</div>

Thanks Chris, will look in to that.  
If you have made any script please share them so I can get an example.

Regards  
Patrik

---

<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;
```

---

<div class="post-metadata">

**Author:** ![Chris\_Peters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_peters/32/1851_2.png) [@Chris\_Peters](https://community.homey.app/u/Chris_Peters)\
**Post date:** [January 29, 2019, 8:46pm UTC](https://community.homey.app/t/homeyscript-xml-soap/2234/8 "2019-01-29T20:46:40Z")

</div>

Sorry I’ve been busy with other stuff; I just did this to control a LAN relay that will eventually control my ventilation valves and heating valves. Works fine from HomeyScript; I have not tried it from an compiled with the SDK.

var command = ‘[http://192.168.2.50/FF0100](http://192.168.2.50/FF0100)’;

fetch(command)  
.then(function(response) {  
return response.text();  
})  
.then(function(data) {  
console.log(data);  
})
