While building our new house, I did spend a lot of time on designing and later building a home automation system, with home assistant + MQTT at its core.
The first post is mostly about explaining the rationale behind it as well as the series of posts I have actually planned over the course of the following weeks.
Hope you might enjoy it!
Update May 2024: I did update the blogging engine at some point, so not all links in this thread will still work. The introductory post does serve as an overview as well, which should have all proper links: Why -
I can confirm it has been really time consuming for me to just prepare the set of posts. The issue I did find is that while writing down, in order to tell a story, you first need to elaborate on a lot of different things first. Consequently, my initial post was huge and tried to cover too many things. This is why I did turn it into a series in the end.
Great postsā¦ I am really looking forward for wiring and schematics part. Although Star topology looks suitable in your case; running new future wires might create some trouble for most people.
A friend of mine went the same wired solution; but since his budget was extremely tight, he went with arduino based relay and input solutions in his electric cabinet. So, (as i see unipi looks costly but it is exteremely professional) both input and outputs in his installation were connected to 3 Arduino Megas since it has the maximum number of pins. It is again Star Topology but he was redesigning the whole house, so it was easy to lay out brand new Cat6 cables from the electric cabinet to everywhere. In my case, this is simply not possibleā¦
But to tell the truth his solution is a hundred times more stable than my zigbee, zwave, wifi hybrid solutionsā¦
Do you have an idea of the voltage levels used e.g. for reading the input buttons? The arduino typically works with 5V, which is rather low for longer wire runs. The unipi units use 24V, which is quite common for home automation.
I do indeed plan to cover more of that in the upcoming wiring post
The fluctuations on longer cable runs were indeed problematic with 5 V.
What he did was, when the switch is turned on, he send the closed circuit 220V to near the arduino which is in the electric cabinet; use an adapter to make it 5V and send the signal to arduino pin following an optocoupler. At least thatās how i remember it
Wow, nice! I think the advantage of a platform like arduino is that itās simpler and probably also less power-hungry.
I didnāt really feel like doing the 220V / 5V interfacing myself though (for signaling applications like push buttons, 220V seems even dangerous tbh). Also, the advantage of a raspberry pi-based platform is that itās a bit easier to put custom code on it (I use python for example).
Maybe at some point I will reconsider the hardware though, make something dedicated an actually do my own interfacing.
While a wired system is a cool idea and you donāt have issues with wireless links, you certainly will have with induced current by lightning.
Especially in areas where storms and such are common or occurr often, one nearby lightning strike is sufficient to fry all long-cabled devices, such as LAN cables and stuff: The longer they are, the more prone they are to this.
The 230VAC input generally is more robust against sudden spikes in power, but the 5V-10V on a wired system mostly isnāt.
I did use WiFi on all my devices and put one router per floor.
The routers are simple one-antennae TPLink routers and all of them are in the same IP range and get the DHCP from the main home router. Also the APs are on a different WiFi channel than the main router and the SSID is hidden.
I have no link issues. All devices are just there and rarely give me headaches.
In an event on a lightning strike, the worst that should happen is frying all the APs (because they are wired over a longer distance), but the Sonoffās itself should survive.
I say should, because you never know until it really happens
Never really considered that to be honest, in theory it could be an issue, I suppose?
For the (analog) signalling (e.g. push buttons), I actually do not use LAN cable, but rather a higher wire gauge multi-wire cable, i.e. 16x0.8mm2 wire cable (here, itās called SVV-type cable, not sure about the international naming). Iām not sure about the max current it can handle ā¦
The push buttons themselves are just plain mechanical toggles, so when thereās an overcurrent event, these should be fine.
But even 0.8mm cables can carry enough to kill your devices if the wire is long enough. Itās not even so much the current, but the voltage. An EMP can carry thousand volts with a very low amperage for a fraction of a second and toast all of your devices at once.
Technically a filter cap (10nF) on either end of the switches could maybe help to ādissipateā some of that energy, but Iām not entirely sure.
At the end, itās all about luck.
Really great to read this. My house also uses a relay system and svv cable setup with 24v. Sadly my modules arenāt smart connected (a brand called conson). Really curious how you setup up those unipiās and how many youāve installed,ā¦
In total I would need around 64 digital input and outputs. So Iām really following your blog
The overview post lists all of the current and future topics, so I do indeed plan on writing some more details about how I employ the unipi systems in the overall system.
The unipi units themselves arenāt directly connected. The built-in software has some way of linking inputs and outputs on the unit itself. Additionally, I think unipi also offers their own software for programming; Mervis | Unipi but I havenāt looked into that tbh, since I was mostly interested in using home assistant.
The upcoming (currently 7th) post on programming intends to show the software I put on the unipi unit such that it provides an MQTT event-based interface for home assistant to integrate with it. The specific software can be summarized as follows:
About modbus: unipi indeed also offers a modbus integration (you can even plug in an RS-485 cable). From what I understood, internally they also use the modbus protocol for having the main raspberry pi board talk to the IO controllers (via SPI).
For me, directly interfacing with the modbus TCP interface worked OK in case of pushing out updates (writes). For polling the status of push buttons, the polling speed was too slow.