Axel Verne → Junk Drawer kit → Chapter 14

Chapter 14 — The Oracle II: Let the AI Run the Lab

6 blocks to copy, in the order they appear in the chapter. Nothing here is required to be typed by hand.

Step 1: Install Home Assistant

14.1 · bash
mkdir -p /srv/lab/compose/homeassistant && cd /srv/lab/compose/homeassistant
14.2 · yaml
services:
  homeassistant:
    image: ghcr.io/home-assistant/home-assistant:latest
    container_name: homeassistant
    ports:
      - "8123:8123"
    environment:
      TZ: "Pacific/Honolulu"
    volumes:
      - /srv/lab/data/homeassistant:/config
      # Allow access to Zigbee/Z-Wave USB sticks
      - /dev/ttyUSB0:/dev/ttyUSB0:ro
      # Or for Zigbee on ConBee:
      # - /dev/ttyACM0:/dev/ttyACM0:ro
    network_mode: host  # HA needs this for mDNS and some automations
    restart: unless-stopped
14.3 · bash
docker compose up -d
docker compose logs -f  # wait for "INFO (MainThread) [homeassistant.runner]" then Ctrl-C

Step 5: Wire the AI client to Home Assistant

14.4 · json
{
  "mcpServers": {
    "Home Assistant": {
      "command": "mcp-proxy",
      "args": [
        "--transport=streamablehttp",
        "--stateless",
        "http://homeassistant.local:8123/api/mcp"
      ],
      "env": {
        "API_ACCESS_TOKEN": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
      }
    }
  }
}
14.5 · bash
claude mcp add-json "HA" '{
  "type": "http",
  "url": "http://homeassistant.local:8123/api/mcp",
  "oauth": {
    "clientId": "http://localhost:12345",
    "callbackPort": 12345
  }
}'

Step 7: Your first conversation

14.6 · text
Your Home Assistant instance has these integrations:
- Home Assistant Cloud (cloud)
- Pi-hole (pi_hole) - 12,543 queries blocked today
- Immich (integration_example) - 14 photos synced
- Zigbee (zha) - 8 devices paired: 1 bulb, 3 motion sensors, 2 locks...

Currently active automations: 3
Last backup: 2 hours ago, 450 MB

← Chapter 13Chapter 15 →

Get the next build in your inbox

An email when a new build write-up goes up: what I ran, on what hardware, and the commands that paste. Free, unsubscribe any time. The kit stays free either way.