From home-assistant
Query Home Assistant state history or logbook for one or more entities. Use when the user wants to review past states, find when something changed, or audit device activity.
How this skill is triggered — by the user, by Claude, or both
Slash command
/home-assistant:query-historyThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<objective>
<quick_start>
/home-assistant:query-history light.living_room
/home-assistant:query-history light.living_room hours=24
/home-assistant:query-history binary_sensor.front_door hours=48
/home-assistant:query-history logbook hours=6
</quick_start>
Load credentials before every call: ```bash source ~/.claude/channels/home-assistant/.env ``` If `.env` is missing or `HA_URL`/`HA_TOKEN` are not set, tell the user to run `/home-assistant:access` first.Timestamps are ISO 8601 format: 2024-01-15T00:00:00+00:00. Compute start time as now - hours (default: 24h).
Compute start timestamp from hours lookback. Use ISO 8601 format.
State history — query-history <entity_id>:
http --ignore-stdin -b GET "${HA_URL%/}/api/history/period/<start_timestamp>" \
"Authorization: Bearer $HA_TOKEN" \
filter_entity_id=="<entity_id>" \
minimal_response==true \
significant_changes_only==true
Response is a nested array. Display a table: Timestamp, State, Duration (time spent in that state until next change).
Show summary at bottom: total state changes, most common state, time in each state (if calculable).
Logbook — query-history logbook:
http --ignore-stdin -b GET "${HA_URL%/}/api/logbook/<start_timestamp>" \
"Authorization: Bearer $HA_TOKEN"
Display as table: Time, Entity, State/Message, Domain.
Optionally filter by entity_id= if provided alongside logbook.
Query parameters reference:
| Param | Effect |
|---|---|
minimal_response=true | Omit attributes from history (faster) |
no_attributes=true | Strip all attributes entirely |
significant_changes_only=true | Skip noise, show meaningful transitions |
end_time=<iso> | End of window (default: now) |
<success_criteria>
npx claudepluginhub cameri/claude-skills --plugin home-assistantGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.