fbpx

AWS IoT Device Shadow

Device Shadow is the virtual representation of your physical Device. As per AWS IoT Platform is concerned, we create a Thing in AWS IoT Console. Things are nothing but the Devices, those are connected to AWS IoT Platform.

It is a JSON document that is used to store and access current state information for a device. This service maintains a shadow (virtual Device State) for each and every device you connect to AWS IoT Platform. We can use the shadow document to get the current state of the device and based on that state, we can take action  on the device, we can also monitor and control our Devices based on our needs over (MQTT or HTTP) protocols, regardless of whether the device is connected to the Internet. Each device’s shadow is uniquely identified by the name of the corresponding Thing(Device associated with).

Device Shadow service acts as a communication medium between your device and application. As this service provides different MQTT topics (or) RESTful API to interact with device. Using these MQTT topics (or) RESTful API we can also get, update and delete Shadow Document.

Example

If you wanted to get the last updated state of a Motor, so that based on the state you can take the decision to control the Motor. You can also store these state data for Predictive Analysis in a particular breakdown point. Based on the breakdown stored data of the Motor we can do Predictive Maintenance.

Rules

The Device Shadow service JSON Document follows these below rules –

Document Properties – Device’s shadow document has two states one is desire state where an Application request to Device to change the state of the Device (Thing) based on this the JSON Document gates updated. The second one is reported state where Device (Thing) reported back to the Application with updated or changed state.

This JSON Document also contains metadata of the device along with timestamp, clientToken and version.

The Device Shadow service supports versioning on every update message which means that with every update of a device’s shadow, the version of the JSON document is auto incremented. This helps to keep track document data.

Menu