Skip to content

johnkoht/hassio-config

Repository files navigation

Home Assistant Configuration

Home Assistant is the core of my smart home system. This repo includes all the custom packages, sensors, and automations that power my house. It's a work in progress and is constantly evolving.

Deployment

Home Assistant OS is deployed as a VM in my Unraid server. It has access to 6 CPU threads and up to 8 GBs of memory. I also use Nabu Casa for remote access and to support the project.

Key Software

Architecture

My Home Assistant configuration is architected a bit differently than many other configs. I was heavily influenced by Tinkerer's configuration, which I recommend you check out. Instead of large, complex automations that do many things, my configuration is split into hundreds of smaller automations, scripts, and sensors. For example, many home assistant setups have an automation that turns offs all the lights in the house when it's not occupied. In my configuration, when the house is not occupied, an automation for each room is triggered that effectively turns that room off, including the lights, media, and anything else that shouldn't be on.

You can think of my smart home as a collection of smart rooms. Most rooms have an input_select that manages the state of the room. For example, my office has the following states:

  • Auto: Automations are enabled, i.e., motion lighting, media, etc.
  • DnD: Do Not Disturb turns on a red light outside my Office, turns off voice notifications, and turns off any music playing in the Office.
  • Off: No automations, just a regular, dumb room.

Automations within a room are determined and controlled by the room's state and available automations. The house also has state (see house.yaml). The house also has a variety of meta properties that are controlled by input_booleans, for example:

  • House Occupied (input_boolean.house_occupied): This boolean is triggered by people being home or away. Check out this automation for reference. A bunch of other automations are triggered by changes in this boolean. For example, the state of the house will change to Away when not occupied, and other rooms will also turn off.
  • Guest Mode (input_boolean.guest_mode): This boolean is triggered when guests are present. Various automations check to see if guest mode is enabled to activate or modify conditions.
  • Quiet Mode (input_boolean.quiet_mode): If any of the kids are sleeping, this boolean will turn on and change the house state to "Quiet." For example, this will prevent the doorbell from ringing and lower the TTS device volumes.
  • Lighting Automations (input_boolean.lighting_automations): This boolean will enable or disable lighting automations across the house. If this is off, then no lighting automations should trigger. Some rooms have their own property to manage lighting automations within the room.
  • Speech Notifications (input_boolean.speech_notifications): A way to globally turn on/off voice notifications throughout the house.
  • Bad Weather (input_boolean.bad_weather): Triggered when the weather outside isn't great. Various rooms will react to this boolean. For example, the foyer chandelier will turn on when the weather is bad since it gets dark by the stairs.

Some of these booleans have two automations to manage state: one that is triggered and turns the boolean on and another that turns the boolean off. For example, check out the bad weather automations. Some of these are only changed through the UI. For example, speech and lighting automations are rarely used but are helpful when I need to turn them off without much effort.

Presence Detection

Presence detection is an integral part of my home automation. There are two layers to presence: home presence and room presence. Basically, is a person home, and if so, which room are they in.

Home Presence

For home presence, I use the Person integration from Home Assistant to combine various device trackers. Currently, I'm using the following:

The companion app and iPhone Detect are usually the most accurate for my wife and me. I also have a Bayesian sensor for presence detection for us. I use the three network-based trackers for regular guests, and they work fairly accurately. These trackers will help reliably determine who is home or if the house is not occupied.

I adopted Phil Hawthorne's methodology for making presence detection not so binary. Each person has an input_boolean that defines whether they are home or not, but there also is an input_select that clarifies the state as: "Home," "Away," "Just Arrived," or "Just Left." This is helpful when somebody leaves and quickly returns.

Room Presence

I use ESPresense for room presence detection. I have about 15 BLE base stations spread out throughout the house. ESPresense is a pretty great tool, but it's sometimes not the most accurate. It took a lot of tweaking to get fairly consistent results. But now that it's working correctly, it's pretty great. The main benefit of room presence is avoiding turning off the lights/room if there is no motion for a while. So if I'm sitting at the kitchen table reading something and barely moving, the kitchen won't turn off if it detects my phone.

Zone Presence

Home Assistant has a great Zone integration that lets you identify zones to track. I haven't done as much as I'd like to do here, but I have some useful automations to notify the house occupants whenever somebody arrives or leaves work. I'm working on tracking school dropoffs, grocery store visits, and more.

Anatomy of a Room

The most advanced room in my house is my Office (mostly because nobody complains when I experiment). As I mentioned, the Office has three states: Auto, Off, and DnD. When the Office is in Auto state, automations will be active. So when somebody walks into the room and motion is detected, the room will become occupied. If the rooms are occupied, here are some automations that can be triggered:

  • If it's dark in the room, the lights will turn on
  • When the room becomes bright enough, the lights will turn off
  • Music will play automatically when John is working
  • Music will turn off when John is on a call
  • Adaptive lighting will turn on / off

The Office state can transition to DnD when John's on a call. This state will change the way the automations work, for example:

  • A red light will go on outside the Office to let people know
  • Speech notifications will be disabled
  • The El Gato camera light will turn on (if my laptop camera is active)
  • Music will turn off (if playing)

When the Office is no longer occupied, a few automations will trigger to turn off the lights and music.

Anatomy of a Person

I have some person-specific automations that are extremely useful, but this is an area of opportunity within my setup. Here are a few examples:

  • Sleep Presence: I don't have a smart bed (yet), so I can't accurately observe if we're sleeping (or in bed). To address this, I have a Bayesian sensor that calculates the probability that I"m sleeping. This takes information like the time of the day, if the bedroom door is closed, lights are off, room presence is detected, and our phones are plugged in. These Bayesian sensors trigger booleans, which then trigger other house-wide automations.
  • Do Not Disturb: I have an input_boolean that identifies if I'm in DnD mode. For example, if my laptop camera is on, my calendar is active, and some other conditions are met, my DnD boolean will turn on. Likewise, if I'm in the Office, the Office will transition to DnD state.
  • John Home: When I arrive home, a boolean is turned on. This boolean can trigger other scripts and automations. For example, when I arrive in my car, the garage will open, and the lights will turn on in the garage and mudroom. Also, the house will announce my arrival. Likewise, it announces my departure.

Speech Notifications / TTS

Speech notifications give the house a personality. I have a bunch of Sonos Amps that power in-ceiling speakers throughout the house. Automations and home states can broadcast messages throughout the house via TTS. Speech notifications are only broadcast in rooms that are occupied. So if I'm in the Office, my wife is in the bedroom, and our kids are in the Playroom, it will announce in all three rooms. For example, when I leave the house, an automation will broadcast a voice notification to let people know. Likewise, when I arrive at work, a speech notification will trigger. Most regular guests are announced. There are a lot of other announcements as well, including:

  • Exterior lights turning on/off
  • Quiet mode is enabled
  • Announce arrival and departure of family
  • Washer or Dryer is finished
  • Kitchen fridge has been open too long
  • School day announcement, dropoff/pickup reminders
  • Calendar reminder (upcoming or next day)
  • Commuting notifications (arrived at station, heading home, train five mins away)
  • Garbage day
  • Severe weather warnings

