get_zigbee_events
Retrieve recent Zigbee action events for a device from the recorder database, with optional filtering by action type. More efficient than the logbook API.
Instructions
Fetch recent Zigbee action events for a device directly from the recorder DB.
Much more efficient than the logbook API — returns only the rows you need without loading the entire logbook into memory.
The action is stored in state_attributes.shared_attrs as event_type
(e.g. down_double, up_single). This tool extracts it via
JSON_UNQUOTE and returns one row per event.
Args:
device_name: Friendly device name as it appears in Zigbee2MQTT, e.g.
"Master Light Switch". Converted to the entity slug automatically
(e.g. event.master_light_switch_action).
minutes: How many minutes of history to return (default 60, max 10080).
action: Optional filter, e.g. "down_double". If omitted, all
actions are returned.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_name | Yes | ||
| minutes | No | ||
| action | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |