HA NOVA Dashboard
Scope
- list dashboards
- inspect the current dashboard structure: views, cards, badges, custom card types
- broken-card sweep over every dashboard (read-only)
- build a whole dashboard or view; add, reorder, and delete views; add, update, move, and delete cards; configure installed custom cards; set a view theme
- create a new storage dashboard shell, with content or a strategy config
- update dashboard metadata
- list Lovelace resources; create, update, and delete Lovelace resources
- delete an existing storage dashboard, and restore it from its config snapshot
Writes go only to mode: storage dashboards. A yaml dashboard is read-only here: say that its config lives in a YAML file (ha-nova:yaml-config) and offer a storage copy (a new dashboard with that content).
Not in scope: energy dashboard preferences (ha-nova:energy), installing a custom card (ha-nova:hacs), screenshots through the Relay (a client's own browser may look).
Bootstrap (once per session)
Read and follow ../ha-nova/session-bootstrap.md.
Relay Contract
Dashboard content goes through typed verbs only:
- Read:
ha-nova get --dashboards(every dashboard:url_path,title,mode, counts,issues— the sweep);ha-nova get --dashboard <url_path>(layoutcard list,custom_types→ the resource that provides each,resources,issues); add--configfor the full config (.result.dashboards[0].config). - Plan (read-only):
ha-nova plan write --domain dashboard --id <url_path> --base <config_digest> --file <config.json>(--base= theconfig_digestof the read the draft starts from); a new dashboard takes--create --title "<title>" [--icon mdi:<name>] [--require-admin] [--hide-sidebar]instead of--base(theurl_pathneeds a hyphen);ha-nova plan delete --domain dashboard --id <url_path>;ha-nova plan revert [--target <url_path> --domain dashboard]. - Execute:
ha-nova apply [--confirm <code>] --plan <id> [--no-snapshot].
Metadata, resources, and themes: reads through ha-nova relay ws --data-file <payload-file>, writes only as ha-nova plan raw items:
lovelace/dashboards/updatewithdashboard_id(lovelace/dashboards/listis the source of truth:dashboard_idforlovelace/dashboards/update|delete,url_pathforlovelace/config|save)lovelace/resources;lovelace/resources/create,lovelace/resources/update,lovelace/resources/deletefrontend/get_themes(read)
Never send lovelace/config/save, lovelace/dashboards/create, or lovelace/dashboards/delete by hand: the plan does. Shape: {"type":"lovelace/config/save","url_path":"<url_path>","config":{"views":[...]}} — the whole document goes under config, and whatever the draft leaves out is gone. The default dashboard is --id lovelace; the CLI omits url_path when it is not listed.
Flow
Drafts follow ../ha-nova/smallest-solution.md: the complete requested outcome in the simplest safe design, nothing speculative.
- Resolve:
ha-nova get --dashboards; matchurl_pathor title; ask one blocking question only if more than one still matches.mode: empty= no stored config yet (a new shell, or the auto-generated default). - Inspect (existing only; a new one drafts from
{}or a strategy):ha-nova get --dashboard <url_path> --config; saveconfigto a client-private scratch file as the draft basis and keep itsconfig_digestfor--base. jq filters null-guard absent keys:(.views // [])[], never bare.views[]; same for.cards,.sections,.badges. - Draft the WHOLE config (base = current, overlay = the change; unrelated views and cards stay byte-for-byte):
- Whole dashboard or view: a
sectionsview per floor or area (config/floor_registry/list,config/area_registry/list), aheadingcard first in each section, built-intilecards; mobile-first: most-used controls first, about 8 cards per section at most, no wide horizontal stacks. - Built-in cards: any type documented on home-assistant.io/dashboards, with options from that card's page only. Template-capable fields (Markdown
content) run the Render Loop (../ha-nova/template-guidelines.md) before the preview. - Custom cards: only a
custom:type whose resource is installed (custom_types/resourcesinget --dashboard). Never invent its options: read its documentation first (ha-nova:hacsrepository info or the card's README) or copy the shape of its existing usage in the user's dashboards. Not installed: say so and offerha-nova:hacs;card_modkeys only when card-mod is installed. - Strategy:
{"strategy":{"type":"areas"}}or{"strategy":{"type":"original-states"}}as the ENTIRE config — Home Assistant generates all views and cards at render time. Switching a populated dashboard TO a strategy discards its stored views: name that in the preview. - View
theme: only a name fromfrontend/get_themes. - Resolve every entity with
ha-nova find; never guess an id. The card fits the device:climate→thermostat; other controllable devices → atilewith their main controlfeatures(light-brightness,cover-open-close).
- Plan:
ha-nova plan write …. Exit 3 is normal (plan.confirmnatural). Exit 4:UNKNOWN_ENTITY→ resolve and fix the draft;DASHBOARD_NOT_STORAGE→ read-only, explain;CONFIG_ID_IN_USEon a create → first check whether an earlier apply created it (then never create another), else anotherurl_path. Exit 2PLAN_DRIFT→ the dashboard changed since that read (an edit in the UI): read again, re-merge, plan again. Exit 5NOT_FOUND→ its candidates. - Preview: the plan's
diffrows verbatim in the Changes slot, plus a plain-language behavior line (write-safety → Behavior narrative) that names every removed view and card. Name eachresult.issuesentry withnew: true: a newcard_type_unconfirmedcard blocks the save until the user confirms it is installed; say a disabled entity plainly. Say: a dashboard editor left open in Home Assistant would write its old copy back — close it first. Close the card with the plan'ssay. - Confirm: the CLI decides —
plan.confirmnone → apply; natural → show the preview and wait for the user's reply; code → followsay/next_step(window, phone, form, or chat code), never a menu. - Apply:
ha-nova apply --plan <id>(aplan.code:--confirm <the user's exact text>before--plan). Apply re-reads the live dashboard first, and again right before the save: exit 2 means it changed since the preview — nothing was saved; read it again, re-merge, re-preview. Exit 6CONFIG_REJECTED: relaysay, then follownext. Exit 7: unknown; never retry.SNAPSHOT_FAILEDsaved nothing: offer pruning the snapshot store, a full safety backup (ha-nova:backup), or proceeding without one; only after the user picks the last,apply [--confirm <code>] --plan <id> --no-snapshot(--confirmonly with aplan.code). - Result:
verified= the read-back equals the plan (a create: also listed; a delete: no longer listed).undoorsnapshot, and no way back insay: say it can be undone; offerrevertfor an update. A create is cleaned up through the delete flow. A deleted dashboard restores from its snapshot (../ha-nova/config-snapshots.md) by the delete result'srestore(a--createwith the shell's title and flags; the mainlovelacedashboard: a plain write) — thedashboard_idis new. - Broken-card sweep:
ha-nova get --dashboards; report per dashboard eachmissing_entity(with itsdetail) andcard_type_unconfirmed(no installed resource seems to provide it — missing, or loaded another way, e.g.extra_module_url). Nothing found: "No broken cards found in <n> dashboards." Fixes: one dashboard at a time, steps 2–8. - Metadata update: preview the exact fields and the plan's
say, confirm, then apply; only send changed metadata fields supported there:title,icon,show_in_sidebar,require_admin; do not resendurl_path,mode, or unrelated config fields in the update payload. Verify throughlovelace/dashboards/list. - Resources: create/update previews
res_typeandurl(third-party code in every signed-in browser, with its user's rights), delete the exact resource (resource_id); each plan asks; verify vialovelace/resources. - Several changes in one dashboard are ONE draft and one plan; a card batch within one dashboard executes as ONE merged
lovelace/config/save. Dashboards delete one at a time (aplan deletecode binds one); resource batches follow../ha-nova/batch-safety.md. An entity reference on an existing dashboard may join a non-destructive grouped change set ONLY as the downstream operation of a dependency-bound set (../ha-nova/grouped-change-set.md→ Dependency-Bound Outputs); a dashboard-card removal may join a cross-family destructive cleanup only through its manifest (grouped-change-set.md→ Cross-Family Destructive Cleanup). - Verification fails: stop, report the mismatch; never retry by guessing.
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).
For list/read/sweep:
DashboardTargetSummary- relevant inventory or issue excerpt only
Use stable localized slot labels in this order; omit empty slots, do not invent ad-hoc headings. List/read renders the Report shape; dashboard and resource inventories render the List Frame (output-cards.md).
Never dump the full dashboard config unasked.
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.
- No guessed
url_pathordashboard_idvalues. - Dashboard and resource delete keeps its full confirmation, even for items created earlier in the same session. Removing views or cards inside a save is previewed (natural confirmation) because every save is recoverable:
ha-nova applytakes an auto config snapshot first, andrevertundoes the last verified save. Dashboard deletes restore partially from their snapshot; resources recover via Home Assistant Backups. - A broad re-layout instead of a targeted edit: say so before writing.
Guardrails
- Never use
lovelace/infoto decide whether a dashboard is writable. - Never use
lovelace/config/deleteas the dashboard delete path. - Never probe a different dashboard's config to infer the target's mode or structure; reading other dashboards for a custom card's existing usage is fine.
- If the target stays ambiguous after one clarification, stop and explain.