homelab-codex-ws/services/home-assistant
oskar 970b8cc023 feat(ha): archival import of ken-legacy config
Read-only import of the pre-migration homeassistant5 container (piha),
per DESIGN.md phase-0 scope: 60 automations (split one-file-per-id),
5 scenes, 1 script, plus curated .storage/* export (area/entity
registries, input_boolean/input_text, lovelace dashboards).

No token at ~/.config/ha-deploy/ken-legacy.token — fixtures step
fail-softed as designed, no repo import.sh changes needed. Verified:
gitignore-excluded paths (secrets.yaml, *.db*, logs, .storage/auth*,
core.restore_state, tts/, deps/, backups/, .cloud/) correctly stripped
from the pull; three consecutive import.sh runs produced byte-identical
output under config/ken-legacy/ and storage-export/ken-legacy/
(idempotent); automation count matches the 2026-07-22 recon estimate
(~60) exactly. README.md only touched to note the import date.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-22 16:49:09 +02:00
..
config feat(ha): archival import of ken-legacy config 2026-07-22 16:49:09 +02:00
fixtures feat(ha): skeleton for Home Assistant configs-as-code subproject 2026-07-21 15:29:39 +02:00
storage-export feat(ha): archival import of ken-legacy config 2026-07-22 16:49:09 +02:00
.gitignore feat(ha): skeleton for Home Assistant configs-as-code subproject 2026-07-21 15:29:39 +02:00
DESIGN.md feat(ha): cutover ken to 31.7 HAOS, archive legacy container instance 2026-07-22 16:17:18 +02:00
instances.yaml feat(ha): cutover ken to 31.7 HAOS, archive legacy container instance 2026-07-22 16:17:18 +02:00
README.md feat(ha): cutover ken to 31.7 HAOS, archive legacy container instance 2026-07-22 16:17:18 +02:00

home-assistant (configs-as-code)

Status: skeleton. Structure and read-only import tooling only — no deploy path exists yet. See DESIGN.md for the full phasing, adapter, sync, and validation model, and for the open questions still blocking phase 2/3.

Layout

services/home-assistant/
├── DESIGN.md              # decision registry — read this first
├── instances.yaml         # per-instance adapter/host/token config
├── .gitignore             # excludes secrets/db/log/token paths from every import
├── config/<instance>/     # canonical, normalized /config mirror per instance
├── storage-export/<instance>/  # curated .storage/* export (registries, dashboards)
└── fixtures/              # dated /api/states snapshots

Instances: ken (RPi4/HAOS, LAN 192.168.31.7, api adapter — canonical home instance since the 2026-07-22 cutover), ken-legacy (PIHA, container homeassistant5, docker-exec adapter, archived — pre-migration instance, import only, never deploy), chelsty-ha (Tailscale, api adapter — see instances.yaml and DESIGN.md "Incident log").

Import

scripts/ha/import.sh ken

Read-only: pulls /config from the instance, filters it through .gitignore, normalizes and splits it into config/ken/, exports curated .storage/* into storage-export/ken/, and (if a deploy token exists at ~/.config/ha-deploy/ken.token) writes a dated /api/states fixture. Idempotent — re-running against an unchanged instance produces no diff.

Only the docker-exec adapter is implemented; running import.sh chelsty-ha today exits with a clear "not implemented" error (its api adapter is out of scope for this skeleton).

Tests

scripts/ha/tests/test_split_normalize.sh

Offline determinism check for the split+normalize pipeline — no network, no HA instance required.