Skip to main content

Home Assistant (Home Automation)

What this is

Self-hosted home automation platform used to control and automate devices across the network.


Why I set this up

To centralise control of smart home devices and enable automation (lighting, sensors, integrations, etc.).


Where it runs

  • Host: micropc

  • Network: Host mode (required for discovery features)

  • Access (local): http://192.168.86.100:8123

  • External access: Reverse proxy (secured via Cloudflare Tunnel)


Docker Compose

services:
  homeassistant:
    image: ghcr.io/home-assistant/home-assistant:stable
    container_name: homeassistant
    network_mode: host

    environment:
      - TZ=America/Santo_Domingo

    volumes:
      - /opt/docker/homeassistant/config:/config

    restart: unless-stopped

    labels:
      - diun.enable=true

Key Configuration Notes

Network

  • Uses network_mode: host

  • Required for:

    • mDNS discovery (e.g. ESPHome devices)

    • UPnP / local integrations

  • Without this, many devices will not auto-discover


Storage

  • /opt/docker/homeassistant/config → all configuration and data

  • Contains:

    • configuration.yaml

    • automations

    • integrations

    • database


Integrations

  • Works with:

    • ESPHome

    • MQTT (if configured)

    • Various smart home devices


Timezone

  • Set via:

    TZ=America/Santo_Domingo
    
  • Ensures correct scheduling for automations


Setup Steps

  1. Create config directory:

    /opt/docker/homeassistant/config
    
  2. Start container:

    docker compose up -d
    
  3. Open web UI:

    http://192.168.86.100:8123
    
  4. Complete onboarding in browser


Problems / Fixes

Devices not discovered

  • Cause: not using host networking

  • Fix:

    • Ensure network_mode: host is set


Cannot connect to ESPHome

  • Ensure both:

    • ESPHome and Home Assistant are on same network

    • mDNS is working


Slow performance

  • Check:

    • CPU usage

    • Number of integrations

  • Consider moving database or tuning recorder settings


Container restarts or crashes

  • Check logs via Dozzle

  • Common causes:

    • Corrupt config

    • Integration issues


Result

  • Centralised home automation system

  • Device discovery working via host networking

  • Stable operation with Docker Compose


Notes

  • Requires host networking for full functionality

  • Core service in homelab setup

  • Frequently updated → monitor via DIUN

  • Logs monitored via Dozzle