/hermitd-homeassistant:ha-analyze-patternsfrom hermitd-homeassistant
Analyzes Home Assistant history data and entity patterns to identify automation opportunities, unused devices, and energy anomalies. Useful for periodic optimization reviews of smart home setups.
Ships in hermitd-homeassistant. 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.
None: SKILL.md is the whole skill.
Load existing analysis: Read .hermit/raw/snapshot-ha-pattern-analysis-latest.json if it exists.
Get live context: Call GetLiveContext and GetDateTime via MCP for current state.
Fetch history: Run ${CLAUDE_PLUGIN_ROOT}/bin/ha-agent-lab ha fetch-history --window-days 7. When it prints {"error"} (exit 1), pipe one line into .hermit/bin/hermitd-run task note .hermit <id> only inside an open record's turn (otherwise skip the note) (history fetch failed: <error>) and continue: the skill proceeds using Phase 1 silence findings only. Do not surface the fetch failure to scheduled-check stdout.
Read normalized inventory: Read .hermit/raw/snapshot-ha-normalized-latest.json. Extract both entity_index and silence_summary (added by every context refresh). Also read .hermit/raw/snapshot-ha-history-7d-latest.json if present.
Analyze patterns from silence_summary and history:
From silence_summary.dead_automations (enabled automations not fired in 30+ days):
"automation.X has not fired in N days (enabled)".never_fired: true entries get special phrasing: "automation.X has never fired (enabled but never triggered)".From silence_summary.silent_event_sensors (motion/door/window sensors silent for 7+ days):
"binary_sensor.X (<device_class>) — no events in N days".From silence_summary.long_unavailable (individual entities unavailable 7+ days, domain not already degraded):
"entity.X unavailable for N days".From silence_summary.inactive_candidates_by_domain (lights/switches/covers/climates unchanged for 7+ days):
From silence_summary.suppressed_entity_domains:
From snapshot-ha-history-7d-latest.json (when present):
time_patterns: surface under Automation opportunities: as a schedule-based candidate. Example: "light.kitchen — 8/12 events at 07:00 UTC, consider time-based automation".entity_aggregates entry where event_count == 0 AND the entity also appears in silence_summary.inactive_candidates_by_domain: promote to actionable Reliability issues: only when the entity's last_changed timestamp (from entity_index) is older than 30 days. The 7-day Phase 1 informational threshold gets a much higher bar here because history corroborates it.automation.* entities — silence_summary.dead_automations is authoritative for that.Write findings: Save pattern data to .hermit/raw/snapshot-ha-pattern-analysis-<YYYY-MM-DD>.json and update snapshot-ha-pattern-analysis-latest.json. Write the curated Markdown summary (when non-trivial findings exist) to .hermit/raw/patterns-<YYYY-MM-DD>.md with frontmatter type: analysis, title: "HA Pattern Analysis: <YYYY-MM-DD>", created: <ISO8601>, task: <T-... for the open record in this turn; omit this field otherwise>, tags: [ha-patterns, analysis]. Also write patterns-latest.md pointing to the same content. The Markdown body should include the richer breakdown: inactive_candidates_by_domain summary table, suppressed_entity_domains note, time-pattern table from history, and state_durations summary for climate.* entities (showing heating/cooling hours over the 7d window).
Update memory: Update your auto memory with key findings from this analysis.
Emit summary for reflect --check-id ha-patterns --check hermitd-homeassistant:ha-analyze-patterns: Always output a plain-text findings block to stdout. reflect --check-id ha-patterns --check hermitd-homeassistant:ha-analyze-patterns routes actionable items through the proposal pipeline. The stdout shape is fixed — do not add new top-level sections:
ha-analyze-patterns findings — <date>
Automation opportunities: <N>
- <opportunity 1>
Reliability issues: <N>
- <dead automation or silent sensor or long-unavailable entity>
Waste patterns: <N>
- <waste 1>
No action needed: <list anything normal or already automated>
Dead automations and silent event sensors fold under Reliability issues:. If there are zero findings across all categories, output: ha-analyze-patterns findings — <date>\nNo actionable findings.
Propose automations: If clear patterns emerge, suggest them. For complex ones, delegate to @hermitd-homeassistant:ha-automation-builder.
.hermit/raw/snapshot-ha-pattern-analysis-<date>.json (raw pattern data, machine-readable).hermit/raw/snapshot-ha-pattern-analysis-latest.json (fixed-name alias for latest).hermit/raw/patterns-<date>.md (curated Markdown summary, written when non-trivial findings exist; type: analysis).hermit/raw/patterns-latest.md (fixed-name alias for latest)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gtapps/hermitd --plugin hermitd-homeassistant19 skills in this plugin
/domain-brainstormOn-demand HA-voice brainstorm — reads entity inventory, automation/script listings, and operator intent to surface at most 2 capability-gap ideas, each gated by proposal-triage before becoming a proposal task. Invoke when the operator asks "what automations am I missing?", "any coverage gaps?", or "brainstorm improvements". Never runs autonomously./ha-apply-changeValidate and apply a generated HA automation or script YAML with safety checks and optional reload. Use after building or modifying an automation./ha-apply-updateApply a Home Assistant update surfaced by ha-update-check, when the operator accepts a [ha-update] proposal. Enforces the tier rule -- add-ons/HACS may auto-apply, Core/OS/Supervisor always wait for an explicit operator go-ahead./ha-automation-diffReport which Home Assistant automations were added, removed, edited, enabled, or disabled since the last snapshot — change memory across sessions, including UI edits that bypass this plugin. Read-only. Use when the operator asks "what changed", "what moved since last time", or to explain a regression./ha-automation-explorerBrowse and explain the hermit's Home Assistant automations — list by topic, filter by keyword with plain-language YAML explanations, or sort by last-fired. Read-only. Use when the operator asks "what automations do I have / what does this one do / which haven't fired."/ha-build-automationDraft a Home Assistant automation or script YAML from a description. Validates against the entity inventory and safety policy. Use when the user wants to create or modify HA automations.Other plugins' skills for the same job