This repo contains my Home Assistant configuration. Home Assistant is open source home automation that puts local control and privacy first. More information can be found at their website, https://www.home-assistant.io.
I started with Home Assistant back in 2018 somewhere, running it in a Python venv directly at a Raspbian installation. I ran into all kind of compatibility issues in the long run, so I decided to switch to a Docker based setup in July 2019. Ever since starting with my home automation project, I've been making changes weekly and sometimes daily. However, I don't always commit directly to Github (sorry...) so changes may flow in a bit slower. In April 2020 I completely rebuild my Lovelace setup.
My vision is that my Home Automation should always work, even when the internet is down and always should have a manual backup. The house should still be fully functional for me, the others living with me but also my non-tech grandma. That results into choosing solutions that don't use cloud services if not necesarry and that all lights still can always be switched manually. Therefore I use Qubino Zwave modules, enabling me to switch lights manually and 'smart', and some ESPhome flashed Sonoff modules, which also come with a push button to switch the relays. A notable exception to this is the Google Assistant integration, which obviously requires a connection to Google.
- Intel NUC NUC7PJYH with 16GB RAM and 480GB SSD
- Z-Wave.Me ZME_UZB1 USB Stick
- CC2531 Zigbee stick with zigbee2mqtt
- Proxmox VE virtualization manager (running more than just HA)
- Debian Buster virtual machine as Docker host
- Docker
- Home Assistant Core as core
- Mosquitto as local MQTT server
- zigbee2mqtt running my Zigbee network
- zwavejs (through zwavejs2mqtt ) running my Z-Wave network
- Traefik as transparant reverse proxy, handling traffic to all containers and SSL termination
- ESPhome to program my ESP devices
- Duplicati for encrypted backups of my config files to the cloud
- nginx for some static file hosting.
I use a combination of Z-Wave, Zigbee and Wifi in my setup:
- 3x Qubino Flush Dimmer 1 for dining room, 1 for window light in living room and 1 for the hallway
- 1x NEO COOLCAM NAS-PD02Z Z-wave Plus PIR Motion Sensor in the living room - links to a V2 but I use the V1 which lacks temperature support
- 1x NEO COOLCAM NAS-PD02Z Z-wave Plus PIR Motion Sensor in the hallway - this actually is a V2
- 1x Qubino Flush 2 Relay in the garden
- 1x Qubino Flush Shutter to control the cover on the attic windows
- 2x Sonoff basic switches running ESPhome (so no connection with China!)
- 2x Sonoff S20 switches also running ESPhome, 1 in use, 1 in spare for the Christmas lights.
- 2x Xiaomi mijia Temperature Humidity Sensor, 1 in the attic, the other in the main bedroom
- 2x Xiaomi door Window Sensor, 1 is used at the freezer upstairs because the kids tend to leave it not fully closed. The other is installed at the front door. Both are used to warn if the door has been open for over 2 minutes.
- 2x Innr SP120 Smart plugs with power metering. One is used for a reading light with the kids - not to actually switch the power but to measure if the light is on after bedtime :) I'll find a reason to use the other one soon :)
- 2x Blitzwolf BW-SHP13 Smart Plugs. Both are used to improve the Zigbee network quality (and to get rid of my IKEA signal repeater): one is in the living room switching one of the lights there - close to the Zigbee controller. The other one is on the first floor and actually only plugged in, until I find something better to do with it :)
- Rooted Toon thermostat
- Rooting enables local control of the thermostat, and prevents needing a subscription with Eneco. It requires a custom_component (installed through HACS).
- Connecting to emulated Hue on Home Assistant for light switches.
- Google Home Hub in the living room
- AndroidTV in the living room TV
- Philips TAB8805/12 Soundbar with built-in cast in the living room
- Google Home in the study room
- 2x Google Home Mini upstairs
- Google Chromecast in my bedroom TV
In the summer of 2020 my oldest (10) and I decided to build a small weather sensor. As the standard building instructions were using some ugly housing options, we decided to go with a small bird house to put the sensors in. I made a short write-up on what we did at Tweakblogs, also explaining how we use Home Assistant to push the weather data to the APIs of Luftdaten/Sensor.Community and OpenSenseMap: https://hmmbob.tweakblogs.net/blog/18950/push-data-to-luftdaten-and-opensensemap-with-home-assistant. It has pictures too ๐
The weather sensor uses:
- NodeMCU, flashed with ESPHome
- SDS011 Particle Matter sensor
- BME280 Temperature / Pressure / Humidity sensor
Presence detection is always an important issue with Home Automation, and I've struggled with it too. Recently I stepped away from using a combination of Owntracks and bluetooth tracking (I used Monitor) in favor of the official Home Assistant app, because this combination was not robust enough. We had a lot of issues with bluetooth interference (my smart watch lost connection to my phone all the time, and my wifes phone just disabled bluetooth over time). The Home Assistant app has been working flawlessly for the both of us so far! It connects directly to my own server, so no cloud integration needed.
As added benefit of using the official Home Assistant app, I can easily push (actionable) notifications to our phones. Besides push notifications I also use TTS to our Google Home speakers for notifications.
We are using Home Assistant mostly from our phones, so in April 2020 I decided to redo my frontend to a mobile only view. This allows me to just focus on making this view look and work good. After all, when using a desktop I am mostly tweaking my setup anyway and thus mostly using the developer tools. My Lovelace setup is heavily inspired by jmart518: I got triggerd by this tweet of him.
I've extended the possibilities of the standard Lovelace interface through multiple plugins installed through HACS. In my configuration I am using the following plugins:
- Lovelace Swipe Navigation which enables swiping through the different panes.
- Card Mod is used to tweak the CSS styles of all cards I use. It also replaces functionality I used from the Custom Header plugin, as that has been deprecated. Check the themes folder to see what I used to mimick CH behaviour.
- State Switch can be used to display different cards based on the state of an entity. I am using it to display custom greetings to myself and my wife.
- Fold entity row is a really handy tool to have a fold out overview of entities. I am using it for my livingroom lights in the Home Screen, the gas prices in the Locations Pane and to fold the battery state overview (that uses the earlier mentioned Battery State Card) and the smart meter data in the status pane.
- Simple Weather Card which beautifully displays the current weather for my location on the Home Screen.
- Mini Media Player The most beautiful and compact media player I saw around there. These are being displayed only conditionally: when one of the media players is playing something this card will show on the Home Screen.
- Simple Thermostat is used to display the thermostat controls for my Toon thermostat.
- Battery State Card is used for, well, displaying the battery states :)
- Button Card, used for the buttons in the settings pane.
- Mini Graph Card to display temperature graphs in the temperature pane.
- Auto Entities A legacy plugin that I've used in my previous setup, but it is still handy to use in some occasions.
The generic setup is done in ui-lovelace.yaml.
Ready, set..... go!
The Home Screen (link to Lovelace config) contains some information that is always displayed, it also contains a lot of conditional cards. For instance, a reminder which trash should be put out will only be displayed on the day it will be collected. Media player controls will only appear when one of the media players is actually playing some media and remain hidden when in stand-by. Light controls for the lights part of the group "living room" are hidden with a "fold-entity-row" element. This greatly compacts the screen estate needed while still being able to toggle individual lights if we want to.
In the temperature pane I have the controls for the thermostat and the different temperature graphs for the house. See the swiping image.
The location pane also uses a "fold-entity-row" element to display if we are at home and to display some diesel/gas prices around our area. It also displays the geocoded location of my phone - both as text and a map image - so my wife knows when to start cooking when I return home ๐. Oh, by the way: Fake GPS brought me to the stadium of the best soccer club in the Netherlands. Just so you know.
The settings pane contains 9 custom:button-cards to toggle some input-booleans that enable/disable certain functions in the house. Think of light automations based on movement and the ability of disabling the front door bell or the automations of the cover in the attic. All of them will ask for confirmation before actually toggling - to prevent unintended results.
The status pane is only displayed to me and shows some diagnostics of the system. It tells me the battery levels of the different wireless sensors in the house and if certain devices are still online. It will also list the current installed and latest available docker images and if HACS has any updates pending. It also shows the smartmeter power usage - using a state switch card it either displays the normal or low tariff sensor as header of the entity fold.