Hi everyone, reading the forum ( iAqualink for Pool Equipment strike again - #5 by Tico) 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:
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...
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;