Documentation of an evolving home automation setup, primarily realised through home assistant.
Devices
- Amazon Alexa:
- Aqara:
- Ikea:
- Plugs
- Other
- Phillips Hue lights:
- 1st Gen Bulb (x4)
- 2nd Gen Bulb (x3)
- Lightstrip
- E14 (candle)
- Reolink cameras:
- 4K 8MP Dual-Band Wi-Fi 6 PTZ Indoor Camera with Auto Tracking (E1 Zoom). This camera is set up to send images and video to a local FTP server, the data from which is also accessible to home assistant.
- Sonos speakers:
- Play:1 (x2)
- Tapo
- Wemo
Services
Links
Home assistant links users with these devices and services.
Inputs are via web, app or voice through the Alexa devices above, which are configured to (only) relay commands to home assistant through the process described here.
All Zigbee devices are connected via a SONOFF Zigbee 3.0 USB Dongle Plus, which is attached to a Raspberry Pi 4 Model B where (dockerised) Zigbee2MQTT and Mosquitto interact to control devices at a software level (pictured).
Home assistant itself is also hosted on the Pi.
Although directly connecting devices via Zigbee is preferable to using vendor-specific hubs, one does lose the functionality offered by these hubs, such as the scenes provided by the Hue Bridge.
In the case of Hue, scenes are replicated using the values here.
Scenes with more colours than there are lights available are captured as scripts that randomise colours across the available lights.
All non-Zigbee devices are linked to Home Assistant via Wi-Fi, either directly on the local network or via the respective provider’s (cloud) platform.
Automations
Automations that leverage these devices, services and links:
| trigger | action(s) |
|---|---|
| Number of mobile devices on network > 0 (someone arrives home) | Turn on lights if after sunset |
| Mobile device joins/leaves network (an individual arrives/leaves home) | Forward this information via Telegram |
| Temperature sensor above 27 degrees | Alert high temperature, and suggest action based on external temperature (windows open vs. AC on) |
| Number of mobile devices on network = 0 (everyone leaves home) | Turn off relevant lights and plugs, report on Telegram |
| Mobile device plugged in before bed | Lights off/dimmed/delayed off, as appropriate |
| Image or video received from camera | Forward via Telegram |
| Somrig pressed | Timed white noise on speakers, lights off |
| Sunset/sunrise | Lights on/off (if still on) |
| (Seasonal) Sunset/sunrise +- offset | Christmas lights on/off |