# Home Assistant instances managed as config-as-code.
# Schema and adapter rationale: see DESIGN.md ("Deploy path: adapter per instance").
# This file is read by scripts/ha/import.sh — do not add secrets/tokens here,
# only the path to where each instance's token is expected on disk.

instances:
  # Cutover 2026-07-22: repo previously pointed "ken" at the piha container
  # (homeassistant5), but that container is a pre-migration legacy instance
  # that kept running and firing automations in parallel with the real home
  # instance below. See DESIGN.md, "Incident log" for the full writeup.
  ken:
    host: ken-haos
    adapter: api
    base_url: "http://192.168.31.7:8123"
    token_path: ~/.config/ha-deploy/ken.token
    status: active
    site: ken
    # Confirmed 2026-07-22: Home Assistant OS on a dedicated RPi4, LAN
    # 192.168.31.7:8123, ingress ha.kapala.org via NPM. HACS installed,
    # 118 automations. HAOS has no SSH access, so there is no
    # docker-exec/filesystem path here — full `/config` import is deferred
    # until an alternative access path exists. For now import.sh's scope
    # for this instance is whatever the api adapter can reach: automations,
    # scripts, scenes, dashboards.

  ken-legacy:
    host: piha
    container: homeassistant5
    config_mount: /home/pi/homeassistant/config
    adapter: docker-exec
    ssh:
      user: oskar
      host: piha
    token_path: ~/.config/ha-deploy/ken-legacy.token
    base_url: "http://localhost:8123"  # confirmed 2026-07-22
    status: archived
    site: ken
    # Pre-migration instance (HA 2026.4.3, location_name "KEN"), superseded
    # by `ken` above (192.168.31.7). Still alive and MQTT-connected as of
    # 2026-07-22 — being wound down, not deleted yet. Import is
    # archival-only (historical reference); this instance is NEVER a deploy
    # target. See DESIGN.md, "Incident log".

  chelsty-ha:
    host: chelsty-ha
    tailscale_ip: 100.70.180.90
    adapter: api
    base_url: "http://100.70.180.90:8123"
    token_path: ~/.config/ha-deploy/chelsty-ha.token
    status: offline
    site: chelsty
