1. Zigbee Remote
TS1001-class (Tuya / "Lidl remote")
Emits raw Zigbee commands
2. ZHA Integration
Decodes Zigbee → fires event
Note: Duplicate Noise
ZHA often fires attribute_updated parallel to on/off. Filtered out by LITL.
Creates ConfigEntry (Persistence):
Device Registry: Binds to the original ZHA device via via_device.
3. Core Logic & Router
Filters, maps, and translates the raw event.
Component & Filters
- Filters for
device_idmatch - Ignores
attribute_updatedcommand
Transformation
4. In-Memory State & Edge Cases
Transient State
Required to compensate for missing directional context in the "stop" command.
- • _last_hold_button (up/down)
- • _last_hold_ts (Timestamp)
Lifecycle & TTL
Edge Case (Drop Event):
If age > TTL or no preceding 'hold' was registered → Do not trigger 'release', clear state, log warning.
5. Translated Device
Goal
The standardized event is passed to Home Assistant Automations and UI.
Output Schema
The generated EventEntity emits:
- • device_class : button
- • event_type : press | hold | release
- • attributes : button (on|off|up|down)
6. Consumers (Your Next Step)
Ready for easy selection in HA automation triggers.
Automations build upon the translated event entities, no longer relying on the unstructured zha_event.
- Automations / Scripts
- Blueprints
- Dashboards / UI