Skip to content

johnkoht/hassio-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

There are some person-specific automations that I leverage for various reasons. Some of the common ones include:

Sleep State

Every bed in the house has a force sensitive resistor (FSR) sensor that detects occupancy. The state of a person is managed through an input_select that includes:

  • Awake
  • Just Got Up
  • Just Laid Down
  • Sleep

There are a few automations and some other sensors that help automate this process. I also have some general sensors that indiciate if everybody is awake or asleep or if somebody is asleep. Person-specific sleep state will influence the state of the room they occupied, e.g. if I'm sleeping, my room will transition to "bedtime" mode which disables some automations and disables TTS messages, for example. When everybody is sleeping, the house will change to Bedtime mode.

Commuting

There are a few automations in place that toggle communiting automations if we're commuting to work. This includes TTS notifications for departure and arrivals. No fancy travel time stuff (yet).

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. If I'm in the Office, the Office will transition to DnD state, which means a light outside my office turns on and no TTS messages will broadcast. These automations are a bit convoluted right now because AirPods wouldn't show up speaker/mic out for a while in Hassio.

Arrived 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:

Some of my favorite/most useful automations

  • Climate Automation: I switched to hourly pricing with ComEd and have started to automate the HVAC/AC system to turn off when prices spike and back on when they normalize.
  • Outdoor Lighting: We have a few exterior lights, most of which live on their own switch, one of which is in my garage. Turning on the exterior lights would require I walk around the entire house and I'm too lazy for that. I also have a bunch of Hue Lily Uplights around the house that have no physical switch. All exterior lights automatically turn off when it's dark outside, including if the weather is really bad and dark during the day. Certain lights stay on all night while others turn off at bedtime.
  • Automatically close garage door when nobody is around: there's always a lot of people in and out of my house and the garage door always gets left open. They will now automatically close after a while if nobody is around the garage (BLE sensor, motion, cameras). It will also notify us via TTS that the garage door will be closed. Also, doors will automatically close when the house is not occupied.
  • Lock garage door remotes: when the house is empty or we go to sleep, automatically lock the garage doors so that remotes cannot open or close the doors. Just a little extra security, I think.
  • Entertainment Mode: my wife doesn't love automations and TTS messages when we are entertaining during holidays. I can either toggle this manually or it's automatically triggered when the house detects a bunch of BLE devices. This will stop TTS messages, adapative lighting, and other automations that might otherwise upset my wife. Gotta keep the WAF as high as possible.
  • Bedtime Mode: When everybody is in bed, the house goes into Bedtime mode. This means that all of the rooms, expect bedrooms, essentially turn off. No automations will run, etc. The bedrooms all enter a Bedtime mode as well where automations vary depending on the room. But mostly it's low lighting, no TTS, etc. This will also arm the alarm panel, ensure the doors are locked, and more.
  • Safety Outlets: Some outlets around the house will automatically turn off when we're not home or the room is off. The best example is the hair dryer and steamer in our main bathroom.
  • Announcing when somebody is at the grocery store: whenever somebody is at a grocery store, a TTS message will broadcast across the house to let everybody know...in case I need some more Oreos, ya know?
  • Reminders: Most of our calendars are integrated into HA and used for TTS reminders. For example birthdays, famliy calendar events, garbage day, robot vacuum maintenance, and much more.
  • Morning Update for the Family: Every morning, a TTS message is broadcast at just the right time (or pretty close). This message contains weather info, school, calendar events, and much more.
  • Security Camera Notifications: Unifi notifications aren't great so I built my own. It's a bit more intuitive and useful for our needs. More details in the link. These automations take into account time of day, darkness, who's home, and more. Notifications automatically turn on and off based on various conditions. The notifications can be push, displayed on a TV, or TTS messages. They also leverage different notifications types like critical and time-sensitive based on conditions.
  • Alarm panel automation: Automatically arm the house at bedtime or if we leave, disarm when we arrive or wake up.
  • Automatically lock/unlock doors: Locks belong to rooms, e.g. foyer and mudroom, so they are not centralized automations. Different door locks have different automation triggers and conditions.
  • Vacuum my office when I drop the dog at daycare: The dog stays in my office and I'm lazy, so I send the robot vacuum to clean whenever I drop the dog off at daycare.
  • Weather automations: a bunch of weather related automations for severe weather, air quality, etc.
  • John's Daily Report: every morning when I start my work day, I get a TTS notification in the office that tells me about my day, next meeting, sleep score, and more.

