In today's rapidly advancing technological landscape, home automation has become more accessible than ever before. An increasing number of devices are designed to automate, protect, and monitor homes and offices, making it possible for many people to implement a smart home system. These systems can remotely control HVAC systems, integrate home theater, protect against threats like theft and fire, and reduce energy consumption.
This semester, we're implementing home automation in multiple offices in our department. This showcases advanced technology's practical application, improving efficiency and comfort in our academic environment. Automated systems for lighting, climate control, and other functions will create a smarter, more responsive workplace.
Home Assistant
We chose Home Assistant as the platform for our home automation project due to its extensive device support and powerful automation capabilities. Being a free and open-source platform, Home Assistant offers unparalleled flexibility and control, making it ideal for implementing a DIY home automation system.
Hardware and Initial Setup
To set up Home Assistant, the following hardware components were used:
- Raspberry Pi 3/4: The central device for running Home Assistant.
- Micro SD Card (and SSD for Raspberry Pi 4)
- WiFi Router and Ethernet Cable
- Power Supply for Raspberry Pi
Using the Raspberry Pi Imager, the Home Assistant OS was installed on an SD card. After configuring the WiFi router, Home Assistant was set to run on a separate network. External access was enabled through STU VPN or the institute's network.
Connecting Devices
WiFi Devices
WiFi devices were the first to be integrated into the Home Assistant system. This process involved connecting each device to the network and adding them to Home Assistant as integrations. For instance, devices like a Samsung TV and a Volumio radio were easily connected and recognized by the system. For air conditioners, I used a mobile app to connect the AC's WiFi module to the network, located the AC's IP address using the app, and then added it to Home Assistant as a Daikin AC integration.
Zigbee Devices
Zigbee Network
Zigbee is low-data-rate wireless communication protocol operating in the 2.4 GHz frequency band, known for its low power usage and mesh networking capabilities. In a Zigbee network, three types of devices are used:
- Coordinator: The central unit that holds all network information.
- Router: Extends the network's range by passing data to other devices.
- End Device: Communicates only with a higher node and often switches to sleep mode to save energy.
Connecting Zigbee devices required additional hardware, specifically a USB Zigbee dongle (coordinator). After putting the devices in pairing mode, they were added to Home Assistant using Zigbee2MQTT and the Mosquitto MQTT broker. Among the Zigbee devices integrated were thermostatic radiator valves, human presence and motion sensors, smart switches, window and door sensors, temperature sensors, and smart plugs (Figure 1).
Figure 1: Zigbee devices
Automation Strategies
All automations were created using YAML configurations and a user-friendly graphical editor in Home Assistant.
Temperature control by Radiators
- Heating Mode: Activates when the daily outside temperature averages below 13°C for two days in a row.
- Weekdays: Adjusted to individual preferences.
- Weekends/Holidays: Utilizes an 'away mode' to maintain 16 °C, saving energy when the house is empty.
Additional Automations
Additional automations included air conditioning that automatically turns off at 7 PM daily and when windows are open. Lighting automatically switches off when no one is in the room. Notifications are sent if there are issues with backups.
Dashboard
I created a dashboard in Home Assistant (HA) for mobile devices (Figure 2) and computers (Figure 3 ), enabling better control and overview. Figure 2: Dashboard for Mobile Devices
Figure 3: Dashboard for Computers
Conclusion
Home Assistant proved to be a flexible platform for home automation, capable of integrating a wide range of devices and supporting powerful automation. Its flexibility allows for a vast array of custom automations, limited only by one's creativity. The platform's open-source nature, while advantageous in many ways, also has its drawbacks. Continuous updates can introduce errors, and there is a risk that some features may not work as expected. Nevertheless, the strong community support enhances the platform's appeal, providing solutions to potential challenges.