Skip to content

jorisroovers/casa

Repository files navigation

casa

Home Automation stack based on homeassistant.

In 2021 I've switched over to using the Home Assistant Operating System running on Home Assistant Blue. Before, I orchestrated everything through Ansible including auxillary systems such as Prometheus, Grafana, AppDaemon and more. If this is something you're interested in, have a look at the legacy directory.

I maintain this purely for fun (favoring speed and exploration over quality and documentation). Consider this a reference/demo rather than a re-usable solution

Blogposts and write-ups:

Main dashboard running on wall-mounted iPad HADashboard Home

Menu

Screenshots | Hubs | Climate | Windows/Curtains | Lights | Wall Switches | Power Plugs | Voice Control | Security | Other Sensors | Media | Other Hardware | Software Integrations | Home Assistant Add-Ons | Retired | Additional Notes | Future Work

Screenshots

The main interface is build in lovelace and displayed on wall-mounted iPad minis around the house (the first iPad has been continuously running for over 4 years without issues).

For 4 years, I used a wallmount focussed dashboard build in appdaemon - see legacy. I'm still in the process of building out good Lovelace-based dashboards.

HADashboard Home
Homescreen
HADashboard Media
Office Controls
Home Assistant Blue
My Home Assistant Blue
Zigbee Network Visualization
Zigbee Network Visualization
HADashboard Upstairs
Energy Dashboard
HADashboard Monitoring
Sauna Dashboard
Lovelace Smartphone
Smartphone interface
Smartphone Notifications
Smartphone Notifications
Homeassistant TV Morning
Morning TV dashboard

Hubs

Device HomeAssistant Notes
Home Assistant Blue Home Assistant Blue Hardware I use to run Home Assistant. I've pre-ordered the upcoming Home Assistant Yellow and am planning to switch over once it comes out.
Aeotec Zwave Stick Gen5 ZwaveJS Simple Z-wave controller in USB-stick form factor.
Phoscon Conbee 2 ZHA Universal Zigbee gateway
HomeMatic HmIP-CCU3 HomeMatic HomeMatic control unit, used for smart radiator valves.
Aeotec Zwave Ranger Extender ZwaveJS Self-explanatory: range extender for zwave network :-)

Climate

Device HomeAssistant Notes
Nest Thermostat Nest Smart climate control.
HomeMatic HM-CC-RT-DN HomeMatic Smart Radiator valves. Used to control temperature for radiators upstairs where we have no separate thermostat and heating circuit.
Dyson Pure Humidify + Cool ha-dyson Air purifier and humidifier.
Aqara Temperature sensor ZHA Temperature and humidity sensor used in various rooms around the house.
Sonoff SNZB-02 Temperature sensor ZHA A different temperature and humidity sensor.
Airthings Wave Plus ESPHome Air quality: CO2, Radon, VOC, PPM2.5, PPM10, temp and humidity monitoring for the office. Integrated using an ESP32 running an ESPHome Airthings BLE sensor

Windows/Curtains

Device HomeAssistant Notes
Custom Window Opener ESPHome A custom-build motorized widget to open our bedroom window. I wrote a lengthy blog-post about how I build it.
Dooya Smart Curtain ESPHome Custom solution for smart curtains. Detailed Write-up.
Aqara E1 Roller Shade Driver ZHA To open/close the office blinds.
Aqara Door and Window contact sensor ZHA To detect when a window or door is open.
Sonoff Door and Window Contact Sensor SNZB-04 ZHA Alternative contact sensor.

Lights

Device HomeAssistant Notes
Trådfri ambience E27 bulb ZHA Ikea white ambience lamps
Trådfri ambience GU10 spot ZHA Ikea white ambience spots
Trådfri FLOALT LED panel ZHA Smart LED panel (white ambience)
Ledvance Smart+ LED E27 color bulb ZHA Color bulbs
Ledvance Smart+ LED GU10 color spot ZHA Color spots
Innr White Comfort GU10 spots ZHA White ambience spots
WS2811 LED Strip WLED Color LED Strip for theme lighting using WLED. Still WIP.

Wall Switches

