# iAqualink send command on off

**URL:** <https://discourse.nodered.org/t/iaqualink-send-command-on-off/88041>\
**Category:** General\
**Created:** [16 May 2024 22:13 UTC](https://discourse.nodered.org/t/iaqualink-send-command-on-off/88041 "2024-05-16T22:13:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Veuchez](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/veuchez/32/91025_2.png) [@Veuchez](https://discourse.nodered.org/u/Veuchez)\
**Post date:** [16 May 2024 22:13 UTC](https://discourse.nodered.org/t/iaqualink-send-command-on-off/88041/1 "2024-05-16T22:13:30Z")

</div>

Hi everyone, reading the forum ( [iAqualink for Pool Equipment strike again - #5 by Tico](https://discourse.nodered.org/t/iaqualink-for-pool-equipment-strike-again/63321/5)) I managed to collect all the data from the eXO chlorinator, but I can't understand how to send the commands to turn off, turn on, set the boost etc...  
can you help me please?  
The command should be this:

```auto
curl -X POST -H "Host:prod.zodiac-io.com" -H "accept:application/json" -H "authorization:"$Authorization"" -H "content-type:application/json; charset=UTF-8" -H "content-length:62" -H "accept-encoding:gzip" -H "user-agent:okhttp/3.12.0" -d '{"state":{"desired":{"equipment":{"swc_0":{"production":1}}}}}' "https://prod.zodiac-io.com/devices/v1/xxxxxxxx/shadow"

```

Thank you!  
@Tico

---

<div class="post-metadata">

**Author:** ![Veuchez](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/veuchez/32/91025_2.png) [@Veuchez](https://discourse.nodered.org/u/Veuchez)\
**Post date:** [20 May 2024 16:05 UTC](https://discourse.nodered.org/t/iaqualink-send-command-on-off/88041/2 "2024-05-20T16:05:05Z")

</div>

Hasn't anyone succeeded?  
Thank you.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 May 2024 16:20 UTC](https://discourse.nodered.org/t/iaqualink-send-command-on-off/88041/3 "2024-05-20T16:20:16Z")

</div>

Seeing how that post had pretty much everything you need, surely you just needed to add another HTTP Request node set to `POST` and set the payload!

e.g...

```js
const bearer = global.get("IDToken");

// setup the payload. 
// Here it is hard coded but you can pass the payload data into the function from another node
msg.payload = {
    state: {
        desired: {
            equipment: {
                swc_0: {
                    production: 1
                }
            }
        }
    }
}
msg.method = "post";
msg.headers = {};
msg.headers['Host'] = 'prod.zodiac-io.com';
msg.headers['accept'] = 'application/json';
msg.headers['authorization'] = bearer;
msg.headers['accept-encoding'] = 'gzip';
msg.headers['user-agent'] = 'okhttp/3.12.0';
msg.url = 'https://prod.zodiac-io.com/devices/v1/yourDeviceIDhere/shadow';
return msg;

```

---

<div class="post-metadata">

**Author:** ![Veuchez](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/veuchez/32/91025_2.png) [@Veuchez](https://discourse.nodered.org/u/Veuchez)\
**Post date:** [20 May 2024 16:43 UTC](https://discourse.nodered.org/t/iaqualink-send-command-on-off/88041/4 "2024-05-20T16:43:42Z")

</div>

A thousand thanks!  
I made a mistake when entering the IDToken!  
Now works!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 June 2024 16:44 UTC](https://discourse.nodered.org/t/iaqualink-send-command-on-off/88041/5 "2024-06-03T16:44:35Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
