I want to control LED from both the REST API and a button in IOT .
When ever i change the State of the LED, the Cloud send back an “UPDATE DELTA” and then change the LED status back(Which i dont want).
So is there any way to change the “desired” of the shadow from the iot device?
I make a POST request to the Mongoose cloud like this.
HTTP.query({
url: 'https://mdash.net/api/v2/devices/device2?access_token=xxxxxxxxxxx',
headers: { 'Content-Type': 'application/json' },
data: mdata, // { shadow: { state: { desired: { built_in: boolean}}}}
cert: 'cert.pem', // client certificate // just left it if you dont have this file
key: 'key.pem', // client key //just left if you dont has this file
ca_cert: 'ca.pem', // ca bundle to verify server with ""
success: function (body, full_http_msg) { print("body"); },
error: function (err) { print(err); }
});