Device HomeAssistant Notes
Aqara Remote Switch ZHA I have both the sincle rocker and dual-rocker models. I really like these, they're very responsive and they have a great physical click effect. I prefer the EU models over the Chinese variant: it has rounded corners and a slightly better clicky-feeling.
Ikea Tradfri 5 button switch ZHA While it's great to have more buttons to be able to cycle through different presets as well as toggle light, in my experience these switches are sometimes non-responsive or very slow which can be frustrating. I'm moving away from them.
Sonoff SNZB-01 Switch ZHA Simple single button switch. Works well.

Power Plugs

Device HomeAssistant Notes
Elgato Eve Power plug NA - Apple Homekit only Bluetooth smart plugs used to hard reset wifi routers every night at 4AM. I've found this solves many stability issues. Also really useful to power cycle network gear even when whole network is down.
NEO Coolcam Z Wave Plus Power Plug zwaveJS Power switching and monitoring. Cheap and does the trick, although not very secure.
Aeotec Smart Switch 7 zwaveJS Power switching and power monitoring of some devices. Works very well but pricey. Also have v6 models in use.
Trådfri Smart Power Plug ZHA Very cheap zigbee power plug from Ikea. Does not have a physical button so you can only switch these from software, which is why I only ever got a single one.
LEDVANCE SMART+ ZB PLUG EU ZHA Cheap Zigbee power plug (no power monitoring).
Innr SmartPlug ZHA Another cheap Zigbee power (no power monitoring).

Voice Control

Device HomeAssistant Notes
Amazon Echo dot (v2, v3) Emulated Hue Integration between Home Assistant and Alexa.
Amazon Polly Amazon Polly Temporarily not using. AWS Text-to-Speech engine. Allows the house to talk back (e.g. "Good Night!"). Cool? Yes. Nerdy? For sure.

Security

