Helper

From markusleben/ha-nova · View interactive version

Helper is an AI agent skill from the GitHub repository markusleben/ha-nova. Use when creating, updating, deleting, or listing Home Assistant helpers — timers, counters, toggles, dropdowns, text and number inputs, schedules, plus template, threshold, utility-meter and other config-entry helpers — through HA NOVA Relay.

How to use this skill

Skill file

HA NOVA Helper

Scope

ha-nova:helper has two helper families:

Not handled here:

Bootstrap (once per session)

Read and follow ../ha-nova/session-bootstrap.md.

Relay Contract

Write payloads with the client's native file-writing tool, then use:

Family-specific transport:

Flow

Drafts follow ../ha-nova/smallest-solution.md: the complete requested outcome in the simplest safe design — never an extra helper, option, or abstraction it does not need.

Family 1: Storage-based helpers

Listing helpers

Use the compact entity registry (abbreviated keys: ei = entity_id, en = name, ai = area_id).

Create <payload-file> with {"type":"config/entity_registry/list_for_display"}, then run:

ha-nova relay ws --data-file <payload-file> --jq-file <filter-file>

Write <filter-file> with:

[.data.entities[] | (.ei | split(".")[0]) as $domain | select(["input_boolean","input_number","input_text","input_select","input_datetime","input_button","counter","timer","schedule"] | index($domain)) | {entity_id: .ei, name: .en, area_id: .ai}]
| {total: length, shown: (.[0:30] | length), omitted: ([length - 30, 0] | max), truncated: (length > 30), matches: .[0:30]}

If user filters by type, narrow the domain filter to that single storage-based domain.

Keyword search
ha-nova relay ws --data-file <payload-file> --jq-file <filter-file>

Write <filter-file> with:

