/ha-nova:entity-discoveryfrom ha-nova
Searches and resolves Home Assistant entities by name, room, or domain via HA NOVA Relay. Provides live state snapshots, averages, and totals across a domain.
Ships in ha-nova. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use for:
prefix, domain, area, or labelRead-only behavior.
POST, PUT, PATCH, or DELETE relay writes. A POST /api/template render is a read.Read and follow ../ha-nova/session-bootstrap.md.
Use file-based relay requests by default:
ha-nova relay ws --data-file <payload-file>ha-nova relay core --method <METHOD> --path <PATH> --body-file <payload-file> when a body is needed--jq-file <filter-file> for non-trivial filters; keep inline --jq for short selectors only--out <result-file> for large reads&& or ||.jq; use relay-native filters or ha-nova relay jq --file <result-file> ....ha-nova findha-nova find "<the user's phrase>" [--domain <d>] [--area <area_id>] [--state <s>] [--limit 20]
ha-nova find --domain <d> [--area <area_id>] [--state <s>]
Every word of the phrase must match the entity_id, name, or area,
case- and accent-insensitive; aliases are read automatically when names miss.
The result carries total (exact), returned, and matches[] with each
match basis (by: name, alias, or state for unregistered).
--aliases (aliases searched even when a name matched): households keep their everyday names there. Only then try synonyms, alternative terms, or shorter words, one find each. When a resolved entity had no matching alias and the user's word was clearly their habitual name, offer once to store it as an alias via ha-nova:organize.--include-disabled when a disabled entity may be the target (it reads the full registry).--server <name> on every command but apply; name a non-default server once per response.ha-nova:service-call travels as its area_id/device_id (--area/--device), never as a list of entity ids you expanded. A device target also reaches its direct child devices (parent_device_id): a named parent qualifies even when only its children act; a named child is targeted alone.returned is below total the result proves neither absence nor uniqueness — narrow (--domain, --area, more words) until total fits before concluding either; report total/shown/omitted with the rows.find matches phrases; prefix, label, and domain-count inventories use the
relay. For bulk selectors, follow ../ha-nova/bulk-patterns.md.
prefix: case-insensitive prefix match on the entity_id suffix and display namedomain: exact domain filterarea: resolve the area, then use search/related as the primary shortlist source; use ai only as optional extra evidence when presentlabel: escalate to the full registry only when label evidence is required; config/entity_registry/list returns the entity array directly in .datahelper + area: not a first-class bulk selector contract; do not imply room-owned helper discovery unless live helper-area semantics are explicitly definedFor domain counts or domain shortlists:
--jq-file <filter-file> for the count filterha-nova relay jq --file <result-file> lengthEntity registry uses compact 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> by copying the canonical ../ha-nova/discovery-filter.jq
and replacing KEYWORD with the pattern; if the canonical file is unavailable
(flat-copy installs), recreate it with exactly:
[.data.entities[] | 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]}
It returns {total, shown, omitted, truncated, matches} — the 20-row cap
applies to matches only; the counts are exact. This generic filter is for free-text search, not explicit prefix matching;
an explicit prefix selector matches the suffix and display name with startswith(...).
Fail closed on truncation: while truncated is true the result proves neither absence nor uniqueness — narrow until truncated is false before concluding either.
Never dump entire domains without a user-intent keyword, and never show an unfiltered full-registry dump.
When the task is multi-target inventory:
--out <result-file>ha-nova getha-nova get <entity_id> # state and attributes
ha-nova get <entity_id> --config # automation/script/scene config, resolved by unique_id, never the slug
ha-nova get <entity_id> --related # search/related for the entity
ha-nova history <entity_id> [--since 24h] [--logbook] # recent changes, summarized
Automations rarely have reliable direct area_id data in the compact registry. When user asks "automations for X in room Y":
ha-nova relay ws --data-file <payload-file> then filter by name with --jq{"type":"search/related","item_type":"area","item_id":"<area_id>"}.data.automation.data.script.data.entitysearch/related on those entities to derive the automation/script shortlist:
ha-nova relay ws --data-file <payload-file>
state (if fetched), short relevance reason; entity_id only for a missing or clashing nameA capability-oriented request (restart, identify, calibrate, reset, siren, ...) on a resolved entity or device, where the capability is not on the resolved entity itself, is answered by the device's OTHER entities — not by "the entity cannot do that":
config/entity_registry/get) and take its device_id; a target already resolved AS a device (a device-registry row or config-entry device) supplies its device_id directly — no entity row is required to proceed.config/entity_registry/list, filter by device_id) — list_for_display omits disabled entities, and the registry row's disabled_by decides enabled/disabled status. NEVER validate a disabled candidate through /api/states: it has no state there, and its absence proves nothing about the capability. The 20-row display envelope does NOT apply: capping could hide the one capability past the cap.device_class, translation_key, and entity_id semantics on the SAME device. An entity on another device never qualifies merely because its name matches.disabled_by source and offer the matching enable flow via ha-nova:organize (a "device"-disabled sibling needs its parent DEVICE re-enabled, not the entity alone; "integration" (off by default) enables like "user"; "config_entry" follows its integration (ha-nova:integration-setup)). Never enable anything automatically, and never press or execute from discovery — hand off to the owning skill.This contract is generic — never hard-coded to a brand, to cameras, or to restart buttons.
"is everything closed?", "who is home?", "what is running right now?" — these ask
about STATE across many entities, not about finding one. They are reads and
belong here; ha-nova:health answers what is broken, not what is on.
An average, total, or highest value right now: computed-answers.md (one template render, read-only).
By domain and state: ha-nova find --domain light --state on (rows carry the current
state); a second find with --state unavailable (and
unknown) fills the third bucket. A
device_class filter needs one raw read, ha-nova relay core --method GET --path /api/states --out <result-file>,
filtered by domain, device_class, and state:
[.data.body[]
| select(.attributes.device_class == "window" and .state == "on")
| {e: .entity_id, n: .attributes.friendly_name}]
Three answers, not two: yes / no / could not tell. An entity that is
unknown or unavailable, and one that is readable but does not report the
thing being asked, both go in the third bucket and get named. "Everything is
closed" with three sensors offline is false reassurance — "none open, 3 could
not be read" is the honest form.
Count group helpers separately: a Light Group is a real light.* entity
beside its members, so it double-counts. find marks one group: true; raw reads
show an attributes.entity_id array.
(switch_as_x mirrors double-count too and carry no such marker; say so if
the count looks high.)
binary_sensor with device_class
window/door/garage_door/opening (the generic contact class) in state
on, AND cover.* in open/opening/closing (mid-close is still open)
with the COVER classes, which are named differently: garage — not the
binary sensor's garage_door — plus door, window, gate. A motorized
window is a cover, not a binary_sensor, so checking one family answers the
question wrong. A cover in those states whose device_class is absent or
outside that list is not evidence of closed: report it as "N open, class
unknown". Do NOT do the same for unclassed binary sensors — one is
indistinguishable from a motion sensor and would manufacture false alarms.person.* in state home. Anything else that is not
unknown/unavailable is away, including a named zone like work: those
are zone names, not errors. unknown means no tracker had usable data —
third bucket, because "nobody is home" from a dropped phone is how an alarm
gets armed on someone. (This skill owns person STATE reads; ha-nova:admin
owns creating and editing them.)lock.* in any state that is not locked and not
unavailable/unknown, AND binary_sensor with device_class: lock in
state on, which reports on for UNLOCKED — the reverse of every other
class here. Name the state each one is in rather than flattening them to
"unlocked": jammed and mid-travel are not secured, and they are what a user
needs to hear.light/switch/fan/siren/remote in on
(a Harmony-style remote in on means an AV activity is live);
media_player in anything but off/standby/unavailable/unknown
(paused and idle are not off; standby IS — Home Assistant core deprecates
it as meaning off-or-idle, and users call that TV off);
binary_sensor with device_class running or moving in on;
script in on and automation with attributes.current > 0 — both are
actually executing, and the RUNNING list counts them, so leaving them out
here would let "is everything off?" say yes to something "what is running?"
names in the same breath;
climate/water_heater/humidifier in any state but
off/unavailable/unknown — an unreachable one is not off, it goes in
the third bucket;
vacuum and lawn_mower in cleaning/mowing/returning/paused/error
— error means stranded mid-floor, not put away, and it is readable so the
unavailable rule never catches it; valve in open/opening/closing;
cover only in opening/closing — a cover left open is answered by the
open-windows question above, not by this one, because it consumes nothing.binary_sensor running, plus device_class: moving; but
media_player only in playing/buffering; vacuum/lawn_mower only in
cleaning/mowing/returning (report error as stuck, not as running);
valve in open/opening/closing; cover in opening/closing only —
a motor turning is running, a cover left open is not.
climate runs when hvac_action is PRESENT and not off/idle
(heating, cooling, drying, fan, preheating, defrosting).humidifier has the same shape under a different key: attributes.action
PRESENT and not off/idle.water_heater has NO action attribute at all — its state is an operation
mode (eco, performance, heat_pump, ...), which reports enablement and
never activity. It can never be proven running: enabled goes in the third
bucket, never in "nothing is running".automation in on means ENABLED, not running — exclude it, or the answer
is "47 things are running". Its real running signal is
attributes.current > 0. script in on does mean running.Answer count-first ("2 windows open: kitchen, bathroom"), then the names, in the List Frame. This is a summary, not the banned domain dump. A follow-up "and which are closed?" is a fresh read, not a cached list.
search/related on the resolved area before keyword heuristicsentity_id match winsIf ambiguity remains: present top candidates (max 10) and state the match basis for each (name, alias, area; the id only if it alone matched) — the user must see WHY a candidate matched; then ask one selection question.
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.
Render the Step 4 shortlist as the List Frame (output-cards.md). Never dump raw states.
Read-only skill: never issue mutating relay or service calls.
For write intent, hand off to the owning skill; unfamiliar writes go through ha-nova:fallback first.
All communication with Home Assistant goes through ha-nova relay exclusively.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub markusleben/ha-nova --plugin ha-nova35 skills in this plugin
/adminUse when managing Home Assistant people, zones, tags, user accounts, general settings (name, location, units, time zone), Labs features, and analytics sharing — creating a person, drawing a zone, adding a tag, or reviewing who has access — through HA NOVA Relay./assistUse when working with Home Assistant's own built-in voice assistant (Assist) — testing what it understands, inspecting, editing, or creating Assist pipelines, managing which entities are exposed to voice, listing TTS/STT/wake-word engines, and teaching Assist custom sentences — through HA NOVA Relay. Not for Alexa or Google Assistant — setting those up is `ha-nova:integration-setup` (or `ha-nova:yaml-config` for a manual cloud config), and one that STOPPED working is a concrete failure for `ha-nova:diagnose`./backupOther plugins' skills for the same job