From claude-code-homeassistant-hermit
Generates a presence history and tracker-health report showing home/away state, reliability, recent transitions, and activity patterns for person/device_tracker entities. Useful when presence-dependent automations misbehave.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-homeassistant-hermit:ha-presence-reportThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
1. Call `GetDateTime` for the current time reference. Read the stored locale from `.claude-code-hermit/OPERATOR.md` under `## HA hermit` (fall back to English if absent).
Call GetDateTime for the current time reference. Read the stored locale from .claude-code-hermit/OPERATOR.md under ## HA hermit (fall back to English if absent).
Read .claude-code-hermit/raw/snapshot-ha-normalized-latest.json.
"Context snapshot is stale — run
/claude-code-homeassistant-hermit:ha-refresh-contextfor accurate data."
entity_index to keys starting with person. or device_tracker.. If no matching keys exist, emit "no presence entities found — presence tracking isn't configured in this HA instance" and stop. Do not proceed to the history fetch.state field (home / away / unknown / unavailable) and last_changed → "since HH:MM" relative to now.state == "unavailable" OR last_changed is more than 48 hours ago (stale tracker).Run:
${CLAUDE_PLUGIN_ROOT}/bin/ha-agent-lab ha fetch-history \
--window-days 7 \
--entities "device_tracker.*" "person.*" \
--include-transitions
This writes .claude-code-hermit/raw/snapshot-ha-history-7d-latest.json.
Read snapshot-ha-history-7d-latest.json. For each presence entity:
transitions (ordered chronologically), formatted as HH:MM DD-Mon — <state>.state_durations — what percentage of the window was "home" vs "away".transitions list by UTC hour, keyed on direction: transitions to home are arrivals, transitions to away are departures. Report the top 1–2 arrival hours and departure hours separately (e.g. "typically arrives around 18:00 UTC, leaves around 08:00 UTC"). With ≥7d of data and ≥5 total transitions, state the windows; below that threshold, say "insufficient data for pattern detection." (hour_histogram counts all events regardless of direction, so use it only as a fallback for entities whose states aren't home/away.)Compose and print the inline report in the operator's locale:
## Presence Report — <date>
### Current State
<per-entity: who is home/away/unknown, since when>
### Tracker Health
<list unreliable entities with reason; "All trackers healthy." if none>
### Recent Transitions (last 7 days)
<per-entity: last 5 home/away events with timestamp>
### Activity Patterns
<per-person: typical arrival/departure windows, or "insufficient data">
Write compiled/presence-report-<YYYY-MM-DD>.md with frontmatter:
title: "Presence Report — <YYYY-MM-DD>"
type: presence-report
created: <ISO 8601 with UTC offset>
session: <S-NNN from .claude-code-hermit/state/runtime.json .session_id, or null if absent>
tags: [presence, ha]
Body: the inline report from step 5.
Append a citation to .claude-code-hermit/sessions/SHELL.md under ### Artifacts produced this session:
- [[compiled/presence-report-<date>.md]]
Create the section if it doesn't exist; skip the SHELL.md step if the file is absent (no active session).
npx claudepluginhub p/gtapps-claude-code-homeassistant-hermit-plugins-claude-code-homeassistant-hermitAnalyzes Home Assistant history data and entity patterns to identify automation opportunities, unused devices, and energy anomalies. Use periodically or when looking for optimization opportunities.
Reads Home Assistant entity history, logbook timelines, and long-term statistics via HA NOVA Relay for timeline analysis, trend summaries, and state transition insights.
Provides Home Assistant YAML templates for sensor configurations including temperature averages, motion presence detection, door/window security groups, and air quality indexing. Useful for sensor entity setup and analytics.