From ha-nova
Diagnoses why Home Assistant automations, scripts, or devices failed using error logs, system logs, traces, and HA NOVA Relay.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ha-nova:diagnoseThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Root-cause a concrete failure: "why did X not run", "why did X misbehave", "what broke last night".
Root-cause a concrete failure: "why did X not run", "why did X misbehave", "what broke last night".
ha-nova:health reports CURRENT home status (repairs, unavailable entities); ha-nova:history answers plain timeline questions; ha-nova:review audits config quality without a concrete incident. This skill starts from a concrete symptom.logger.set_level debug escalation (see Flow step 5) — every other fix hands off to the owning skill (ha-nova:write, ha-nova:helper, ha-nova:service-call).Verify relay CLI: ha-nova relay health
If this fails: ha-nova setup
File-based relay requests only:
ha-nova relay core --method GET --path <PATH> for REST reads (--out <result-file> for large output)ha-nova relay core --method POST --path <PATH> --body-file <payload-file> for REST calls with a body (template probes, service calls)ha-nova relay ws --data-file <payload-file> for WS commandsha-nova trace latest <entity_id> --json / ha-nova trace list <entity_id> --json / ha-nova trace get <entity_id> <run_id> --json for run traces (positional entity, automation.<id> or script.<id>)--jq-file <filter-file> for non-trivial filters| Source | Call | Notes |
|---|---|---|
| Run traces | ha-nova trace latest <entity_id> --json (also trace list <entity_id>, trace get <entity_id> <run_id>) | First stop for automation/script failures: shows the exact step, condition results, and variables |
| System log | WS {"type":"system_log/list"} | PRIMARY log source: structured warnings/errors with counts and sources, works on every install type |
| Error log | GET /api/error_log | 404 on HA OS/Supervised since 2025.11 (the log file moved to journald) — that is normal, not an error; stay with system_log/list. Where the file exists (Container/Core, or re-enabled), see Reading the error log |
| Logbook window | GET /api/logbook/<ISO-start>?end_time=<ISO-end>&entity=<entity_id> | Human-readable events around the incident time |
| State history | GET /api/history/period/<ISO-start>?end_time=<ISO-end>&filter_entity_id=<ids> | What states the involved entities actually had |
| Template probe | ha-nova relay core --method POST --path /api/template --body-file <payload-file> with {"template":"{{ ... }}"} | Evaluate the exact condition/template against live state; the rendered result is the string in .data.body |
| Integration diagnostics | WS {"type":"diagnostics/list"}, then GET /api/diagnostics/config_entry/<entry_id> | Deep integration state when an integration itself is the suspect |
Recency honesty: error_log and system_log/list only cover the time since the last Core restart. For older incidents use logbook/history windows, and say explicitly that live logs no longer reach back that far.
Only where the log file exists (Container/Core installs; on HA OS/Supervised the user can restore it with ha core options --duplicate-log-file=true followed by ha core rebuild and ha core restart, since 2026.1). The upstream body is plain text, but the relay wraps it in the /core envelope — the whole log is one escaped string in .data.body, so searching the saved file line-wise does not work.
ha-nova relay core --method GET --path /api/error_log --out <envelope-file>ha-nova relay jq -r --file <envelope-file> --jq-file <filter-file>
with <filter-file>:
.data.body | split("\n")[] | select(test("<entity_or_integration>|ERROR"; "i"))
-r is required for raw text output — relay core --jq does not support it, so the filtering happens in this second step.ha-nova trace latest <entity_id> --json; older runs via trace list <entity_id> + trace get <entity_id> <run_id>). The trace usually answers it: triggered or not, which condition stopped it, which step errored.system_log/list (and the error log where it exists) for the involved entities, integrations, and the incident window. Quote only the relevant lines.relay core --method POST --path /api/template --body-file <payload-file>, body {"template":"{{ ... }}"}; the rendered value comes back in .data.body).{"type":"logger/log_info"} → [{"domain":..., "level": <numeric>}]. logger/log_info reports NUMBERS but logger.set_level only accepts NAMES — map the recorded number back before building any payload: 10 → debug, 20 → info, 30 → warning, 40 → error, 50 → critical. A numeric level in a set_level payload is rejected by Home Assistant, which would leave debug logging raised until the next restart. Record the target logger's mapped level — that is the state you must restore. If it has no entry, the effective level is the configured default (HA's own default is warning, but configuration.yaml may set another).logger.set_level with {"homeassistant.components.<domain>":"debug"}. Preview the exact payload and get confirmation.warning, which would silently overwrite a level the user set on purpose. Home Assistant has no "remove override" service: an override persists until the next restart, so restoring means setting the recorded level back explicitly (or restarting HA for a truly clean state). Say this plainly before escalating.ha-nova:write / ha-nova:helper; a one-off corrective action -> ha-nova:service-call; systemic issues (repairs, unavailable entities) -> ha-nova:health.Full relay/upstream error taxonomy: skills/ha-nova/relay-api.md -> Error Handling. Diagnose specifics:
/api/error_log 404: normal on HA OS/Supervised since 2025.11 — continue with system_log/list and mention the --duplicate-log-file re-enable only if the user asks for the raw file.trace list): traces are kept per entity with a small cap and reset on reload/restart — say so instead of guessing.system_log/list empty after a restart is normal; fall back to logbook/history windows.Apply skills/ha-nova/output-rules.md to all user-facing output.
Diagnosis-first: lead with the root cause (or ranked hypotheses), then the evidence chain (trace step / log lines / state sequence, each tied to its source and timestamp), then the recommended fix with the owning skill. Quote log lines sparingly — never dump raw logs.
Preview before write: nothing is saved until the user confirms the shown preview.
Confirmation binds to the displayed preview and expires on any change to target, payload, endpoint, or scope (context skill → Active Preview Confirmation).
Pre-preview phrases ("do it", "go ahead", "implement the plan") authorize drafting and preview only — never the write itself.
Delete and destructive operations require the typed token confirm:<token> verbatim; "yes" or any natural-language reply is invalid.
Never guess entity, service, or config IDs — resolve them or ask.
Home Assistant is reached exclusively through ha-nova relay.
For any HA write this skill does not cover, STOP and invoke ha-nova:fallback first — never probe unfamiliar write endpoints.
The debug escalation (logger.set_level) is this skill's single declared mutation: read the current level via logger/log_info first, preview + natural confirmation, and always schedule the restore of THAT recorded level (never a hard-coded default) in the same interaction.
Never "fix" anything from here — fixes hand off to the owning skill after the diagnosis.
npx claudepluginhub markusleben/ha-nova --plugin ha-novaAnalyzes Home Assistant history data and entity patterns to identify automation opportunities, unused devices, and energy anomalies. Use periodically or when looking for optimization opportunities.
Integrates with Home Assistant REST and WebSocket APIs to manage entity states, call services, subscribe to events, and handle authentication. Use for HA API calls and real-time integrations.