In Chapter 9, Building a Home Security Dashboard, we created a home security dashboard using CherryPy. The power behind the IoT is the ability to build an application with devices, located anywhere in the world, that are connected to each other. We will take this idea to our home security dashboard. If not already assembled, build the home security dashboard with the temperature sensor from Chapter 9, Building a Home Security Dashboard:
- We will start our code by encapsulating our sensory data in a class container. Open up Thonny and create a new file called SensoryData.py:
from gpiozero import MotionSensorimport Adafruit_DHTclass SensoryData: humidity='' temperature='' detected_motion='' dht_pin = ...