Lab Notes

Various personal weekend projects

Dec 24, 2022

Home Automation Notes

A few notes to share on home automation projects I've implemented and integrated with Home Assistant. I hope any of this helps!

Topic Notes
Home Assistant (HA) I keep current on the latest HA Docker image running on a Debian 12 AMD64 server (old i7 Lenovo desktop). The majority of my integrations rely on Z-Wave devices and MQTT, and the HA MQTT integration.
Z-Wave JS I run in Docker attached to a AEON Labs Z-Stick Gen5.
HA Automations Automations are split between HA automation scripts and scenes, and custom code including a replacement for HA's MQTT Statestream: hass2mqtt. Ultimately I have only a few HA integrations which minimizes risks during upgrades.
With most DIY integrations using MQTT, there's also little chance of any breaking changes. This allows me to implement my own logic on state changes using various custom MQTT clients. Most run on Docker along with HA.
MQTT Mosquitto
HA App Android
Media VLC player via Telnet connected to HA.
Bluetooth I use a simple Python daemon running on a couple Raspberry Pi 3 devices to track known Bluetooth MAC addresses and publish to MQTT.
BLE A simple Python MQTT client running on a couple Raspberry Pi 3 devices uses sensor.goveetemp_bt_hci and python-bleson projects. These modules have proven solid. The only Bluetooth sensors I have are Govee H5074001 for temperature/humidity (e.g. for monitoring a humidor).
ZigBee The majority of my DIY sensor projects use Digi XBee Zigbee Modules. The repo xbeesharp has a .NET 7 C# implementation handling subscribing and publishing to MQTT and translating to and from XBee packets. I then define MQTT sensors in HA.
A specific application of an XBee3 module is xbee3-laundry. Using the module's Micropython, it monitors my home's laundry by monitoring the electrical current usage on both washer and dryer circuits.
I also use an XBee for my DIY garage door opener: An XBee device and a 3.3VDC relay along with a modified LiftMaster 883LM Security+ 2.0 MyQ push button replaces the MyQ cloud solution. I found MyQ to generally be awful 😟 I use a Z-Wave door sensor to detect the state of the garage door. There are several threads on HA Community Forum on how to replace MyQ.
Using xbeesharp for these projects allows me to integrate with HA via MQTT publish service.
SDR labrfcat has an rflib Python client to control a Minka Aire fan using a YARD Stick One. I created a simple MQTT client daemon that sends commands from HA using MQTT.
I use a few 433 MHz battery powered sensors. These are convenient for deploying to different locations. I run a simple rtl_433 daemon on a Raspberry Pi 3 that publishes to MQTT. I use a Nooelec RTL-SDR adapter and a 433mhz antenna. Sensors are integrated into HA using MQTT via rtl_433.
Device tracking unifi_tracker polls each of my Ubiquity Unifi APs and publishes MAC client addresses to MQTT. I define MQTT device_tracker entities to integrate with HA. In my experience this solution has been more reliable than HA's. Plus I prefer to use SSH keys to connect to the APs instead of having to store passwords. The HA MQTT device_tracker entities I defined are used for presence detection.
Notifications I use Signal CLI and a Twilio client that publish/subscribe to MQTT. This allows a simple integration with HA for receiving status or sending commands to and from my phone when I'm away without having to keep a remote connection to my HA server.
Remote access to HA From my Android phone using Juice SSH client, I do an SSH tunnel (key auth) from HA's port to my phone's localhost. This is a simple and secure way to access HA remotely on-demand.