Inne · Integracja z narzędziem
scene
/scene
Odczytuje, tworzy, zmienia i usuwa sceny Home Assistant w magazynie przez HA NOVA Relay.
- Autor
- markusleben ↗
- Repozytorium
- ha-nova ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 27.10.2026
Ocena i bezpieczeństwo
100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Przestarzałość
Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.
Licencja
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Odczytuje, tworzy, zmienia i usuwa sceny Home Assistant w magazynie przez HA NOVA Relay.
Oryginalny opis (EN)
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.
Jak działa
- Scope
- Bootstrap (once per session)
- Relay Contract
- Editability Guard (critical)
- Flow
- Error Handling
- Output Format
- Safety
Sekcje z nagłówków SKILL.md, w oryginale · 134 linii, 1 847 słów
Podgląd SKILL.md
---
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`.
Verify relay CLI: `ha-nova relay health`
If this fails: `ha-nova setup`
## 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 context skill → 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/best-practices.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. 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. When the confirmed update REMOVES scene members, capture the auto config snapshot first (`../ha-nova/config-snapshots.md`; on capture failure follow its capture-failure stop).
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. Require the one-time code — mint four random digits, display them in the Options slot, and proceed only on a reply that is just the code (spaces ignored). Deleting several storage scenes at once follows `../ha-nova/batch-safety.md` (Editability Guard per target).
4. Capture the auto config snapshot of the current config first (`../ha-nova/config-snapshots.md`; on capture failure follow its capture-failure stop).
5. `ha-nova relay core --method DELETE --path /api/config/scene/config/<id>`
6. 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
- Preview before write. The only exception is a call that `ha-nova call` itself executed as `tier: ordinary`; everything else waits for the user's confirmation of the shown preview. High-consequence actions (e.g. unlocking or opening a lock, opening a gate, garage, or entry door, disarming the alarm — also through a scene or script) and deletes or other destructive operations need the user's window click or phone tap, else their one-time code from HA NOVA; "yes" or any other reply is invalid.
- Confirmation binds to the displayed preview; any target, payload, endpoint, or scope change voids it (context skill → Active Preview Confirmation).
- Relay a plan's `say` in full, localized; never drop or shorten sentences.
- Anything before the preview ("do it", answers to questions) never confirms it; only a reply to the preview does.
- Never guess entity, service, or config IDs — resolve them or ask.
- Home Assistant is reached exclusively through the `ha-nova` CLI.
- Any HA write this skill does not cover: STOP, invoke `ha-nova:fallback` first; never probe unfamiliar write endpoints.
- Create/update use natural confirmation after preview; delete uses the one-time code only, 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, OFFER an apply-test: one Test-Plan-style card (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 context skill's high-consequence tier — the single card confirmation never replaces it.
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · markusleben/ha-nova | 100 | MIT |
| melodic-software/claude-code-plugins | 84 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki 1b6d4b54d493 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 1 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100calendar
Wyświetla, odczytuje, tworzy, aktualizuje i usuwa wydarzenia kalendarza Home Assistant przez HA NOVA Relay. - 90write
Tworzy, zmienia i usuwa automatyzacje oraz skrypty Home Assistant, a także zapisuje i uruchamia blueprinty przez HA NOVA Relay. - 100home-assistant
Steruje urządzeniami smart home w Home Assistant, uruchamia automatyzacje i odbiera zdarzenia przez REST API oraz webhooki z automatyzacji HA. - 90ambience-author
Pisze i diagnozuje sceny Ambience dla Home Assistant na podstawie opisu: warunki, grupy scen i akcje, w formie bloku importu. - 100home-assistant-best-practices
Dobiera wzorce automatyzacji, helperów, sterowania urządzeniami i dashboardów Home Assistant przy projektowaniu konfiguracji, refaktoryzacji i aplikacjach AppDaemon. - 90scene-analysis
Analizuje sceny w scenariuszu filmowym: budowę, rytm, tempo i pytanie, co się zmienia, by wskazać zbędne lub słabe sceny.