You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage/endpoints.md
+39-9Lines changed: 39 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,21 @@
4
4
5
5
As the firmware supports multi-channel (multi-gang) devices, it uses Zigbee endpoints to handle command routing. Zigbee endpoints are numbered, starting from one. For each endpoint, only one instance of a specific function can exist. For example, there can only be a single relay (`OnOffCluster`) attached to endpoint 1. This document explains how the firmware assigns and uses endpoints.
6
6
7
-
If the device is an N-gang switch module, the firmware will use `2 × N` endpoints. The first N endpoints are used for "client" (output) OnOff clusters, which can control other Zigbee devices via direct bindings. The next N endpoints (endpoints N+1 to 2×N) are used for "server" (input) OnOff clusters, which are directly linked to physical relays.
7
+
If the device is an N-gang switch module, the firmware will use `3 × N` endpoints. The first N endpoints are used for "client" (output) OnOff clusters, which can control other Zigbee devices via direct bindings. The next N endpoints (endpoints N+1 to 2×N) are used for "server" (input) OnOff clusters, which are directly linked to physical relays. The last N endpoints are long-press companion "client" (output) OnOff + LevelControl clusters that fire on long-press.
| 1 | OnOff client | Binding to control other Zigbee devices on short press |
14
+
| ... | OnOff client | ... |
15
+
| N | OnOff client | Binding to control other Zigbee devices |
16
+
| N+1 | OnOff server | Controls Relay 1 state. Add to a group or bind it with another device to control the relay. |
17
+
| ... | OnOff server | ... |
18
+
| 2N | OnOff server | Controls Relay N state. Add to a group or bind it with another device to control the relay. |
19
+
| 2N+1 | OnOff client + Level client | Long-press companion for switch 1. Bind it to send a `Toggle` (OnOff) and a `Move`/`Stop` (LevelControl) on long-press only. |
20
+
| ... | OnOff client + Level client | ... |
21
+
| 3N | OnOff client + Level client | Long-press companion for switch N. |
19
22
20
23
## Usage Examples
21
24
@@ -32,3 +35,30 @@ Bind endpoint 2 of your device to endpoint 1 of the bulb, and bind the `OnOff` c
32
35
If you have two 2-gang devices and want to group the first relay of both devices, you should add endpoint 3 of both devices to the same group, as shown in the screenshot:
33
36
34
37

38
+
39
+
### Long-press as a second binding target
40
+
41
+
If you want short-press of button 1 to control the local relay and long-press to toggle a different Zigbee device:
42
+
43
+
1. Leave endpoint 1 (short-press) bound to the local relay as usual.
44
+
2. Bind the `OnOff` cluster of endpoint `2N+1` (the long-press companion of button 1) to the target device.
45
+
46
+
After the bind is created, every long-press of button 1 sends a `Toggle` command to the target — independently of any Home Assistant / Zigbee2MQTT automation.
47
+
48
+
### Dimming a light by holding a button
49
+
50
+
1. Bind the `LevelControl` cluster of endpoint `2N+1` to a dimmable Zigbee light.
51
+
2. Hold the button — the light dims continuously while held; release stops the dim.
52
+
53
+
Direction (`Up`/`Down`/`Alternate`), rate, and the underlying command (`Move` vs `MoveWithOnOff`) are configurable through the cluster attributes on the long-press endpoint.
54
+
55
+
## Migration from legacy long-press configuration
56
+
57
+
Earlier firmware versions reused the short-press endpoint for long-press behavior via `binded_mode=LONG` (emit OnOff on long-press) and `relay_mode=LONG` (toggle local relay on long-press). These modes are now **deprecated** in favor of the dedicated long-press companion endpoints (`2N+1`..`3N`) introduced above, which support both `OnOff` and `LevelControl` bindings and keep short-press and long-press behavior on separate endpoints.
58
+
59
+
**Backward compatibility.** Existing configurations continue to work without changes. To keep behavior identical for devices that haven't migrated yet, whenever a switch endpoint has `binded_mode=LONG` or `relay_mode=LONG`, the paired long-press companion endpoint is **fully muted** — no relay toggle, no OnOff emission, no LevelControl emission — to prevent double-toggles and conflicting commands.
60
+
61
+
**Migrating a button:**
62
+
63
+
1. On the long-press companion endpoint `2N+1`, configure the bindings and/or `relay_mode` that match the existing long-press behavior.
64
+
2. Reset the switch endpoint back to the default (`binded_mode=SHORT`, `relay_mode=SHORT`). The mutex is released and the long-press companion endpoint becomes active.
0 commit comments