Be Smart, Go Local.

How To Bind Zigbee Devices Directly in Zigbee2MQTT

A guide detailing how you can bind Zigbee devices directly in Zigbee2MQTT and control them without software or coordinator dependence.

Creating a stable Zigbee Mesh Network that will not fail you can be a tricky task. There are a lot of things you need to be aware of and account for, so it’s definitely not something that’s easily done. What’s more, each setup and environment is different so there is no one-solution-fits-all.

However, there are a few things you can improve your Zigbee experience and smoothly control all your devices. Once such thing is called Zigbee Direct Binding.

Zigbee Direct Binding in Zigbee2MQTT

What is Zigbee Direct Binding?

Zigbee Direct Binding allows an endpoint of one device (the source) to be “bound” directly to one or more endpoints of another device or group (the target).

In other words, you connect two device together without any dependence on software (Zigbee2MQTT, ZHA), the main coordinator or other devices on your network.

Benefits of Zigbee Direct Binding

The benefits of directly binding Zigbee devices individually or in a group can be very useful when things go south. For example, let’s say you have a Zigbee dimmer that you would like to bind to a Zigbee bulb, you would get the following advantages:

  • Smoothness:
    • When the devices communicate directly, response times are greatly reduces because the payload doesn’t have to make the home automation software roundtrip
  • Automation Software Offline:
    • Devices are still usable and controllable even if the Home Automation Software is down (Zigbee2MQTT, ZHA)
  • Coordinator Offline:
    • Devices are still usable even if the coordinator is offline or overloaded
  • Local Control:
    • Devices are controlled completely locally
  • Automation Streamlining:
    • Direct binding some devices can reduce or completely eliminate the need to create automations in Home Assistant

Depending on their implementation, different devices can provide different benefits. Binding a temperature sensor to a thermostat for example, will ensure it’s operating correctly if the coordinator goes down, because the sensor is reporting directly to the thermostat.

Which devices support Zigbee Direct Binding?

It’s important to note, not all Zigbee devices support direct binding as this is dependent of the manufacturer’s Zigbee implementation. Further, it’s possible that a device supports direct binding but doesn’t support state reporting. Meaning they will not change state when triggered by the source of the bind. Various brands have vastly different Zigbee configuration, which is considered a Zigbee design flaw among the community.

Sadly, there are no certain ways to know for sure which devices support Zigbee Direct Binding. I’ve tested a bunch of Zigbee devices as part of my Reviews effort and I have never seen it printed on a spec sheet or package of a product. Apparently, this is not something manufacturers have interest in developing or letting the end user know.

However, in my experience there are a few device types that are most likely going to support direct binding as a source. Here is a list of a few devices I’ve tested so far that do support direct binding and their respective reviews:

Zigbee2MQTT Direct Binding

As an example, I’m going to bind a couple of devices together I recently reviewed which happen to support Zigbee Direct Binding. The Moes Smart Button ERS-10TZBVB-AA will control the Dry Contact Relay Switch ZG-001, simply toggling the device by binding the OnOff cluster.

Using the User Interface

First and foremost, pair your devices to Zigbee2MQTT. Make sure they work, are controllable and everything is in order.

Zigbee2MQTT Direct Binding Devices Paired

You can see from my photo they currently have a 255 LQI index, which is great because they are very close to the coordinator. Once direct binding is set up, the link quality will be important only between the two devices, skipping the coordinator.

  • Select your controlling the device (the source of the bind)
    • In my case Moes Smart Button ERS-10TZBVB-AA
  • Click the Bind tab in the device’s menu
  • You will notice some clusters of the device are already bound to the coordinator
Zigbee2MQTT Direct Binding Button to Coordinator
  • For Source endpoint, select the output endpoint of clusters, usually 1
  • For Destination, select the device you want to control
  • For Destination endpoint, select the input endpoint of clusters, usually 1
  • For Clusters, check all available clusters
    • By default, Zigbee2MQTT will bind all supported clusters and ignore those that are unsupported
  • IMPORTANT: If your controlling device is battery powered, click it a few times to wake it up just before sending the payload. EndDevices are usually sleeping, so you have it to wake it up otherwise the bind will fail
  • Click Bind
Zigbee2MQTT Direct Binding Button to Switch

If everything went okay, you will get a pop-up message in top right corner confirming the bind. Now the Dry Contact Relay Switch is directly controllable by the Moes Smart Button in my test. To verify, turn off Zigbee2MQTT completely and test it out.

Using Commands

In case the dashboard of Zigbee2MQTT somehow doesn’t work for you, you can also bind your devices by using commands. I’m sharing two simple ways to execute MQTT commands.

  • In Home Assistant, navigate to Developer Tools
  • Select the Services tab at the top
  • Select MQTT: Publish as a service call
  • Populate the the values like in the image
Zigbee2MQTT Direct Binding via MQTT Service Call

You can also click Go To YAML Mode at the bottom and paste the following code and edit it to match your devices:

#Bind devices via MQTT publish
service: mqtt.publish
data:
  qos: "0"
  topic: zigbee2mqtt/bridge/request/device/bind
  payload: >-
    {"from": "Moes Smart Button ERS-10TZBVB-AA", "to": "Dry Contact Smart Switch
    ZG-001"}
  • Topic example:
    • Bind devices: zigbee2mqtt/bridge/request/device/bind
    • Unbind devices: zigbee2mqtt/bridge/request/device/unbind
    • The base topic is zigbee2mqtt by default, if you haven’t changed it during setup
  • Payload example:
    • {"from": "my_remote", "to": "my_bulb"}
    • Between the brackets, friendly_name of the devices needs to be used
    • You can find the friendly name in Zigbee2MQTT > Click the device

As an alternative, you can navigate to Settings > Devices & Service > MQTT > Configure. You will be presented with a small dialog window that you need to populate in the same way. Complete the bind by clicking Publish at the bottom.

Zigbee2MQTT Direct Binding via MQTT Configure

You can check if the bind was successful if you navigate in Zigbee2MQTT’s dashboard, selecting the source device and clicking the Bind tab. The new bound cluster should be listed here but in case it isn’t, restart Zigbee2MQTT.

Binding to a group

It is also possible to bind a single source device to a group of devices and control them at the same time. For example, I can bind the Moes Smart Button to a group of smart switches which will be toggled simultaneously. To create a new group in Zigbee2MQTT, click the Groups tab at the top of the UI.

Zigbee2MQTT Direct Binding Create Group

Create a new group by giving it a friendly_name and an ID and click Create group. Once the group is listed, click the group name which will bring a new menu where you can add devices. Add here devices that you want to control, not the source device that will be controlling them.

Zigbee2MQTT Direct Binding Add to group

Once you’ve added all devices that you want to the group, you can repeat the binding process but target the group instead of the individual device. By default, Zigbee2MQTT will bind all available clusters from the source device to the end device.

Zigbee2MQTT Direct Binding Bind To Group

About State Changes

When a device is being bound to a controlling source, Zigbee2MQTT will automatically configure reporting for the device in question. This will make sure the device reports state changes when controlled through the source or controlling device.

However, in order for this feature to work device has to support it. Again, this is something that you cannot know for certain before you test it yourself. Zigbee2MQTT has a useful table listing some manufacturers that support this feature.

A possible workaround is to create a group adding the single device in it that does not support reporting and use the group instead of the device in the bind. This will make Zigbee2MQTT actively poll the device for updates when the bound source controls the device. To minimize traffic, this has not been enabled for all devices.

Summary

I’ve never actually had problems with the stability of my home Zigbee mesh network, I always made sure there are enough routers to relay traffic and avoid problems. However, there is a noticeable difference in latency and smoothness when toggling switches that are directly bound to a source device.

If you have a bunch of remotes, buttons or wireless scene switches around your Smart Home that are Zigbee-based, direct binding them to your bulbs of switches will ensure they keep working no matter what happens to your Zigbee2MQTT server or coordinator.

Remember, a device has to support this feature so you can enable and use it. If it does not, you will have to do things the traditional way: create automations. I’ve been testing direct binding the Moes Smart Knob in a development instance of Zigbee2MQTT, it’s very feature rich but a bit different in set up. Once I’ve learned enough, I will of course share the how-to.

10 thoughts on “How To Bind Zigbee Devices Directly in Zigbee2MQTT”

  1. Thanks a lot for this.

    I’ve tried binding my Aqara/Xiami Temperature Sensor to my Aqara/Xiami Radiator Thermostat. Even waking up the 2 items before I do this. I’ve tried all the methods, with the UI, I get an error saying ‘Nothing to Bind from Bedroom Temperature Sensor’ so I assume that means I’ve picked something that isn’t supported?

  2. I would love to read an article about z2m groups and scenes. I am trying to set cover switches ts130f to work like this and I stopped after creating a scene that I can not recall whether it is for a group or a single device. I get notification that scene was recalled but nothing happens.

  3. Thank you for this and the extensive articles! I’ve purchased a 4 button Tuya scene switch in hopes of binding each button to a bulb in my living room – https://www.zigbee2mqtt.io/devices/TS0044.html#tuya-ts0044

    I don’t see any options for clusters within Zigbee2MQTT. Are there any native battery powered 4 button scene switches that allow for pairing each button to a bulb?

    I’m leaning towards purchasing individual buttons as a fail-safe if HA freezes/ becomes unresponsive.

    Looking forward to your support, much thanks!

  4. Hello, i installed zigbee2mqtt lxc in proxmox but after installation, i cant open zigbee2mqtt UI. I have correct local ip address, try with 8080 port but no success. How you open zigbee2mqtt UI?

  5. Any thoughts how to control (sync) two light switch’s (in example turn one on, turn the other one on) as a group? Currently have an automation but always with a small delay.

  6. Thank you for sharing your experience! I think this is a often overlooked feature of ZigBee devices. Would love a follow up on how binding the Moe’s smart knob went.

Comments are closed.