Home Automation, part 1 - Context and Architecture

Sunday, April 12, 2020



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:

  1. Most important one: Needs to pass the WAF tests :) (for Wife Acceptance Factor1)
  2. A powerful “brain” (= orchestrator) easy to configure but powerful enough to react and connect to anything
  3. Works with [[][z-wave]] devices (As I had already a few of them: electric plugs, smoke and flood alarms, door sensor, buttons)
  4. Lightweight communication (I was using http APIs calls before, but this was too heavy for IoT2)
  5. Dashboard to control it via a touchscreen device in the living room (I already had the hardware)
  6. Communication from outside only via chatbot
  7. A multi room sound system
  8. A music server, connected to the multi room system above.
  9. A media center system for the TV in the living room.
  10. A camera pointed to my front door for an alarm system
  11. 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:

Figure 1: My Home Automation architecture

Figure 1: My Home Automation architecture

Ok, it may seems complicated for a home setup but it is not :). Let’s take them piece by piece.

  1. Brain / Orchestrator: I choose nodered for this for multiple reasons. But I really like how simple it is to start creating the first flow (= automation recipe) just via drag & drop and some configuration :). But it is also very powerful and almost anything can be achieved (may require Javascript coding for some use cases though!). The community is quite active and software is evolving quite nicely! It also didn’t hurt that there is a great node (= nodered module) to create nice dashboards (and thus manage nodered - the brain - with it)
  2. 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.).
  3. Lightweight messaging: MQTT is the best and main choice for this, and Eclipe Mosquitto is the most common MQTT broker used.
  4. Dashboard: As said in 1., Nodered provides this too :).
  5. 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! :)
  6. 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 :)).
  7. 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 :-).
  8. Media center: Kodi user for a long time, I didn’t see any reasons to change yet, a bit like my sound system.
  9. Camera: Fisheye Picamera on a raspberry pi 0, controlled via MQTT messages.
  10. 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:

Figure 2: My Home Automation dashboard

Figure 2: My Home Automation dashboard

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 :).

*[IoT]: Internet of Things


If you find any issue or have any question about this article, feel free to reach out to me via email, mastodon, matrix or even IRC, see the About Me page for details.

See Also

Home Automation, part 2 - NodeRed, Mosquitto and Domoticz on my docker swarm cluster

Manage your personal project todos with Kanboard and Docker Swarm