Hubs | Lighting | Climate & Weather | Outlet, Switches, & Repeaters | Locks | Garage Doors | Voice | Media | Sensors | Cameras | Vacuum | Energy | Lawn & Garden | Network | Servers |

| Go to Menu |

Device Quantity Connection Home Assistant Notes
HUSBZB-1 1 USB Z-Wave JS Used to control Z-Wave devices.
ZigStar UZG-01 1 Ethernet / POE ZHA Used to control Zigbee 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

| 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 5 Local API Awair Monitors air quality
Tempest Weather Station 1 Local WeatherFlow Local weather station

| 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 12 Zigbee ZHA Smart outlet, just trying these out
Aeotec Range Extender Zi 2 Zigbee ZHA Zigbee range extender to help stabilize my network.

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Level Lock 1 Bluetooth Bluetooth Proxy Replaced my August with this. It works okay.
Yale Assure Lever Lock with Z-Wave 1 Z-Wave Z-Wave JS Garage door entry lock

| 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
Home Assistant Voice Preview 2 Wi-FI Home Assistant Cloud Currently just experimenting with this, but looks promising

| 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 and FB marketplace.

| 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
Aqara FP2 3 Homekit Homekit bridge mmWave presence detection
Everything Presence Lite 2 ESPHome ESPHome mmWave presence detection
Bed Occupancy Sensor 3 ESPHome ESPHome Force sensitive resistor sensor to detect bed occupancy

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Ubiquiti Unifi G4 Bullet 4 Ethernet/PoE Unifi Protect 1440p PoE cameras around the house
Ubiquiti UniFi Protect G4 Doorbell Pro PoE 1 Ethernet/PoE Unifi Protect Front door doorbell camera
Ubiquiti Unifi AI Pro 1 Ethernet/PoE Unifi Protect 4K Camera looking down the driveway and front of the house
Ubiquiti Unifi G5 Turret Ultra 1 Ethernet/PoE Unifi Protect 2K Camera in the backyard

| 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

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Rachio 3 Smart Sprinkler System 1 Cloud Push Rachio Integration Smart sprinkler system

| Go to Menu |

Device Quantity Connection Home Assistant Notes
Ubiquiti Unifi Dream Machine Pro 1 SFP (2.5g) Unifi Network Unifi OS, switch and security gateway. UniFi Protect video surveillance NVR. Presence detection for non-household members and devices.
Ubiquiti Unifi Aggregation Switch 1 SFP Unifi Network Aggregation switch for SFP connections
Ubiquiti Network Video Recorder (NVR) 1 SFP Unifi Network Network Video Recorder for all cameras
Ubiquiti Networks UniFi Switch PoE - 48 Ports (USW-48-POE) 1 Ethernet Ubiquiti Unifi WAP Switch that connects to all room ethernet runs (non-critical devices)
Ubiquiti Networks Unifi Switch 24 Enterprise PoE 1 SFP Ubiquiti Unifi WAP Primary swiitch for Home Lab, network, and cameras
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.
Ubiquiti Networks Unifi Access Point U6 In-Wall 2 Ethernet/PoE Ubiquiti Unifi Wired PoE Access Point

| Go to Menu |

Hardware Compute Memory Storage Description
Supermicro SCE826 12 Bay 2U Server 24 Cores / 48 Threads 192 GB 6 x 12TB HDDs, 1 x 256 GB NVMe SSDs, 2 x 1TB NVMe SSDs Runs proxmox with TrueNAS and a bunch of VMs (Paperless NGX, Immich, Grafana, Gramps, Hoarder, etc)
Supermicro 6018-TRTP+ 1U Server 26 Cores / 52 Threads 256 GB 2 x 1.92 TB SSDs AI stack (Ollama, Open WebUI, etc), Media Server, Authentik, Caddy External, Minecraft Server
Supermicro X11SSQ 1U Server (in a BSI chassis) 4 Cores / 4 Threads 48 GB 2 x 1 TB NVMe SSDs (mirror), 256 GB NVMe boot SSD New proxmox server that I'm migrating some of my smart home services
Supermicro X11SSQ 1U Server (in a BSI chassis) 4 Cores / 4 Threads 32 GB 2 x 8 TB HDDs (mirror), 128 GB NVMe boot SSD Proxmox Backup Server (PBS)

About

My Home Assistant Custom Configuration

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •