plugins/claude-code-homeassistant-hermit/skills/ha-analyze-patterns/SKILL.md
Analyze Home Assistant history data and entity patterns to identify automation opportunities, unused devices, and energy anomalies. Use periodically or when looking for optimization opportunities.
npx skillsauth add gtapps/claude-code-hermit ha-analyze-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Load existing analysis: Read .claude-code-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. On non-zero exit, log a single line to SHELL.md ## Monitoring (history fetch failed: <stderr first line>) 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 .claude-code-hermit/raw/snapshot-ha-normalized-latest.json. Extract both entity_index and silence_summary (added by every context refresh). Also read .claude-code-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 .claude-code-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 .claude-code-hermit/raw/patterns-<YYYY-MM-DD>.md with frontmatter type: analysis, title: "HA Pattern Analysis — <YYYY-MM-DD>", created: <ISO8601>, session: <session_id or null>, 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 --scheduled-checks: Always output a plain-text findings block to stdout. reflect --scheduled-checks 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 @claude-code-homeassistant-hermit:ha-automation-builder.
.claude-code-hermit/raw/snapshot-ha-pattern-analysis-<date>.json (raw pattern data, machine-readable).claude-code-hermit/raw/snapshot-ha-pattern-analysis-latest.json (fixed-name alias for latest).claude-code-hermit/raw/patterns-<date>.md (curated Markdown summary, written when non-trivial findings exist; type: analysis).claude-code-hermit/raw/patterns-latest.md (fixed-name alias for latest)tools
Composes and delivers the daily fitness brief — a forward-looking morning read (readiness + today's plan) or a backward-looking evening read (today's training, or an earned-rest note, + tomorrow's setup) — in the operator's configured voice. Invoke with /claude-code-fitness-hermit:fitness-brief --morning|--evening|--slot <name>. Becomes the plugin's two daily beats — the morning Strava connectivity check and the evening activity sync, RPE binding, and Run deep-dive.
development
Renew the hermit's long-lived Claude login token over the channel, before it expires. Relays a one-time sign-in link to the operator, takes the code back, installs the new token, and restarts. Activates on messages like 'relogin', 'renew my login', 'reauth', 'the login is expiring', or when doctor's credential-expiry check flags setup-token.
development
Synthesizes the past 7 days of archived briefs into a weekly digest — top stories, emerging vs faded themes, category activity, and per-source performance built from archive frontmatter. Delivers to the operator's configured channel and archives a weekly note. Designed as a weekly routine. Invoke with /feed-hermit:weekly-digest.
development
Manage developing story arcs tracked across briefs — add, resolve, and list active arcs in compiled/story-arcs-*.md. Arc Watch keywords drive the feed-brief arc-tagging enrichment. Invoke with /feed-hermit:story-arcs add|resolve|list.