Skip to content

Home Assistant

Home Assistant runs on the production Pi 5 as the hub for physical environment control: lights, climate, audio, presence tracking, and smart appliances. Beyond automating the home, it serves as a data pipeline — capturing physical-world events and forwarding them to n8n, where they flow into PostgreSQL for long-term analysis.

Home Assistant runs in a Docker container on the Pi with network_mode: host. Host networking is required for mDNS/SSDP device discovery (Ecobee, Sonos, Hue Bridge), HomeKit Bridge multicast, Bluetooth via D-Bus, and direct TCP access to the Wyoming voice containers on localhost ports.

PropertyValue
Imageghcr.io/home-assistant/home-assistant
HostPi 5 (Caroline), production
Networkinghost network mode
Resources1536m memory, 2.0 CPUs
Configha-config/ directory, bind-mounted to /config
Recorder backendPostgreSQL (10-day retention)

The ESPHome firmware management tool runs alongside HA with host networking as well, but with restart: "no" — it’s started on-demand for satellite firmware updates, not kept running.

IntegrationDevices
Sonos3 speakers (portable, living room, Sonos Beam)
Philips HueLights in 6 rooms (garage, living room, bedroom, office, bathroom, stairway, patio) via Hue Bridge
EcobeeThermostat / HVAC control
Dyson PH04Air purifier (local API via dyson_local HACS component)
BlissLightsDecorative lights (LocalTuya / tuya_local — no cloud dependency)
WemoSmart plug
Kasa TP-Link3 smart power strips with per-plug power monitoring
LG ThinQWasher and dryer
Litter-RobotStatus monitoring
SpotifyPlayback control
Hue Sync BoxHue Sync Box control via huesyncbox HACS component
Midea ACLocal AC control via midea_ac_lan HACS component

iCloud3 v3 (icloud3 HACS component) tracks three Apple devices: iPhone, Apple Watch, and MacBook Pro. Location updates feed into the ha.events PostgreSQL table as JSONB for timeline analysis.

Wake-on-LAN and SSH shutdown switches for the Synology NAS and nightwatch machine. Binary sensor ping probes for both. These integrate with power management automations that bring machines online on a schedule and shut them down when idle.

Wyoming protocol integrations for the local STT, TTS, and wake word detection services. The m_agent custom conversation agent routes all voice commands to n8n via a local webhook, enabling Ollama-powered responses on Atlas.

The HA MCP Server (ha-mcp v7.0.0, 89 tools) runs via uvx stdio and exposes the full Home Assistant API — entities, services, automations, history — to Claude as an AI tool. This makes HA controllable directly from AI sessions.

18 custom components extend the base HA installation.

ComponentPurpose
adaptive_lightingCircadian lighting automation (garage)
alarmoAlarm system
battery_notesBattery level tracking across devices
chime_ttsAdvanced TTS with chime support
dyson_localDyson PH04 air purifier via local API
hacsCommunity component store
huesyncboxHue Sync Box control
icloud3Apple device presence tracking (v3)
llmvisionLLM-based camera image analysis
m_agentCustom conversation agent (n8n webhook routing)
midea_ac_lanMidea AC local LAN control
powercalcPower consumption calculation and tracking
spook / spook_inverseExtended services and virtual entities
thermal_comfortThermal comfort index calculations
tuya_localBlissLights local control (no cloud)
watchmanEntity and service reference auditing

30+ YAML automations across four functional areas.

The data bridge pattern is the backbone of the home-to-database pipeline. 8 automations push HA state changes as events to n8n webhooks, which write them to the ha.events PostgreSQL table for analysis and dashboarding.

AutomationEvents Captured
bridge_automation_logAll automation trigger events
bridge_light_changesLight on/off state changes (6 rooms)
bridge_plug_changesSmart plug state changes (3 TP-Link strips)
bridge_litter_robotCleaning cycles and waste drawer state
bridge_climate_changesHVAC mode and temperature changes
bridge_media_changesSonos play/pause/idle across 3 speakers
bridge_presence_changesZone transitions for person and device trackers
bridge_weather_changesWeather condition state changes

7 automations handle the garage environment as a complete system: PIR motion turns lights on (using adaptive lighting or the last saved scene), occupancy clearing turns them off, a 4-hour overnight reset catches manual overrides, and scene tracking saves the active Hue scene to an input helper so it can be restored later. A voice-triggered “chill vibes” automation applies mood lighting on demand.

Two automations automate Spotify handoff: entering the garage transfers playback to the MacBook Pro; leaving the garage pauses it.

NAS power management includes a daily evening pre-wake, idle shutdown checks, and event bridges for online/offline transitions. nightwatch power management handles the 5-minute idle suspend, the wake-on-satellite pre-wake trigger, and the keep-alive override for extended voice sessions.

The push_voice_interaction automation sends satellite state-change data to the n8n voice interaction webhook, storing the full dialogue in voice_interactions and dialogue PostgreSQL tables for history.

The wake_time_from_shortcut automation receives the wake time from an iOS Shortcut and computes the sunrise ramp start time. The good_morning automation fires at that time: stairway and bathroom lights on, Dyson night mode off.

HA events flow to n8n via two REST command endpoints:

  • push_ha_event — all 8 bridge event types
  • push_voice_interaction — satellite voice dialogue

All requests are authenticated with a shared webhook key. n8n workflows receive the events and write them to the appropriate PostgreSQL tables. This architecture keeps HA responsible for capturing physical-world state and n8n responsible for processing and persisting it.

A custom Lovelace dashboard at /lovelace-home provides a rich at-a-glance home interface. It uses 65+ cards across 7 sections styled with the Catppuccin theme. HACS frontend components used include adaptive_lighting, huesyncbox, spook, and powercalc.

Two built-in intents extend HA’s voice assistant:

  • AnnounceOnSpeaker — “say [message] on the [room] speaker” routes audio to the correct Sonos via a media_player.play_media workaround for a known TTS bug
  • RestoreScene — “restore scene in [room]” reads the saved input_text helper and re-applies the last active Hue scene

Custom sentence files in ha-config/custom_sentences/en/ define the intent patterns.

YAML-defined helpers coordinate automation state without requiring UI configuration.

TypeHelpers
input_booleangarage_manual_override, nas_trip_mode, nightwatch_keep_alive, nightwatch_wake_requested
input_datetimegarage_override_cleared_at, nightwatch_last_active, nas_last_active, wake_time, sunrise_ramp_start
input_textgarage_last_scene, bedroom_last_scene, office_last_scene, living_room_last_scene
input_numbergarage_last_brightness, garage_last_color_temp