一键导入
homeassistant-ops
Operate a Home Assistant instance via the official REST/WebSocket APIs and backups, with safe plan/apply workflows for bulk, reviewable changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Operate a Home Assistant instance via the official REST/WebSocket APIs and backups, with safe plan/apply workflows for bulk, reviewable changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Execute deterministic code quality validations as a quality gate for smart-ralph task execution. Runs Layer 3A smoke test (Tier A AST, <1 min), Layer 1 (test execution), Layer 2 (test quality analysis), Layer 3B (Tier B BMAD Party Mode, ~15 min), and Layer 4 (Security & Defense, ~2-5 min). Uses Two-Tier approach: Tier A (AST deterministic) + Tier B (BMAD Party Mode consensus). Layer 4 covers 8 security tools: bandit, safety/pip-audit, gitleaks, semgrep, checkov, deptry, vulture, trivy. Generates a checkpoint JSON consumed by smart-ralph VERIFY steps. Use when you need to validate that code meets quality and security standards before COMMIT.
Create and manage Home Assistant YAML configuration files including automations, scripts, templates, blueprints, Lovelace dashboards, and file organization. Use when working with Home Assistant configuration files (.yaml, .yml) or discussing HA automations, scripts, sensors, or dashboards.
Design, update, and refactor Home Assistant Lovelace dashboards (YAML views/partials) with a constrained, machine-safe design system: button-card-first structure, minimal card-mod styling, optional flex-horseshoe + mini-graph telemetry, strict grid/vertical-stack layout rules, centralized templates, deterministic ordering, and config validation. Use for Home Assistant dashboard work (especially config/dashboards/**), when refactoring views, adding infra/home/energy/environment panels, or translating Stitch design inspiration into safe Lovelace YAML.
Create agent feedback for harness self-improvement. Use after completing complex tasks (>30 min) to document what worked, what failed, and patterns detected. This feeds the continuous improvement loop.
Lossless LLM-optimized compression of source documents. Use when the user requests to 'distill documents' or 'create a distillate'.
Iterative consensus-building skill that runs BMAD Party Mode in loops until agents reach consensus. Each iteration enriches context with previous round findings, project domain knowledge, and relevant evidence. Use when you need multi-agent validation, architectural decisions, technical debates, or any situation where consensus is the goal and isolated opinions are insufficient.
| name | homeassistant-ops |
| description | Operate a Home Assistant instance via the official REST/WebSocket APIs and backups, with safe plan/apply workflows for bulk, reviewable changes. |
Use this skill as the operator's playbook for making bulk, reviewable changes to a Home Assistant instance without SSHing into the host.
Requires Node.js 22+ (uses built-in fetch + WebSocket; no npm deps).
Set environment variables (never pass tokens on the command line):
export HA_URL="http://<home-assistant-host>:8123"
export HA_TOKEN="<long-lived-access-token>"
Run scripts using node:
node scripts/ha_ops.js --help
Keep logs in a working folder (scripts write timestamped .md files by default).
All scripts read HA_URL and HA_TOKEN from environment variables.
ha_ops.js - Single CLI with subcommandsAll operations are available under a single CLI:
# List commands
node scripts/ha_ops.js --help
# Command help
node scripts/ha_ops.js cleanup --help
ha_ops.js cleanup - Bulk cleanup (dry-run by default)# Dry-run all default steps (default)
node scripts/ha_ops.js cleanup
# Apply specific steps
node scripts/ha_ops.js cleanup --apply \
--steps rename-switch-suffix,prefix-lights-cove
# Prefix custom patterns with area names
node scripts/ha_ops.js cleanup --apply \
--steps prefix-generic \
--pattern "Thermometer:^Thermometer" \
--pattern "Blinds:^Blinds"
# Output proposed changes as JSON
node scripts/ha_ops.js cleanup --json
Available steps:
rename-switch-suffix: Rename "Lights ... Switch" to "Lights ..."create-groups: Create/update switch groups for sync automationsprefix-lights-cove: Prefix Lights/Cove names with areaprefix-generic: Prefix entities matching --pattern with areaha_ops.js snapshot - Capture state for diffing# Full snapshot
node scripts/ha_ops.js snapshot
# Skip noisy sections
node scripts/ha_ops.js snapshot \
--no-lovelace --no-scenes
# Include runtime states (noisy for diffs)
node scripts/ha_ops.js snapshot --include-states
ha_ops.js rollback - Revert registry changes from a snapshot# Preview what would be rolled back
node scripts/ha_ops.js rollback \
snapshot_before.json --dry-run
# Apply rollback
node scripts/ha_ops.js rollback \
snapshot_before.json --yes
ha_ops.js find-references - Find entity_id usage# Search for entity references before renaming
node scripts/ha_ops.js find-references \
--needle "switch.bedroom_lights"
# Search from a rename mapping file
node scripts/ha_ops.js find-references \
--map-json rename_map.json --backup-root /path/to/backup
ha_ops.js tail-events - Monitor events in real-time# Tail state changes
node scripts/ha_ops.js tail-events
# Filter to specific entities
node scripts/ha_ops.js tail-events \
--entity switch.bedroom_lights --entity switch.bedroom_lights_2
# Include ZHA events
node scripts/ha_ops.js tail-events \
--event-type state_changed --event-type zha_event
ha_ops.js name-review-from-backup - Offline naming analysis# Analyze backup for naming candidates
node scripts/ha_ops.js name-review-from-backup \
--backup-root /path/to/backup
If a script fails mid-way:
ha_ops.js rollback with your before-snapshot to revert registry changes.references/api.mdreferences/playbook.mdreferences/id_conventions.mdPrefer one markdown log per run (timestamped), listing every entity/automation changed and the before/after values.