0
votes

The AWS IoT developer guide explains that a Device Shadow can be updated by publishing to the $aws/things/thing-name/shadow/update topic. How do I perform a Shadow update for a thing group (such that all things inside the group are updated with the same desired state)? I haven't found any documentation for this.

1

1 Answers

1
votes

Unfortunately this is not a built-in feature, so you'll have to do this manually (e.g. there is no $aws/thing-groups/group-name/shadow/update).

You can use iot::ListThingsInThingGroup (javascript documentation here, but it will be in all there other SDKs) to programatically list all the Things belonging to a ThingGroup. At which point you can then send a message to each thing shadow on their specific topic (or you can use iotData::UpdateThingShadow)

Alternatively, there is nothing inherently special about the shadow topic, except that the AWS device SDKs are already configured to listen to it for updates. You are free to create a my/thing-groups/group-name/shadow/update topic and have you devices listen to the topic for the groups they belong to. You can then manually accept the update and report back using the normal $aws/things/thing-name/shadow/accepted etc. topics.