loader

AWS IoT for home automation

AWS, the popular cloud platform from Amazon has been constantly updating themselves with new features, runtimes and services. At WeMakeIoT, we have been using AWS instances particularly AWS IoT rule engine for some of our IoT Partners and home automation projects. AWS IoT is the entry point where data from end devices reach AWS and vice versa. We have to create things corresponding to end devices in AWS IoT. Using AWS device SDK, these things(devices) can communicate to AWS IoT via MQTT or REST.

AWS IoT for home automation.

Each thing is assigned certificates and policies making the communication encrypted and secure and it also helps to control permissions.There is a thing shadow service in AWS IoT which stores the current state of device. Devices can report its state and other applications can provide the desired state to the thing shadow service. Both application and device will be listening for shadow updates and making changes accordingly.

AWS IoT rule engine

AWS IoT Rule engine allows us to create rules based on the message payload. There is SQL like syntax to select from a specified topic and filter based on payload. Rule has access to the message payload in JSON format and thingshadow. We can do filtering, alerting, selective storing etc with AWS IoT rules if we use payload data and shadow appropriately. These rules can trigger other AWS services like lambda function, dynamoDB save, SNS publish and much more.

AWS SNS (simple notification service) is a message broker where you can create, subscribe and publish to topics. SNS also has SMS and Mobile Push features. Endpoints have to be created in AWS corresponding to each device that needs Mobile Push. Endpoints can be made to subscribe to topics or we can directly publish to an endpoint. It is a convenient method for alerting in IoT applications if used along with rule engine.

In case usual AWS IoT rule actions do not suffice, we can create AWS Lambda functions(serverless functions) and trigger it from rule. AWS Lambda functions can be written in python, nodejs, java etc, and uploaded to the platform. We can choose the event that triggers the function call and the rest is managed by AWS. User does not have to manage servers and payment is based on function call execution

Leave a Reply

Your email address will not be published. Required fields are marked *