So we have some software running in our Raspberry PI 5, one that I have dedicated to running all our Smart Home. It also encapsulates the idea that I want to handle Separation of Concerns even at home. So even if I could, I wont run anything else in this piece of hardware, I wont make it do anything else.
But with this comes how do you divide the whole, into different pieces, and how do you define what they are meant to do. Like I said in the previous post, I’m running everything via Docker and the initial instructions I found installed everything I could ever need.
So after everything has been running neatly for months, I think I can define everything easily and hopefully explain my reasoning.
Home Assistant
Home Assistant is my Data Storage. It’s meant to connect, and store every piece of data I can gather from various machines, sensors or from the cloud. But never be the main actor on what happens with that data.
I don’t write any automations to Home Assistant, I only gather data and I’m happy with that.
The Exception: Zigbee devices
The only exception is this. Zigbee lights, scenes and zigbee switches. I’ve integrated every Zigbee device to Home Assistant via MQTT and Zigbee2MQTT. But since Z2M is actually only a coordinator software, and you cannot actually configure switches (Yeah, you can, via Bindings, but not smart 4 button switches) and how, what scenes they should trigger in there. You are actually forced to do this in Home Assistant.
And I’m quite ok with this. Even so, that I’ve been tempted to switching to ZHA. The only problem is, I like how Zigbee2MQTT works so that it handles all the device integrations and that’s that. It keeps my Home Assistant as pure as possible. But I’m still tempted.
Lights and Scenes
But as it is, and as I’ve yet to trigger that, what I do is, I manage my scenes and physical switches in Home Assistant. We don’t have many, so it’s easy to manage them in Home Assistant. And it still fits in with my overall architecture so I’m not too bother by it. At least for now.
Zigbee2MQTT
So like I said, Zigbee2MQTT is where all my Zigbee devices are connected to. I do like the idea of using ZHA, purely from the latency aspect. But having a different service, handle all the zigbee connectivity, keeps my Home Assistant as pure as possible. To keep it only as a Data Storage for everything.
But like I said, since I’m already utilizing Home Assistant to handle scene’s and switches. It does make the question, how many milliseconds could I shave from UI or different interactions if I would to relocate every Zigbee device to ZHA.
Node-Red
So if I don’t run automations in Home Assistant, then I need a place, and Node-Red is that place. Every automation, every reaction to data inside Home Assistant, everything happens in Node Red.
It keeps my automations separate from Home Assistant, I can do all kinds of automations, fetch data from Internet, do anything I want. And it’s easy to handle.
Yes, it’s sometimes a bit, fun to work with, by connecting different boxes, it’s not always so intuitive what to do in what situation. But it gets the job done in my small world. And I do love the separation.
ESPHome
So after working with Zigbee devices for a while now, and I do love them for only one reason and one reason only; They are battery operated and can last over a year without battery switching.
But as I’ve found out, Zigbee network tends to be quite, tricky. Zigbee uses the same 2.4GHz band as WiFi, so interference is to be expected. This gives me the willies, since I like all of my devices to be rock solid. Lights should work always, switches should work like clock. And this, tends not to be the case, especially with lower cost devices, but also my Hue Switches.
So my answer to this is ESPHome, where I’m going to integrate every single IoT-device I can. I have a single device now, a testing device to act as a BT-Proxy. But if my plans go to fruition, by summer come, I should have a range or air quality sensors drizzled around our house.
Why ESPHome is my answer is simple, esp32, the development board I’m going to use, uses WiFi to connect to ESPHome. And since ESPHome is so tied to Home Assistant, every single piece of sensor will automatically be picked up and data will start running automatically.
This is of course made possible by the fact that they are going to be powered up 24/7, so there is no need to be so tight with the power budget. But it’s also what gives them the leg up, I can connect multiple sensors and not worry about connectivity.
Mosquitto
Maybe I shouldn’t even mention this, but basically, mosquitto is my MQTT. Message broker, the only thing it does is acts as a message broker between Home Assistant, Node-Red and Zigbee2MQTT.
That’s it.
Omada Controller
Now, I actually wrote a big piece about my Network configuration already, and Omada controller is there. But I wanted to write something, since, I think it’s needed for the whole picture.
Like I said, I’ve dedicated a whole Raspberry PI for running our Smart Home. And Omada Controller is part of that. It’s there to handle all our Networking gear, and to manage it. And while it doesn’t do anything itself, it’s a piece of the whole system.
And yes, I’ve integrated Omada Controller to our Home Assistant, so that if I want, I can use the data in there for triggering automations or anything like that. In Node-Red obviously.
Future upgrades
There isn’t much to do with my current setup. Maybe upgrade the Home Assistant UI, or update the software stack every now and then. But one thing is annoying which I think I should tackle at some point.
Adding Traefik as a Proxy. My one and only reason? To have nice domain names for each of the services. So that I wouldn’t need to access different services via a different port in the same IP-address, but access them with a more nice domainname. Like mosquitto.domain.tld and zigbee2mqtt.domain.tld.
Of course, it would make the whole system setup a bit nicer also. Ultimately pointless since everything is running so smoothly already. Everything just works. But like I said, it would make accessing different services via nicer domain names.