LITL — LITL Is a Thin Layer

Translation layer with transient state tracking: raw ZHA zha_event → composed HA device with Event sub-entities.

1. Zigbee Remote

TS1001-class (Tuya / "Lidl remote")

ON
OFF

Emits raw Zigbee commands

Home Assistant Core

2. ZHA Integration

Decodes Zigbee → fires event

# zha_event Schema
event_type: "zha_event"
data:
device_id: "0x123..."
command: on|off|step|move|stop
params: step_mode|move_mode

Note: Duplicate Noise

ZHA often fires attribute_updated parallel to on/off. Filtered out by LITL.

ConfigFlow

Creates ConfigEntry (Persistence):

device_id ieee name ttl: 10s

Device Registry: Binds to the original ZHA device via via_device.

3. Core Logic & Router

Filters, maps, and translates the raw event.

Component & Filters

LITLActionEvent listens to _on_zha_event
  • Filters for device_id match
  • Ignores attribute_updated command

Transformation

on / off
press (on/off)
step 0/1
press (up/down)
move 0/1
hold (up/down)
stop
release

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

Set: On every move command.
Check/Clear: On stop command.

Edge Case (Drop Event):

If age > TTL or no preceding 'hold' was registered → Do not trigger 'release', clear state, log warning.

EventEntity

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