I wonder if you could share with me your experience using Unipi and Home Assistant
Sure! Essentially, my full house runs on home assistant and unipi.
So, from a push button to toggling lights, the following happens:
- push button pushed
- 24V contact is toggled
- unipi digital input sees the toggle (actually, one of the connected IO boards sees this first)
- unipi evok pushes out websocket event
- my evok2mqtt library translates the websocket event into a MQTT event
- MQTT events goes to MQTT broker: separate device, dockerized mosquitto: Docker
- home assistant has a button entity that follows the MQTT event
- home assistant has an automation, that links the button entity to a corresponding light;
- home assistant has a light entity that gets toggled by the automation; MQTT event is sent out to the broker
- another unipi which is connected to the lights is subscribed to the MQTT event for the light
- on this other unipi, the MQTT event gets converted again into a websocket event
- the websocket event triggers the relay for the light
It’s a lot of steps, but it allows the overall setup to remain pretty decoupled. For example, I recently made a separate containerized service completely at the layer of MQTT events to control my blinds: GitHub - mhemeryck/covers: Quick-and-dirty MQTT input button to cover matching
How long does it take to propagate a signal from an input (a switch) through Unipi and Home Assistant to an output (light bulb)?
All of this occurs pretty much instantaneously.
Do you run Home Assistant on Unipi, which image do you use? Can I run HA on Mervis OS?
No, I run a dockerized version of home assistant on a separate (2GB RAM only) x86 PC. I use https://k3s.io/ / GitHub - alexellis/k3sup: bootstrap K3s over SSH in < 60s 🚀 for orchestrating the container
I think over time I will want to migrate the home assistant setup into a (cluster of) raspi4s
Are there any tasks which you have not been able to complete using Unipi? Would you recommend Unipi or you would rather choose a different device?
The overall system works quite OK now. I still have a lot of ideas to extend it, but I would mainly like to focus on making it more reliable.
Specifically for unipi:
- the polling from the evok library (the library provided by unipi themselves) is not always fast enough, resulting in missed events (lights not toggling when pushing buttons). I intend to use their sysfs interface SysFS [Unipi.technology Knowledge Base] to get a faster polling rate. Ideally, the unipi software would have been able to push out MQTT events in the first place.
- I’ve also had some issues with corrupt SD cards in the past; suddenly, the unipi would just stop working because of a corrupted file system on the SD card. I recently switches to pSLC SD cards, hoping these will be a bit more reliable (might not be an issue directly related to unipi ; this is just a general raspi / SD card issue). Btw, I also have a 24V DC UPS to make sure that even in the event of a short power failure, the unipi’s don’t directly get switched off.
- wiring: I did all my wiring in star configuration (everything ends up in central cabinet), which makes it possible for me to switch to any other hardware setup. It’s a lot of wiring though, with a lot of manual work. A bus-based system might have been easier in that respect.
One of my main concerns right now is that I’m the only one that really knows how this works in my house. I guess it’s the case for any DIY system though …
I know that it is a lot of questions. I am thinking about using Unipi for my home automation project.
That’s nice to hear, since I am currently working on writing a series of blog posts on this topic. I wasn’t really sure there’d be an interest in that, so this motivates me to keep on going