Skip to content

Devices Managment

Fabio Gollinucci edited this page Feb 16, 2020 · 2 revisions

You should be familiar with AWS IoT Core service, this will allow you to control your device connected to Google Home end/or Alexa. You have to implement the device Shadow updates on your RaspberryPI or Arduino.

Here a basic example how to use this service on a RaspberryPI using NodeJS: aws-iot-example

Setup IoT Things

Now you are ready to connect your AWS IoT things, go to the AWS Console and select IoT Core service.

Create a new Thing Type

Click on Manage then Types and create a new type. A suggested type name can be SmartHome, the required configuration is to create two searchable attributes under Set searchable thing attributes section.

Create these respecting the lowercase:

  • sync
  • type

Connect new and existing IoT Things

Edit an existing Thing and set the created type SmartHome, valorize the sync attribute with: enable. Then set the type attribute based on the things type, for example: Light.

Control IoT Things

Now you can control you device from Google Home or Alexa device, also from their smartphone applications.

Debug Shadow changes

To check if integration works and the Thing shadow is correctly updated you can use MQTT client provided by IoT Core service. Login to AWS Console then go to IoI Core service. From the left menu click on Test and will appear the MQTT client, from here you can publish new message or listen for change events.

To check Shadow update subscribe to the topic $aws/things/<thingName>/shadow/update/delta, replace thingName your your Thing name.

You can use a wildcard # to listen for every Thing events, subscribe to $aws/things/<thingName>/# topic, or for every Things events to topic $aws/things/#

Once subscribed using Subscribe to topic button you'll see shadow update events.