Skip to skill documentation
dotfilesGitHub

platform / skill instructions

homeassistant-ops

Run Home Assistant bulk operations with plan/apply/validate/rollback workflows.

Invoked by user and agentCategory: homeassistant
No how-to guide publishedView SKILL.md ↗

Home Assistant Ops

Use scripts/ha_ops.ts directly. It uses Bun, the exact mise x -- bun --install=fallback shebang, and Crust subcommands.

Safety workflow

  1. Inventory the current state.
  2. Produce an explicit change set.
  3. Run a dry plan.
  4. Apply only after review.
  5. Validate the target behavior.
  6. Keep a timestamped log and rollback mapping.

Set HA_URL and HA_TOKEN in the environment. Never pass tokens on the command line.

./scripts/ha_ops.ts --help
./scripts/ha_ops.ts doctor
./scripts/ha_ops.ts cleanup --help
./scripts/ha_ops.ts snapshot
./scripts/ha_ops.ts validate-record <snapshot.json>
./scripts/ha_ops.ts rollback <snapshot.json> --dry-run
./scripts/ha_ops.ts find-references --needle switch.bedroom_lights
./scripts/ha_ops.ts traces --help
./scripts/ha_ops.ts tail-events --help
./scripts/ha_ops.ts name-review-from-backup --help

cleanup is dry-run by default. Use --apply to mutate Home Assistant. The existing operation groups preserve their plan/apply/validate behavior: cleanup, snapshot, rollback, find-references, traces, tail-events, and name-review-from-backup.

The script requires Bun, Home Assistant access, and the external API/WebSocket services. Bun fallback installation resolves the CLI framework and shared contract validator dependencies. Offline record validation does not require Home Assistant access.

cleanup --json produces homeassistant-cleanup-plan/v2. Validate saved plans with scripts/ha_ops.ts validate-record <plan.json>. The reader accepts historical unversioned plans without rewriting them. JSON planning never applies changes; a saved plan does not grant approval. See references/contracts.md for fields and compatibility.

Resources

  • references/api.md
  • references/playbook.md
  • references/id_conventions.md

Record contracts

Before reading saved snapshots, rename maps or JSON reference reports, read record contracts. Use validate-record <file.json> for offline validation. Snapshot and JSON report creation use new output paths. Historical inputs remain unchanged; no content upgrades are declared.