Use when listing, reading, creating, updating, or deleting Home Assistant storage scenes through HA NOVA Relay. For activating a scene, use ha-nova:service-call.
20 stars
0 votes
0 copies
4 views
Added October 23, 2026
ai-agentsgoapi
Works with
cli
api
Security analysis
A100/100
Scanned November 26, 2026
$npx -y skills add markusleben/ha-nova --skill scene --agent claude-code
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Scene?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/markusleben-scene)
---
name: scene
description: Use when listing, reading, creating, updating, or deleting Home Assistant storage scenes through HA NOVA Relay. For activating a scene, use ha-nova:service-call.
license: MIT
compatibility: Requires the ha-nova CLI (run 'ha-nova setup' first) and the HA NOVA Relay in Home Assistant (App, or standalone container on Container/Core).
---
# HA NOVA Scene
## Scope
Storage-scene lifecycle:
- list scenes with editability
- read scene configs
- create, update, delete storage scenes (what the HA editor stores in `scenes.yaml`)
Not in scope:
- activating scenes (`scene.turn_on`) — use `ha-nova:service-call`
- integration-owned scenes (Hue, deCONZ, ...) — see Editability Guard below
- `scene.create` runtime snapshots inside automations — owned by `ha-nova:write`
## Bootstrap (once per session)
Read and follow `../ha-nova/session-bootstrap.md`.
## Relay Contract
Use file-based requests:
- `ha-nova relay ws --data-file <payload-file>`
- `ha-nova relay core --method <METHOD> --path <PATH> --body-file <payload-file>`
- `--out <result-file>` for large responses, `--jq-file <filter-file>` for filters
Relay-core response body: `.data.body` (`../ha-nova/relay-api.md` → Standard Envelope).
## Editability Guard (critical)
Only registry `platform: "homeassistant"` scenes are editable through the scene config API. Integration-owned scenes (for example Hue) have no HA-side config — reads return 404 and writes must never be attempted. Resolve the platform BEFORE any config operation:
Create `<payload-file>` with `{"type":"config/entity_registry/get","entity_id":"scene.<slug>"}`, then:
```text
ha-nova relay ws --data-file <payload-file> --out <registry-file>
```
- `platform` must be `homeassistant`; otherwise explain that this scene belongs to an integration and is managed in that integration's own app, then stop.
- `unique_id` is the scene config id for `/api/config/scene/config/<id>` — never use the entity_id slug as the config id.
## Flow
Drafts follow `../ha-nova/smallest-solution.md`: the complete requested outcome in the simplest safe design, nothing speculative.
### List
1. Registry: create `<payload-file>` with `{"type":"config/entity_registry/list"}`, then:
```text
ha-nova relay ws --data-file <payload-file> --jq-file <filter-file> --out <result-file>
```
Write `<filter-file>` with:
```jq
[.data[] | select(.entity_id | startswith("scene.")) | {entity_id, name: (.name // .original_name), platform, editable: (.platform == "homeassistant")}]
```
2. Read `/api/states` and append `scene.*` entities missing from the registry as `editable: false` — YAML scenes without an `id:` have no registry entry and are otherwise invisible to list, search, and the duplicate-name check.
### Read
1. Resolve `unique_id` + platform (Editability Guard).
2. `ha-nova relay core --method GET --path /api/config/scene/config/<unique_id> --out <result-file>`
3. Present name, entities, and captured target states. Flag captured entity_ids missing from the registry (renamed or deleted since capture — the scene then applies partially, silently); offer removal, never preserve or drop silently.
### Create
1. Resolve every entity the scene should capture with `ha-nova find "<phrase>" --aliases` (exact `entity_id` wins; on ambiguity ask one blocking question) — never from raw registry or state dumps. Scenes take actionable domains only (light, switch, cover, climate, fan, media_player, lock, humidifier, stateful `input_*` — never stateless `input_button`, ...); refuse read-only domains (sensor, binary_sensor, ...). If the scene list (List flow, both sources) already has this name, ask before creating a duplicate. Read each entity's state (`ha-nova get <entity_id>`); warn on `unknown`/`unavailable` and omit it unless the user insists.
2. Build the config body — `id` in the body MUST equal the id in the path; use the current epoch-milliseconds string as the new id (HA editor convention; POSIX example `date +%s000`). The POST is an upsert: before creating, GET the id and require a 404 so an existing scene is never silently overwritten.
```json
{"id":"<epoch-ms>","name":"<name>","icon":"mdi:sofa","entities":{"<entity_id>":{"state":"on"}}}
```
`icon` is optional. Entity values are the target states (plus attributes) applied on activation.
3. **Capture attributes deliberately** (the HA editor grabs only state + brightness for lights):
- light that is on: `state`, `brightness`, plus exactly ONE color attribute matching its `color_mode` (`color_temp_kelvin`, `hs_color`, `rgb_color`, `xy_color`, `rgbw_color`, or `rgbww_color`) — never both, mixed color attributes reproduce wrong; an off light exposes no color attributes, capture `state: "off"` only
- prefer individual lights over light groups — group snapshots are a known HA reproduce-state trouble spot
- switch/lock/input_boolean: `state` only
- other domains: `state` plus the attributes scene reproduction actually reads. A scene stores STATE attributes, not service parameters, and the two differ per domain: a cover stores `current_position` / `current_tilt_position` (storing `position` loses a partial target — the cover then just opens fully), while a setpoint domain stores the setpoint itself — climate `hvac_mode` plus whichever setpoint the state actually carries — `temperature` on a single-setpoint thermostat, `target_temp_low` AND `target_temp_high` on one in a range mode; capture both when both are present, or activating the scene restores the mode without either boundary. Climate reproduction also restores `preset_mode`, `fan_mode`, `swing_mode`, `swing_horizontal_mode` and `humidity`, each through its own service — capture every one the state actually carries, or the scene silently leaves the AC on yesterday's Boost preset while the temperature looks right. Humidifier `humidity`/`mode`, fan `percentage`/`preset_mode` plus `oscillating` and `direction` when present — and never its `current_*` sensor twin (`current_temperature`, `current_humidity`); never copy measurement or diagnostic attributes
4. Preview name + full entities map and end the turn with it (see `../ha-nova/confirmation.md` → Active Preview Confirmation). Creates may join a grouped change set (max 10) per `../ha-nova/grouped-change-set.md` — previews stay, one final confirmation.
5. `ha-nova relay core --method POST --path /api/config/scene/config/<id> --body-file <payload-file>`
6. Read back via GET and verify the fields; the config API reloads scenes automatically. Resolve the new entity_id from the registry by matching `unique_id` to the config id (the entity_id derives from `name`, not the id; never guess the slug — the registry can lag the write by a moment, retry once), then confirm it via `/api/states/<entity_id>`.
### Create from current state ("save this room as a scene")
Same as Create, but the entities map IS the live state: read each requested entity's state and copy it (attribute rules from Create step 3). Show captured entities and values before confirming.
Persistence routing per `../ha-nova/automation-patterns.md` → Persistence Model: a stored scene is a static capture that never updates itself; `scene.create` snapshots and automation-driven save → modify → restore cycles hand off to `ha-nova:write` (helpers, not scenes).
### Update
1. Read the current config (Read flow).
2. Merge the requested change in memory — the POST replaces the ENTIRE scene config; never send a partial body and never drop entities the user did not mention.
3. When the update adds or changes a member that assigns a threshold-backing `input_number` consumed by a physical-process `numeric_state`, run the calibration preflight per `../ha-nova/threshold-calibration.md` first. Preview a concise before/after excerpt plus a plain-language line on what changes behaviorally (write-safety → Behavior narrative) — never entity counts alone; end the turn with it. REMOVING members takes one `ha-nova plan raw`, auto config snapshot first: its `say` closes this preview; `apply` replaces step 5's POST. Non-destructive storage-scene worksets (max 10) may confirm as one grouped change set per `../ha-nova/grouped-change-set.md`.
4. If the conversation paused between read and confirmation, re-read and re-verify the merge basis before writing; if the live scene differs from the previewed basis, STOP — confirmation expired; show the updated merge and ask again (never silently overwrite an external edit). Apply the orphaned-member flag from Read step 3.
5. POST the full merged body, then read back and verify both the intended change and the survival of unrelated entities.
### Delete
1. Resolve id + platform (Editability Guard).
2. Consumer check: `{"type":"search/related","item_type":"entity","item_id":"scene.<slug>"}` — read through `../ha-nova/search-related-consumers.jq` (recreate per `../ha-nova/relay-api.md` → Parsing rule on flat-copy installs); show referencing automations/scripts, or an explicit no-consumer result (only a verified-shape empty `data` object means no consumers; a failed read is inconclusive, never a no-consumer claim).
3. Capture the auto config snapshot of the current config first, as the leading `backups` save (`../ha-nova/config-snapshots.md`) of one `ha-nova plan raw --file <requests.json>`, then `{"endpoint":"core","payload":{"method":"DELETE","path":"/api/config/scene/config/<id>"}}`; its `say` asks. Deleting several storage scenes at once follows `../ha-nova/batch-safety.md` (Editability Guard per target).
4. `ha-nova apply` per its `next_step`.
5. Verify absence: config GET returns status 404 and the entity is gone. Mention the snapshot restore path in the result.
## Error Handling
- A scene entity's state is the timestamp of its last activation; `unknown` means "never activated" — not an error.
- Config GET 404 on a `homeassistant`-platform scene: the scene was deleted outside this session — re-list instead of retrying.
- Registry get miss on a live scene entity: a YAML scene without an `id:` — not API-editable; point to `scenes.yaml`.
- POST/DELETE failures: say plainly why, stop; do not retry blind. If every scene config call fails, `scenes.yaml` may be missing from the config includes — point to HA docs.
- Full relay error taxonomy: `../ha-nova/relay-api.md` → Error Handling.
## Output Format
Apply `../ha-nova/output-rules.md`: plain words, HA names verbatim; unless asked or names clash, no ids, "entity", modes, Relay/HA URLs, snapshots, raw JSON. Previews, deletes, and results use the Cards defined there (`../ha-nova/output-cards.md`).
- `Scene`
- `Planned change`
- `Save status` / `Delete status` before confirmation
- `Options` / one-time-code prompt
- `Verification`
- `Next step`
Use stable localized slot labels in this order; omit empty slots. Reads: the Report shape; lists: the List Frame (output-cards.md).
## Safety
- Safety Core: before any write, apply `../ha-nova/safety-core.md`; not yet in this conversation → read it first; unreadable or incomplete → stop and write nothing.
- A delete keeps its full confirmation (the plan's `say`), even for scenes created earlier in the same session.
- Scene writes have no `revert`; recovery is the auto config snapshot (deletes and member-removing updates capture one). Offer a safety backup via `ha-nova:backup` before a delete only when the snapshot store is unavailable (never for routine edits).
- One scene per mutation; verify read-back, not just the save response.
- Activation hands off to `ha-nova:service-call` — `scene.turn_on` supports `transition` (lights only); `scene.apply` applies a one-off state set without storing a scene.
- After a verified create/update, end with the one-line test-preview offer (`../ha-nova/test-run.md` → Closing offer; write Phase 5's exceptions apply); only its yes shows one Test-Plan-style card, and that yes runs nothing (mechanics: `../ha-nova/test-run.md` — name every member device and its target state, single bound confirmation, run via `scene.turn_on`, verify the timestamp advanced plus member states). Say honestly that activation changes real devices and prior states are not restored. members are classified by `../ha-nova/indirect-actuation.md`, not by a list kept here — that gate also covers nested script and scene runs, `template`-platform members, physically irreversible actions, and members whose owning skill already demands the typed tier. Anything it puts on the typed tier keeps its typed confirmation from the high-consequence rung (`../ha-nova/confirmation.md` → Confirmation Tiers) — the single card confirmation never replaces it.