As previously said in my homelab posts, I've redone completely my home automation system as it became old and not necessary aligned with my usage… To avoid repeating myself (because I'm also very lazy^^), let me quote myself (that seems very narcissist of me…):
On the home automation part, it became way too complicated, mostly because I was learning at the time and was building it little by little. I had a old rpi2 B with domoticz, a rpi3 with kalliope and nodered, … For those reading my blog back then, you are familiar with the voice assistant Kalliope that was the brain of my home and I was actively participating. One thing though… I noticed that I don't like to talk to a software, that I prefer an easy to access interface (web, app, cli, …) to do the action I wanted… And that I was more into automation than voice control.
The goal of this post is to describe the constraints and the architecture choices for my home automation system. There will be follow up posts on the setup and then a series of posts related to the actual automation I put in place over time :).
Automation ok... But for what?
I have multiple type of things running that I will describe in more details in future posts, like:
- Home Alerts: I have captors to alert me on things like water flood, smoke detection, open front door for too long, temperature too low, etc...
- Intrusion alerts: When not in the house, camera is running filming the front door as well as motion detector in rooms and I get an alert directly via chatbot that something is up. I also receive a video of the motion detected at the entry door (if any).
- Recurring tasks: Basic routines like wake up, go to sleep, leaving the house, etc...
- Scenario: Set of tasks that happen on specific occasion (leaving or arriving at home, going to sleep, etc...)
- Devices control: Lights via motion detection in specific rooms and other devices (Includes Sound system, media center, tv hdmi, etc...).
- Control: Global house control from a single web dashboard, accessible from a touchscreen in the living room or via any browser (mobile friendly)
I had more or less the following rules in mind when I started thinking about the new architecture:
- Most important one: Needs to pass the WAF tests :) (for Wife Acceptance Factor1)
- A powerful "brain" (= orchestrator) easy to configure but powerful enough to react and connect to anything
- Works with z-wave devices (As I had already a few of them: electric plugs, smoke and flood alarms, door sensor, buttons)
- Lightweight communication (I was using http APIs calls before, but this was too heavy for IoT2)
- Dashboard to control it via a touchscreen device in the living room (I already had the hardware)
- Communication from outside only via chatbot
- A multi room sound system
- A music server, connected to the multi room system above.
- A media center system for the TV in the living room.
- A camera pointed to my front door for an alarm system
- Reuse as much as possible my home lab raspberrypi cluster and thus docker swarm.
That maybe a lot, but wait until you see the list of automation in place :D
My Architecture choices
The TLDR; can be summarized in a simple visual:
Ok, it may seems complicated for a home setup but it is not :). Let's take them piece by piece.
- Zwave controller: I was already using domoticz for managing my zwave devices. I worked flawlessly for 2 years on an old rpi 2. I decided to move it to my docker swarm cluster but keep this as my zwave controller as it worked so well and is integrated with MQTT too (see 3.).
- Lightweight messaging: MQTT is the best and main choice for this, and Eclipe Mosquitto is the most common MQTT broker used.
- Dashboard: As said in 1., Nodered provides this too :).
- Chatbot: I was already using Telegram and don't see reasons to change yet. I wish I could create a Signal bot instead but it is not doable without a dedicated SIM and phone number. So I settle to creating my own dedicated Telegram Bot to manage any communication from outside (and thus also limit the available commands available through telegram). More on this later! :)
- Multi room soud system: As it is related and not really related to my home automation system, I kept my previous system in place based on Snapcast but I have an item in my kanboard to study if this is still the right solution (but to be honest, it works really well :)).
- Music server: I'm using mopidy connected to my spotify account. It support mpd, has a web UI and connect to spotify. Perfect for my needs :-).
- Media center: Kodi user for a long time, I didn't see any reasons to change yet, a bit like my sound system.
- Camera: Fisheye Picamera on a raspberry pi 0, controlled via MQTT messages.
- Nodered, Mosquitto and Domoticz will be installed on my homelab cluster (We'll see how in the next posts, especially for domoticz).
This should help understand the diagram above and this is basically it! The heart of my system is nodered, zwave devices are managed via domoticz and any communication between different system (including the picamera and cec bridge3) is achieved via MQTT.
Because I'm going to stop now before entering the interesting (setup) and fun (automation) things, I'll leave here one of the screen of my dashboard, made with nodered dashboard nodes:
I have this dashboard in place on a touchscreen in my living room to easily control the house from my couch :).
That's it for now! I'll talk in the next posts on this series about the actual setup of the main components :). Later, I'll start posting about the different automation and tasks I've setup since! Because it will be a series of ongoing blog posts, I've setup a dedicated Home Automation page
So far, I have in mind for this set of blog posts:
- Context and Architecture choices (this post :)
- Initial setup part1: Nodered and MQTT
- Initial setup part2: Domoticz
- MultiRoom Sound system setup
- PiCamera managed via MQTT
- TV control via CEC
And of course, I'll write about the different automation flow that manage all this :).
WAF: https://en.wikipedia.org/wiki/Wife_acceptance_factor ↩
I will write a specific post about cec bridge, which is a great tool to command your tv via hdmi! https://github.com/michaelarnauts/cec-mqtt-bridges://github.com/michaelarnauts/cec-mqtt-bridge ↩