[.data.entities[] | (.ei | split(".")[0]) as $domain | select(["input_boolean","input_number","input_text","input_select","input_datetime","input_button","counter","timer","schedule"] | index($domain)) | select((.ei + " " + (.en // "")) | test("KEYWORD";"i")) | {entity_id: .ei, name: .en, area_id: .ai}]
| {total: length, shown: (.[0:20] | length), omitted: ([length - 20, 0] | max), truncated: (length > 20), matches: .[0:20]}

If 0 results: try synonyms or shorter stems. Never dump entire domains.

While truncated is true the list proves neither absence nor uniqueness — narrow further until it is false; the counts are exact, the cap trims display only.

Reading a single helper
  1. Determine type from entity_id domain prefix.
  2. Fetch full config via type-specific list:

```text

ha-nova relay ws --data-file <payload-file> --jq-file <filter-file>

```

Write <filter-file> with:

```jq

[.data[] | select(.name | test("KEYWORD";"i"))]

```

  1. No single-item read endpoint — always {type}/list + filter.
Creating a helper
  1. Validate intent against ../ha-nova/helper-schemas.md for required/optional fields. Validate cross-field constraints pre-write too, instead of leaving them to the post-write review: input_number min < max; counter minimum < maximum; input_select initial must be in options; input_datetime needs has_date and/or has_time; timer duration in HH:MM:SS. Fix or ask before writing.
  2. Use-case defaults (create only, skip on update/delete):

```

Suggested defaults for "{name}" ({type}), included:

1. min: 16, max: 30, step: 0.5

2. unit_of_measurement: "°C"

3. mode: slider

4. icon: mdi:thermometer

Saving keeps them; say a number to drop one (e.g. "not 2").

```

  1. Preview the payload with the shared write-preview shape: compact summary, pre-write check when applicable, explicit not-saved-yet line, and the save question: the plan's say.
  2. End the turn with this preview; only the user's reply to it confirms, never the request (../ha-nova/confirmation.md → Active Preview Confirmation).
  1. Execute: ha-nova apply --plan <id>.
  2. Verify — list back and confirm new item exists.
  3. No reload needed: immediate effect.
  4. Run storage-family post-write review (see below).
Updating a helper
  1. Resolve target from {type}/list by name or internal id.
  2. Extract id from the list response (this is the {type}_id for the update command).
  3. Validate the merged current+proposed fields against the same cross-field constraints as create (Creating step 1) — an update can break min/max, minimum/maximum, initial ∈ options, or datetime/timer constraints just as easily. Then preview current vs proposed in the Changes slot with ha-nova diff (see ../ha-nova/write-safety.md → Pre-Write Diff) plus the behavior narrative (write-safety → Behavior narrative) — a count-only diff row never stands alone. Then run a pre-write impact check — search/related on this helper entity (max 3 related configs) — and surface affected automations/scripts as an advisory. Advisory only; never block. Include an explicit not-saved-yet line and the save question: the plan's say. REMOVING input_select options or schedule blocks (moved or changed too) puts the auto config snapshot first.
  4. End the turn with this preview; only the user's reply to it confirms (../ha-nova/confirmation.md → Active Preview Confirmation).
  5. If the conversation paused since the preview, re-read the list item; a changed basis expires the confirmation (write-safety.md → Drift check before apply).
  6. Execute: ha-nova apply --plan <id>.
  7. Verify by re-reading the same list item.
  8. Run storage-family post-write review (see below).
  9. Update-Revert: apply saved the checkpoint (repeat its undo receipt); offer revert unless its say already names the way back — see ../ha-nova/write-safety.md → Update-Revert. Storage-family restore rebuilds a schema-valid {type}/update from before_config (typed {type}_id from its id + writable fields only — never the raw list item, which lacks {type}_id and carries read-only id/entity_id); expected_after is the post-update read-back.
Deleting a helper
  1. Resolve target from {type}/list; extract its id (the {type}_id used for the delete call — internal, not shown to the user).
  2. Preview with stable localized slots (see ../ha-nova/write-safety.md → Output hygiene — no raw internal id):
  1. Capture the auto config snapshot of the current list item first, as the leading backups save (../ha-nova/config-snapshots.md) of one ha-nova plan raw --file <requests.json>, then {"endpoint":"ws","payload":{"type":"{type}/delete","{type}_id":"<id>"}}; its say asks. Say in the result that a recreate from it mints a new entity_id.
  2. ha-nova apply per its next_step.
  3. Verify absence from {type}/list.
  4. Run storage-family post-write review (see below).

Family 2: Config-entry helpers

Canonical config-entry helper item:

entry_id is the canonical identity for config-entry helper writes.

If the user gives only a linked entity_id, resolve it back to config_entry_id through the full entity registry before continuing.

Config-entry flow orchestration follows the shared contract in ../ha-nova/live-schema-preflight.md: live-form previews, non-persisting pre-confirmation navigation only, stop before the terminal submit, and nested result.entry_id extraction.

Supported domains

Use the sixteen config-entry domains listed in Scope for every operation.

Listing helpers
  1. Read all config entries:

```text

ha-nova relay ws --data-file <payload-file> --out <entries-file>

```

with {"type":"config_entries/get"}.

  1. Read full entity registry:

```text

ha-nova relay ws --data-file <payload-file> --out <registry-file>

```

with {"type":"config/entity_registry/list"}.

  1. Filter config entries to the sixteen supported domains in Scope.
  2. Join linked entities by matching config_entry_id.
  3. Present the List Frame table (output-cards.md): title, type, state. Options-flow support and linked entities stay in the per-helper

detail read; when several entries share a domain or similar titles, add a

short disambiguation line under the table with each candidate's linked

entities (compact comma-separated summary).

Keyword search

Search against:

If multiple matches remain, present max 5 candidates and ask one blocking question.

Reading a single helper
  1. Resolve by one of:
  1. Re-read config_entries/get.
  2. Re-read full entity registry and attach linked_entities[].
  3. If supports_options: true, start an options flow:

```text

ha-nova relay core --method POST --path /api/config/config_entries/options/flow --body-file <start-payload-file>

```

with <start-payload-file> containing {"handler":"<entry_id>","show_advanced_options":false}.

  1. Treat the returned current step as the current editable options snapshot:
  1. If the options flow is unavailable even though the domain is supported:
  1. Present:
**Helper: {title}** ({type})
- **Config-entry state:** {state}
- **Linked entities:** {linked_entities summary}
- **Supports options-flow editing:** {yes/no}
- **Current editable fields:** {field summary from the current options step when available}
Creating a helper
  1. Confirm the requested domain is supported in ../ha-nova/helper-flow-schemas.md.
  1. Prepare the full create plan using ../ha-nova/helper-flow-schemas.md:
  1. Preview with the shared write-preview shape:
  1. Start the flow BEFORE confirming (steps 5-6 below run first; reading a

form step persists nothing — only the terminal submit does), then re-render

the preview from the LIVE form: label every field live-confirmed or

draft-only, and end the turn with that live preview for confirmation

(../ha-nova/confirmation.md → Active Preview Confirmation;

../ha-nova/live-schema-preflight.md). On cancel or expiry, abandon

the transient flow without submitting (DELETE the flow_id).

  1. Start the flow:

```text

ha-nova relay core --method POST --path /api/config/config_entries/flow --body-file <start-payload-file>

```

<start-payload-file> must contain the handler-start body only.

  1. Read the start response and extract flow_id before continuing.
  1. Iterate the flow until terminal success:
  1. Verify at the config-entry layer first: the terminal submit's output carries the CLI's verification. The CLI re-read the entry by the terminal entry_id (built-in integration, loaded), its linked_entities, and, when it supports options, its options (suggested values, null when none) from an options flow it aborted unsubmitted.
  1. Run the whole post-write review before any result (statistics/history_stats: the state-attribute read).
Updating a helper
  1. Resolve the canonical config-entry helper item:
  1. If supports_options is false for this entry:
  1. Start the options flow:

```text

ha-nova relay core --method POST --path /api/config/config_entries/options/flow --body-file <start-payload-file>

```

with <start-payload-file> containing {"handler":"<entry_id>","show_advanced_options":false}.

  1. Read the start response and extract flow_id before continuing.
  1. Capture the current editable options snapshot from the returned form:
  1. Build the update body by merging requested changes over the current options snapshot:
  1. For a threshold helper whose lower, upper, or hysteresis changes against a physical-process sensor — or whose compared entity_id is swapped while boundaries stay — run the calibration preflight per ../ha-nova/threshold-calibration.md first and carry its findings into the preview. Then preview current vs proposed in the Changes slot with ha-nova diff (see ../ha-nova/write-safety.md → Pre-Write Diff) plus the behavior narrative (write-safety → Behavior narrative). Include an explicit not-saved-yet line and the save question.
  2. End the turn with this preview; only the user's reply to it confirms (../ha-nova/confirmation.md → Active Preview Confirmation).
  3. Submit the current step:

```text

ha-nova relay core --method POST --path /api/config/config_entries/options/flow/{flow_id} --body-file <submit-payload-file>

```

  1. If HA returns another form step, the confirmed preview covered only the forms it displayed live: a later form re-previews from its live data_schema and re-confirms before its submit (same rule as creates, ../ha-nova/live-schema-preflight.md); then repeat the merge-and-submit rule until terminal create_entry or explicit failure.
  2. Verify success:
  1. Resolve linked_entities[] as secondary evidence only.
  2. Run config-entry-family post-write review (see below).
Deleting a helper
  1. Resolve target to the canonical config-entry helper item:
  1. Enforce the helper-domain allowlist before any delete:
  1. Preview with stable localized slots:
  1. Run a pre-delete dependency check:
  1. One ha-nova plan raw --file <requests.json> item {"endpoint":"core","payload":{"method":"DELETE","path":"/api/config/config_entries/entry/{entry_id}"}}; its say asks. This still applies to cleanup and helpers created earlier in the same session. Multi-helper deletes within ONE family follow ../ha-nova/batch-safety.md; storage and config-entry families never mix. Deleting a helper together with its consumers (cross-family) — and removing a retired device's entities FROM a config-entry group helper as one item of such a cleanup — follows ../ha-nova/grouped-change-set.md → Cross-Family Destructive Cleanup: one manifest, one code; the group-member removal keeps this skill's own preview, ask, and drift check, and goes first.
  2. ha-nova apply per its next_step.
  3. Verify success at the config-entry layer first:
  1. Entity disappearance is secondary evidence only — do not fail the delete just because registry/state cleanup lags.
  2. Run config-entry-family post-write review (see below).

Post-write review (MANDATORY)

Do NOT report results to user until complete.

Storage-based family
  1. Apply ../review/checks.md → Application (storage family: H-01..H-11; H-11 only when a consuming automation/template is in the thread context).
  2. Apply H-01..H-08 directly to the written helper config.
  3. Only evaluate H-09/H-10 if the collision scan finds a referencing automation/script with a direct helper-backed threshold and you also read live helper state per ../review/checks-extended.md → Helper Threshold Evidence.
  4. Collision scan: search/related for the helper entity, max 3 related automations/scripts.
Config-entry family

Do not pretend H-01..H-11 apply here; H-12/H-13/H-15 apply where the entry's fields are readable, and H-14 when the energy prefs are already loaded in the thread (see checks.md).

Instead, run the minimal config-entry post-write contract:

  1. Verification
  1. Current editable snapshot
  1. Linked entities
  1. Collision check
  1. Advisory

Report only what has substance (same rule as the write flow — see ../write/SKILL.md Phase 4): keep Verification (and the editable snapshot when present), but omit an empty Collision check or Advisory — never an empty "none" bucket. When the write is clean, the verification plus a single scope-honest confirmation line suffices (../ha-nova/write-safety.md → Verification Honesty). Multi-target logical changes: plan first per write-safety → Multi-Target Changes. Non-destructive helper worksets (max 10) may confirm as one grouped change set per ../ha-nova/grouped-change-set.md — the per-step save questions and confirmations then collapse into the group's single final question.

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. Write previews, delete prompts, and results render as the Cards defined there (../ha-nova/output-cards.md). The bold labels in both read templates below are semantic slots — localize them at runtime, never print them as literal English headings.

Storage-based family

After reading a helper config, present:

**Helper: {name}** ({type})
- {type-specific fields}

For list operations, render the List Frame (output-cards.md):

| Name | Type | Area |
|------|------|------|

Config-entry family

After reading a helper config, present:

**Helper: {title}** ({type})
- **Config-entry state:** {state}
- **Linked entities:** {linked_entities}
- **Supports options-flow editing:** {yes/no}
- **Current editable fields:** {field summary from the current options step when available}

For list operations, render the List Frame (output-cards.md; options-flow support and linked entities stay in the per-helper detail read above):

| Title | Type | State |
|-------|------|-------|

Never show raw JSON to the user.

Safety

Guardrails

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.