get_logbook
Fetch logbook entries for a Home Assistant entity by querying the recorder database directly via SSH, avoiding large API payloads. Returns action names for events or state for other entities.
Instructions
Fetch logbook entries for an entity, including full event attributes.
Queries the recorder MariaDB directly via SSH rather than the logbook HTTP API, avoiding the massive response payloads the API endpoint returns.
For event.*_action entities the action name is extracted from
state_attributes.shared_attrs and returned as action. For all
other entities state is returned as-is.
Args:
entity_id: Entity to query (e.g. "event.master_light_switch_action").
hours: How many hours of history to fetch (default 24, max 168).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity_id | Yes | ||
| hours | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |