In order to control the device from the Cloud, the AWS Shadow Service feature is used. The AWS Shadow service maintains a shadow of the device in the form of a JSON document. The device’s state can be stored and retrieved, leveraging upon the AWS Shadow Topics. To set and get the state of the device, either HTTP or MQTT can be used. For the demo application, MQTT protocol is chosen. Each device is represented by its unique thing name.
$aws/things/thingName/shadow/update
’.{ "state" : { "reported" : { "toggle" : 1 } } }
{ "state" : { "desired" : { "toggle" : 1 } } }
{ "state" : { "reported" : { "toggle" : 1 } } }
Further information can be found here: /update