By: Anastasiia Zatsepina (32265) & Ekaterina Zakharova (30909)
In this project, our group explored the creation and implementation of a home automation system using a Raspberry Pi and the Home Assistant platform. The system integrates various smart devices and sensors to automate and enhance everyday home activities, focusing on practicality and ease of use.
Key components of the system include a Raspberry Pi, which serves as the central hub, and a range of smart devices such as Zigbee-based sensors, Tuya-controlled pet feeder, and lamp. These devices work together seamlessly to provide a connected and intelligent home environment.The project covers the setup and configuration of Home Assistant on the Raspberry Pi, offering a short guide to integrating and controlling various smart devices.
By using Zigbee technology, we combine motion and temperature sensors to monitor and automate home conditions. Additionally, Node-RED is utilized to create automation workflows, such as automating the pet feeder and responding to motion sensor triggers. Furthermore, the system includes the configuration of the E-mail Node in Node-RED to enable email notifications for specific events.
InfluxDB is employed for data storage and graphical representation, allowing for the visualization of sensor data and system performance over time. Overall, this project demonstrates the potential of home automation to simplify daily tasks, improve home security, and enhance the quality of life through the integration of smart technologies.
Raspberry Pi
The Raspberry Pi is a small, affordable, and versatile single-board computer that serves as the central hub for our home automation system (Figure 2.1). Its compact size, low power consumption, and robust performance make it an ideal choice for running Home Assistant and managing various smart devices. The Raspberry Pi supports a variety of operating systems and comes with multiple interfaces, including GPIO pins, USB ports, and HDMI, making it a highly adaptable tool for numerous applications[1].
Home Assistant
Home Assistant is an open-source home automation platform that enables users to control and automate a wide range of smart devices[2]. It offers a user-friendly interface, extensive device compatibility, and powerful automation capabilities. Home Assistant can run on various hardware, including the Raspberry Pi, and supports integration with numerous smart home products and services, providing a centralized system for monitoring and controlling home environments.
| Figure 2.1 - Raspberry Pi 5 Product page | Figure 2.2 - Home assistant Installation guideline by Taycan |
Home Assistant's core components provide the foundation for integrating, controlling, and automating smart devices:
![]() |
---|
Figure 2.3 - Zigbee device: area, manufacturer and model & entities |
![]() |
Figure 2.4 - Zigbee device: state |
Zigbee
Zigbee is a wireless communication protocol designed for low-power, low-data-rate, and close-proximity applications (Figure 2.5). It is widely used in home automation, smart lighting, and other IoT (Internet of Things) applications[3]. Using Zigbee with a Raspberry Pi for Home Assistant involves setting up a Zigbee gateway (or hub) that connects to Raspberry Pi, allowing Home Assistant to communicate with Zigbee devices.The first step is setting up the necessary integration for zigbee.
(with Pet Feeder(Tuya), Tuya lamp, Zigbee Motion + Temperature sensors as components of the system)
To get the add-on running:
Create a new user for MQTT via your Home Assistant's frontend Settings → People → Users, (i.e. not on Mosquitto's Configuration tab).
Notes:
Node-RED & INfluxDB & Local Tuya are installed in a similar to MQTT fashion
Tuya is a global IoT platform that provides smart device solutions, enabling easy integration and control of various smart products. In this project, we use Tuya-controlled pet feeder and lamp, which can be managed through the Home Assistant platform. Finally, two tuya devices were added: pet feeder and LDV_Lamp, which we can switch on/off using “controls” and check any state changes in “logbook” (Figure 4.1).
![]() |
---|
Figure 4.1 - Tuya devices: Pet Feeder and lamp |
Pet Feeder: The smart pet feeder allows for scheduled feeding times and portion control, ensuring that pets are fed on time, even when the owner is not home. It can be controlled remotely through Home Assistant, providing convenience and peace of mind. Number of portions can be changed by using the control buttom (Figure 4.2).
![]() |
---|
Figure 4.2 - Pet Feeder control |
Adding a Tuya Pet Feeder to Home Assistant (made by Taycan): https://student-wiki.eolab.de/doku.php?id=amc:ss2024:bird_feeder:ha_installation
Lamp: The Tuya smart lamp offers remote control and automation capabilities, allowing users to adjust lighting conditions based on time of day, occupancy, or other triggers. It enhances home comfort and energy efficiency. Controll buttom allows to turn on/off the lamp (Figure 4.3).
Adding a Tuya Lamp to Home Assistant
To add a Tuya lamp to Home Assistant, start by setting up a Tuya account and app. Download the Tuya Smart or Smart Life app from the App Store or Google Play, and create an account or log in if you already have one. Add the lamp to the app by putting it in pairing mode ( by turning it on and off a few times or holding a button) and following the in-app instructions.
Next, configure Home Assistant by accessing it via a web browser. Navigate to the Integrations section under Configuration and click the “+ Add Integration” button. Search for and select Tuya from the list. Enter your Tuya app credentials (email and password), select the appropriate Tuya region, and input the API key and secret from the Tuya IoT Platform.
The most challenging point in the configuration of devices is to find a local key, usually most necessary data is filled in automatically. To find the local key follow through these steps: developer tuya platform/cloud/Api explorer/device management/ query devices in project.
Home Assistant will then connect to your Tuya account and sync your devices. Ensure the Tuya lamp appears in Home Assistant by checking the Entities section under Configuration.
This setup integrates a Zigbee motion sensor (Figure 5.1) and a temperature/humidity sensor (Figure 5.2) for smart home automation. The motion sensor is used to create scenes, such as activating a pet feeder, while the temperature/humidity sensor helps practice data collection with InfluxDB and Home Assistant (HA).
Two devices are listed: _TZ1800_fcdjzz3s TY0202, located in the living room, with 96% battery, and _TZ3000_xr3htd96 TS0201, with 100% battery (Figure 5.3). Both are integrated with Zigbee Home Automation.
The dashboard displays sensor data, including motion detection (Figure 5.4), humidity at 61.6%, and temperature at 23.9°C (Figure 5.5). Configuration settings and firmware updates are available, and the logbook records motion events and button presses.
Node-RED is a powerful, flow-based development tool for visual programming. Node-RED uses a visual editor to create “flows” by connecting nodes.
Node-RED excels in home automation by enabling complex workflows:
Pet feeder and motion sensor configuration
Task: to trigger the pet feeder when motion is detected. Firstly, node-red was installed.
This Node-RED flow diagram shows a simple setup for a pet feeder system using a state node, a debug node, and a call service node (Figure 6.1).
![]() |
---|
Figure 6.2 - Configuration of state node |
![]() |
---|
Figure 6.3 - Configuration of call service node |
The flow works as follows:
Test video with cat: https://youtube.com/shorts/Tk14my7ZAQo?feature=share
Lamp and motion sensor
The next Node-RED flow diagram (Figure 6.4) is designed to control a light based on motion detection and inactivity. The components are as follows:
Test video with cat:
Email Node Configuration
This Node-RED flow is set up to send an email notification when the state of a device changes (e.g., a lamp or pet feeder) (Figure 6.5).
ATTENTION: if it doesn’t work, check google account security settings!
Test video with cat: https://youtube.com/shorts/93OIb3B-sbU?feature=share
InfluxDB is a special type of database designed to handle and store data that changes over time, known as time-series data.
Steps to Connect InfluxDB to Home Assistant
![]() |
---|
Figure 7.1 - InfluxDB: open WEB UI |
![]() |
---|
Figure 7.2 - Configuration code for database InfluxDB |
For example, we can observe temperature and humidity (Figure 7.3) (data from the sensor) changing through the day and plot the diagram (Figure 7.4).
![]() |
---|
Figure 7.3 - InfluxDB: choosing values |
![]() |
---|
Figure 7.4 - InfluxDB: humidity diagram |