Get logbook entries
history_get_logbookFetch human-readable Home Assistant logbook entries from the last N hours, optionally filtered by entity, to review state changes and triggered automations as a narrative.
Instructions
Get human-readable logbook entries from the last N hours.
Calls GET /api/logbook/<start>, optionally filtered by entity_id,
where start is now - hours.
Use when: a narrative of what happened (state changes, triggered
automations) is more useful than raw state-history records.
Not for: raw per-state timestamps and values for one entity — use
history_get_state_history.
Returns: HA's raw logbook payload — a list of {when, name, message, entity_id, ...}-shaped entries.
Errors: raises httpx.HTTPStatusError if the HA API request fails.
Limits: only as far back as the recorder integration has retained
logbook data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hours | No | How many hours back from now to fetch, e.g. 24 for one day. Default 24. | |
| entity_id | No | Full entity ID to filter to, e.g. 'light.kitchen'. Omit to return logbook entries for every entity. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |