↓ Skip to main content
  1. Writing/

Zigbee2mqtt bind needs from_endpoint

··

A remote with several button groups exposes each group as its own endpoint in zigbee2mqtt, and its actions end in the number (on_2 is endpoint 2). To bind any group but the first, the endpoint goes in from_endpoint.

The name/endpoint form looks like it should work. In 2.12.1 it fails with the friendly name and with the address:

Source device '0xSOURCE/2' does not exist

Leave from_endpoint out and you get the first endpoint, reported back as "from_endpoint":"default". So name the remote by address and the group by number:

{"from":"0xSOURCE","from_endpoint":2,"to":"0xTARGET","clusters":["genOnOff","genLevelCtrl"]}

The remote is a sleepy battery device, so tap a button about once a second until the response arrives:

mosquitto_sub -t "zigbee2mqtt/bridge/response/device/bind" -C 1 -W 35 &
sleep 0.5
mosquitto_pub -t "zigbee2mqtt/bridge/request/device/bind" \
  -m '{"from":"0xSOURCE","from_endpoint":2,"to":"0xTARGET","clusters":["genOnOff","genLevelCtrl"]}'
wait

What the response tells you:

  • "status":"ok" with "failed":[]: bound.
  • Delivery failed: the remote fell asleep. Keep tapping and send again.
  • A cluster under failed on a re-bind: probably already bound.
Glenn Roberts
Written by
Glenn Roberts
Hands-on engineer and former CTO. I help companies build with AI.