Hubs | Lighting | Climate | Outlet & Switches | Locks | Garage Doors | Voice | Media | Sensors | Cameras | Vacuum | Energy | Network |

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Nortek HubZ Controller 1 USB Z-Wave JS ZHA Used to control all Zigbee and Z-Wave devices.
Hue Hub 2 Ethernet Philips Hue Used to control all Philip Hue products (lights, motion sensors, switches)
Lutron Caseta Smart Bridge 2 Ethernet Lutron Caséta Controls Lutron Caseta light switches, dimmers, and Pico remotes
myQ Chamberlain Smart Garage Hub 2 WiFi MyQ Used to control the garage doors

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Philips Hue BR30 White and Color 14 Hue Hub (Zigbee) Philips Hue Light Color changing smart bulbs
Philips Hue White A19 LED Smart Bulb 2 Hue Hub (Zigbee) Philips Hue Light Bedside lamps
Philips Hue White A19 LED Smart Bulb 2 Hue Hub (Zigbee) Philips Hue Light Bedside lamps
Philips Hue Gradient Ambiance Lightstrip 9 Hue Hub (Zigbee) Philips Hue Light Office shelves lighting
Lutron Caseta Wireless Dimmer 26 Lutron Smart Bridge Lutron Caséta Smart dimmer switches that do not require a neutral wire
Lutron Caseta Pico Wireless Dimmer Switch 21 Lutron Smart Bridge Lutron Caséta Decora wall mountable remote (that looks like a dimmer switch). Controls various lights
Lutron Caseta Wireless Lighting Switch 1 Lutron Smart Bridge Lutron Caséta Smart on / off light switches
Enbrighten Zigbee Dimmer QuickFit 43080 2 Zigbee [Jasco](https://www.home-
Enbrighten Zigbee QuickFit 43078 2 Zigbee Jasco Smart on / off light switches

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Google Nest Learning Thermostat 2 WiFi Google Nest Thermostats for main and upper levels
Aqara Temperature and Humidity Sensor 12 Zigbee ZHA Provides-specific room temperature and humidity reporting
Awair Element 2 Local API Awair Monitors air quality

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Aoetec Smart Switch 7 3 Z-Wave Z-Wave JS Utilized to make my dumb washer (2) and dryer smart (see Phil Hawthorne's blog post)
Aqara Smart Plug 8 Zigbee ZHA Smart outlet used to control various devices like space heaters, Christmas lights/tree, etc. I also have a couple of these specifically to extend the mesh network.
IKEA Trådfri Smart Outlet 5 Zigbee ZHA Smart outlet used to control random devices, currently Christmas lights and a space heater.
Wemo Mini Smart Plug 3 Wi-Fi Belkin WeMo Smart outlets, but I don't really use these as they haven't been very reliable for me.
THIRDREALITY ZigBee Smart Plug with Energy Monitoring 11 Zigbee ZHA Smart outlet, just trying these out

| Go to Menu |

Device Quantity Connection Home Assistant Notes
August Smart Lock Pro 1 Cloud Push August Smart lock for the front door

| Go to Menu |

Device Quantity Connection Home Assistant Notes
ratgdo 3 Wi-Fi MQTT Local MQTT & dry contact control over garage doors

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Amazon Echo Dot 3 Wi-Fi Home Assistant Cloud Audio only Voice Assistant
Amazon Echo Show 8 1 Wi-Fi Home Assistant Cloud Voice Assistant with display

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Sonos Amp 6 Ethernet Sonos Audio playback and Home Assistant TTS
Sonos Port 3 Ethernet Sonos Audio playback and Home Assistant TTS. One port controls an amp to a 5.1 speaker system in the Playroom, and the other powers the outdoor Sonance system.
Sonance Patio Series 8x2 1 Audio Cables Outdoor audio system around the pool
Sonance Mariner 64 2 Audio Cables Outdoor audio system in the gazebo
Sony Bravia SmartTV 1 Ethernet Sony Bravia TV Family room TV
TCL 75-Inch Q7 QLED 4K Smart Google TV 1 Ethernet Android TV Remote Basement TV

The Sonos Amps are super expensive, but I found some much cheaper, lightly used, or open boxes from OfferUp.

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Aeotec Trisensor 3 Z-Wave Z-Wave JS Motion, temperature and illuminance
Aqara Motion Sensor 26 Zigbee ZHA Motion and Light Level sensor used to automate around motion events and current room brightness.
Aeotec Multipurpose Sensor 2 Zigbee ZHA Door sensor for kids bedroom, includes temperature readings.
XFINITY Security Visonic ZigBee Door Window Sensor 13 Zigbee ZHA Internal door sensors used for occupancy and automations. One is used for the fridge since it doesn't beep when left open.
Aqara Water Leak Sensor 2 Zigbee ZHA Water sensors in the basement
Aeotec Water Leak Sensor 5 Zigbee ZHA Water sensors for the sinks and laundry room.
Aqara Door and Window Sensor 7 Zigbee ZHA Window magnetic open/close sensors

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Ubiquiti Unifi G4 Bullet 2 Ethernet Unifi Protect 1440p POE Camera.
Ubiquiti UniFi Protect G4 Doorbell (UVC-G4-DoorBell) 1 WiFI Unifi Protect Front door doorbell camera
Ubiquiti Unifi AI Pro 1 Ethernet Unifi Protect 4K Camera looking down the driveway and front of the house

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Roborock S7 Vacuum and Mop 1 Wi-Fi Xiaomi Miio Smart Vacuum and Mop for the main floor
Roborock Q7 Max+ Vacuum and Mop 1 Wi-Fi Xiaomi Miio Smart Vacuum and Mop for the upper floor

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Aeotec Smart Home Energy Meter 5 2 Z-Wave Z-Wave JS 200 Amp CT Clamps. I have one installed and the other sitting in a cabinet waiting to be installed

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Ubiquiti Unifi Dream Machine Pro 1 Ethernet Unifi Network Unifi OS, switch and security gateway. UniFi Protect video surveillance NVR. Presence detection for non-household members and devices.
Ubiquiti Networks UniFi Switch PoE - 48 Ports (USW-48-POE) 1 Ethernet Ubiquiti Unifi WAP Primary Network Switch. Presence detection for non-household members and devices
Ubiquiti Networks UniFi Switch PRO PoE - 24 Ports (USW-Pro-24-POE) 1 Ethernet Ubiquiti Unifi WAP Media Network Switch. Upgraded to a 48 so moved this to manage my media rack
Ubiquiti Networks UniFi Switch Lite 8 PoE (USW-Lite-8-PoE) 1 Ethernet Ubiquiti Unifi Additional PoE Network Switches. Mostly used for the two G4 bullet cameras and an AP.
Ubiquiti Networks UniFi USW-Flex-Mini (USW-Flex-Mini-5) 1 Ethernet Ubiquiti Unifi Additional Network Switch for Hue and Lutron smart hubs.
Ubiquiti Networks Unifi Switch Flex (USW-Flex) 1 Ethernet Ubiquiti Unifi Additional PoE Network Switch that powers an AP and eventually more PoE cameras.
Ubiquiti Networks UniFi in-Wall Access Point (UAP-IW-HD-US) 5 Ethernet Ubiquiti Unifi Wireless Access Point for interior use. Presence detection for non-household members and devices.
Ubiquiti Networks UniFi nanoHD (UAP-nanoHD-US) 1 Ethernet Ubiquiti Unifi Wireless Access Point for interior use. Presence detection for non-household members and devices.
Ubiquiti Networks UniFi Access Point AC Pro (UAP-AC-PRO-US) 1 Ethernet Ubiquiti Unifi Wireless Access Point for interior use. Presence detection for non-household members and devices.
Ubiquiti Networks UniFi Access Point WiFi 6 Long-Range (U6-LR-US) 1 Ethernet Ubiquiti Unifi Wireless Access Point for interior and exterior use. Presence detection for non-household members and devices.
Ubiquiti Networks Unifi Mesh AP (UAP-AC-M-US) 1 Ethernet Ubiquiti Unifi Wired PoE Access Point that's outside in the backyard. Presence detection for non-household members and devices.

About

My Home Assistant Custom Configuration

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published