Device HomeAssistant Notes
Nest Cam Indoor Nest Intelligent security camera (allows remote access). I'd probably not buy Nest Cams if I'd be starting today, instead opting for something with better local API access.
Nest Cam IQ Indoor Nest 1080p video monitoring with 4K sensor (for digital zooming).
Nest Cam Outdoor Nest Garden monitoring
Nest Protect smoke detectors Nest Smart Smoke and CO detectors
Aqara Motion Sensors ZHA Motion sensing to turn on lights and notify on movement (when there shouldn't be any).
Ikea Motion sensors ZHA Motion sensing to turn on lights and notify on movement (when there shouldn't be any). I recommend the Aqara ones over Tradfri, they are more responsive.

Other Sensors

Device HomeAssistant Notes
Aeotec ZW100 MultiSensor zwaveJS Multi-sensor. Used to detect movement, temperature and humidity in bathroom.
Aqara Water Leak sensor ZHA To detect when the shower is in use, also water leaks in laundry room.
Aqara Vibration sensor ZHA To detect chair movement in the living room (ie. auto turn-on lights).
Raspberry Pi 3B + Serial-to-USB cable Sensor - DSMR Energy monitoring using the Dutch DSMR energy monitoring protocol

Media

Device HomeAssistant Notes
Samsung SmartTV QE55Q70R SamsungTV Our main TV
Samsung SmartTV UE48H6200AW SamTV + shell_command Older Smart TV that isn't supported by Home Assistant out-of-the-box. I've used SamTV to control it in the past.
Sonos play 5, Gen 1 Sonos Main Living Room smart speaker. Model no longer sold.
Sonos Play 1 Sonos Bathroom smart speaker. Model no longer sold.
Sonos One Sonos TV Surround smart speakers - back units
Sonos Play Base Sonos TV Surround smart speakers - front unit
Sonos Move Sonos Portable smart speaker, usually docked in the Office but used in the garden during the summer
AppleTV 4K AppleTV
AppleTV AppleTV Attached to non-4K TV
Playstation 4 Sony Playstation 4 I've gone back and forth on use Home Assistant's PS4 integration, and a simple custom sensor to reliably detect whether the PS4 is active.

Other Hardware

Device HomeAssistant Notes
Smart Sauna ESPHome Smart controls for my custom-built infrared sauna using ESPHome. I've written a detailed write-up on my blog.
Smart Diaper Station ESPHome Smart lighting over the baby diaper station using an HX711 weight sensor and smart wallplug.
Quooker NA Boiling water tap. Not a smart device, but still a very time-saving way to boil water for tea or cooking.
iPad mini (Gen 2, Gen 4) Mobile App Wall Mounted control panels
Linksys WRT1900AC OpenWRT (luci)
(but not done)
Main router and Wifi Access Point, running OpenWRT. I use this in combination with some cheap dumb network switches from TP-Link and have an SSD hooked up to it for NAS over SMB. While the current setup works fine, I'd like to upgrade my network setup to something more prosumer (like Ubiquiti) but haven't come around to it.
Raspberry Pi NA Own a few different models for various purposes.
AnyCubic i3 Mega S OctoPrint
(but not done)
3D printer, controlled using OctoPrint running on a Raspberry Pi.
Ortur Laster Mater 2 Pro NA Laser cutter. Not integrated with Home Assistant.

Software Integrations

Additional software integrations I use with Home Assistant.

Software HomeAssistant Notes
Homeassistant Mobile App (iOS) Mobile App Mobile application for home-assistant.
Home Assistant Companion for macOS (beta) Mobile App Home assistant application for the mac.
SleepCycle HomeKit Smart alarm mobile app that can integrate via Homekit to create a wake-up light.
ESPHome ESPHome Firmware to easily integrate ESP8266/ESP32 MCUs with Home Assistant. I use this for all sorts of projects (Automated Curtains, Window opener, Diaper Station, Smart Sauna, Air Quality monitoring, WLED).
HACS Add On Home Assistant Community Store. Loads of great integrations and dashboard cards that are not included in Home Assistant by default.
Google Calendar Google Calender Event Display and notify on upcoming events (e.g. birthdays)
Google Maps Google Maps Travel Time Display travel time to Office
Buienradar.nl Sensor - Buienradar
Weather - Buienradar
Local (Dutch) weather reporting and events
Afvalinfo HACS Waste collection details for The Netherlands.
System Monitoring System monitor System monitoring (CPU, memory, etc)
Work Day Workday Determine whether any given day is a working day or not (weekend, holidays) based on location.
Ser2net Sensor - DSMR Simple way to expose a serial port to the network. I use this to expose a serial stream coming from a Raspberry PI connected to my smart electricity meter to homeassistant.
Presence Detection Zone Detecting whether we're home or not.

Home Assistant Add-Ons

Software HomeAssistant Description
Home Assistant Google Drive Backup Home Assistant Google Drive Backup Automatically backup your Home Assistant config to Google Drive. Super reliable and highly configurable - recommended
InfluxDB InfluxDB Addon Time series database used to persistently store sensor and monitoring data.
Grafana Grafana Addon Visualization dashboard to display metrics stored in homeassistant and prometheus.
AdGuard Home AdGuard Home Addon Network-wide ads & trackers blocking DNS server.
VSCode Studio Code Server Addon Advanved code editor to easily edit Home Assistant configuration from the browser.
ZwaveJS ZwaveJS Addon Very reliable Zwave driver. Recommended approach for managing your zwave devices with Home Assistant.
SSH & Web Terminal SSH Add-On SSH access to Home Assistant Blue device.
OpenWRT NA Main AP/Router software. Not immediately related to home-automation but important supporting system.

Retired

Retired Hardware

Hardware Notes
2011 Macbook Pro Old laptop (2.7GHz dual-core i7, 8GB RAM) I used for hosting the whole stack for about 5 years. I've since switched to using Home Assistant Blue.
Ikea Trådfri Hub I've replaced the Tradfri hub in favor of a Phoscon Conbee 2 universal zigbee gateway. I'm still using the Trådfri light bulbs and motion sensors.
Philips Hue Hub v2 I moved away from the Philips Hue Hub over to direct control using Zigbee (ZHA).
Hue color bulb I've read that Philips Hue bulbs don't work well with other zigbee gateways, so I decided to replace all bulbs.
Hue ambience bulb See above
Hue ambience spot See above
Hue dimmer switch See above
Elgato Eve Window sensor HomeKit only. Not currently using.
Chromecast We usually use our AppleTV(s) instead.
Google Nest Home We use our Echo Dots instead.
Sonoff Basic R2 Wifi-enabled ESP8266 based remote relay
Shelly 1 Wifi-enabled ESP8266 based remote relay
Hue Tap Switch Battery-free Philips Hue Switch.
TPLink HS110 Smart plugs used for various purposes. I do NOT recommend using TPLink smartplugs.
TPLink HS100 Smart plugs used for various purposes. I do NOT recommend using TPLink smartplugs.
SwitchBot Curtain Smart Electric Motor Not strong enough for our curtains. Also tried a Chinese variant but same issue.
Desk-height Simple Arduino-based sensor to determine the current height of my standing desk using an ultrasonic sensor mounted underneath it.

Retired Software

My setup has changed dramatically over the years, and was simplified a lot with the my adoption of the Home Assistant Operating System. A lot of the items listed below were part of my legacy setup.

Software Notes
HADashboard Part of appdaemon that allows for easy creation of dashboards for Home Assistant that are intended to be wall mounted (optimized for distance viewing).
node-sonos-http-api HTTP API bridge for Sonos speakers. Filled some gaps in sonos features that HomeAssistant didn't support in the past.
Monit When I started out, I used Monit for simple monitoring but I quickly required more elaborate monitoring capabilities.
Sensu I migrated from Monit to Sensu for monitoring but over time that ended up consuming way too much CPU and memory which tended to slow my whole stack down.
Prometheus For a long time I ended up using Prometheus to collects metrics on various components of my stack, and alerts when certain conditions are (not) met. Today, I don't do explicit monitoring anymore: the stack has become stable enough that the maintenance overhead of running prometheus is no longer worth it.
As part of my Prometheus stack, I also used Alert Manager, Node Exporter, Process Exporter, Blackbox Exporter. I also wrote a custom prom2hass script for synching metrics and alerts between Home Assistant and Prometheus.
Sanity tests Small set of python tests that ran every 5 min against the setup that check for some common problems and misconfigurations. These were great to catch issues when I've made changes to the setup. These tests were implement using requests and Selenium.
ELK Log Aggregation, Search Indexing, web dashboard. Didn't use it a lot and uninstalled it because it required too much memory and CPU for my liking.
Slack Used for sending notifications from Home Assistant when certain events occurred around the house. I've now switched to sending notifications directly to the Home Assisanta Mobile App.
Seshat Simple set of script(s) in typescript that aggregate some metrics from InfluxDB into more interesting statistics that I can display in grafana. These run every minute via a cronjob.
roofcam Simple custom python program to determine whether my flat roof has any water on it (which means the draining pipes are clogged up). Uses very simple image manipulations on screenshots to determine this. At some point I'd like to do something more advanced with ML, but the current script already is ~85% accurate on test data. Don't always have this program running.
Backups Set of scripts that do periodic backups of some personal data and copy the resulting tarballs over to a Samba/CIFS network share. Each backup script also has an accompanying monitoring script that periodically verifies whether the last backup was successful.

Additional Notes

  • I have no idea how much time I've spend getting to this point, but I'm fairly certain it's a couple of hundreds of hours at least. Spread over 5+ years.
  • I've never done a calculation of how much the current setup has cost me, but I'd guess it's about 3000-5000 EUR, some of which was spent on gear I no longer use. Note that it also highly depends on how you calculate things. Do you account for a (smart) TV? What about smart audio speakers? An old laptop that you had still lying around that you use as a server? Light bulbs you needed to buy anyways but you bought smartbulbs instead? etc.
  • If you're new to home-automation and want to do something similar to this, I recommend getting a Raspberry Pi (get the latest model with the most compute power) and installing HomeAssistant on it. Then get yourself a set of Ikea Tradfri smart light bulbs and start playing! As a next step, you can consider getting a Home Assistant Yellow.
  • Since my family's mother tongue is Dutch, you'll see some Dutch language used here and there (mostly in the user-facing parts).

Future Work

There's always more to automate!

  • Siding curtains (in-progress)
  • Automated window opening (✅done)
  • Window blinds (in addition to curtains, maybe?)
  • Doorlocks
  • Doorbell
  • WLED (in progress)
  • Sense Infuser?
  • Garden irrigation
  • Improved presence detection (✅done)
  • Improved voice commands
  • Upgrade network gear
  • Replace macbook server with something more suited (although it works well...) (✅done)
  • Only use zwave/zigbee (no WiFi) to interact with sensors (✅done)

Uploading new version

Instructions (for myself) when uploading latest homeassistant config.

# Copy all files from homeassistant shared dir to this repo dir
cp -R /opt/shared/homeassistant/* /opt/shared/repos/casa

# Cleanup files we don't want in here (make sure to add new files using `git add` first)

# Dry Run (= -n)
git clean -fxdn

# Actual deleting ignored (and non-staged) files/dirs
git clean -fxd