This project is a home automation system that simulates sensors and actuators and uses AWS IoT services to control and monitor devices in your home.
- An AWS account
- AWS CLI installed and configured on your local machine. You
- Python 3.x installed in your system.
- The paho-mqtt Python library installed:
pip install paho-mqtt
- Virtual devices simulating sensors and actuators
- AWS IoT Core to handle MQTT communication between devices and the AWS cloud
- AWS IoT Rules Engine to process and store incoming data and trigger actions
- AWS IoT Device Defender for device identity and access management
- AWS IoT Things Graph for visualizing the system
- device_simulator.py: A Python project to simulate sensors and actuators
- aws_iot_rules.yaml: AWS IoT rules configuration file
- aws_device_defender.yaml: AWS IoT Device Defender configuration file
- Set up AWS IoT by creating a new thing, policy, and certificate.
- Download the necessary files (root CA, public and private keys) for the certificate.
- Update the MQTT_BROKER variable in device_simulator.py with your new AWS IoT endpoint.
- Install the paho-mqtt library using
pip install paho-mqtt. - Run the script using the following command: python device_simulator.py
The aws_iot_rules.yaml file defines two rules to store temperature and light level data in a DynamoDB table.
The aws_device_defender.yaml file defines a detector and a template for the device, as well as a target for the device. These resources can be implemented using the boto3 library for device identity and access management.
The script will simulate the sensor and actuator devices. The data will be published to the MQTT topics defined in the script. Additionally, the script will connect to the AWS IoT MQTT broker and subscribe to the necessary topics.