How to Bind?

Is there a process for identifying what is the limit of bindable entities for any given ‘sending’ device?

If the device limit is either = 1 or > 1 seems to imply a big difference in how a user might need to configure their ZHA groups to ensure the devices are bound AND HA is able to listen to all events.

If the limit = 1 I think I would need to add my coordinator to all ZHA groups to ensure HA is listening to all devices events.
If the limit is > 1 I don’t need to do this as I can separately bind the device to my coordinator and ZHA group.
If the limit is > 4 I probably don’t need to use ZHA groups at all (as long I’m controlling no more than 3/4 ‘receiving’ devices?).

Hi
The number of available bindings is dependent on the device. When your bind request does not fit anymore (in the cluster), the device should respond with an error.

The ZB specification mentions the optionnal parameter Config_Max_Bind for a device, which is set by the device application and not available through a zigbee request.

I’ld expect that you can generally configure up 4 bindings per cluster, but I’ve seen more.

Also not that some devices keep their binding tables even after leaving a network or even after sending a reset command. That can be “annoying” - zha-toolkit allows you to clear a binding table for a cluster using binds_remove_all

1 Like

I think you can ignore them. In my groups list there is a “Devices” column on the far right - all the no name groups are 0. If you click on a group name where the number of devices is > 0 you should get a list of the devices in it.

Hmm, in my circumstance they all have one device in them, turns out it’s the zigbee coordinator in each instance.

switched from zigbee2mqtt today to zha. Trying to prepare the system for updating the usb dongle.
In connection with this, I would also like to start tying the ikea remote to certain lamps so that I avoid problems if the home assistant is down. I’ve tried to read on etc. but no guide seems to tell how to proceed, now the ones I find are 1-2 years old and refer to things I can’t find. Does anyone have a good guide on how to do this?

I think that I’ve successfully bound an Aqara Opple remote to a Samotech SM309 dimmer module using the ZHA UI but am not experiencing the expected behaviour.

This is a screenshot of what is returned by the ZHA toolkit binds_get service for the Aqara remote (04:cf:8c:df:3c:7c:6b:c5):

  result:
    "0":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 1
      cluster_id: "0xFCC0"
      dst:
        addrmode: 3
        dst_ieee: 94:de:b8:ff:fe:97:7e:4f
        dst_ep: 1
    "1":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 1
      cluster_id: "0x0008"
      dst:
        addrmode: 3
        dst_ieee: 94:de:b8:ff:fe:97:7e:4f
        dst_ep: 1
    "2":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 1
      cluster_id: "0x0006"
      dst:
        addrmode: 3
        dst_ieee: 90:35:ea:ff:fe:64:19:d5
        dst_ep: 1
    "3":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 1
      cluster_id: "0x0008"
      dst:
        addrmode: 3
        dst_ieee: 90:35:ea:ff:fe:64:19:d5
        dst_ep: 1

94:de:b8:ff:fe:97:7e:4f is my zigbee coordinator and 90:35:ea:ff:fe:64:19:d5 is the target Samotech module. I’ve confirmed that 0x0006 is the OnOff endpoint and 0x0008 is the LevelControl endpoint by looking under the Clusters section of Manage Zigbee Device of both devices.

Curious, I looked up 0xFCC0 and it’s listed as OppleCluster with a single attribute of mode.

I can see the remote clicks registering in the logbook on the device’s page and I expected the remote to now be able to turn on the module (and attached light bulb) but this did not happen.

This is a screenshot of the Aqara remote:

As cluster 6 is not bound to the coordinator, it would be “surprising” that you seen the cluster 6 commands sent by the Aqara device - “surprising” because I’ve also seen an Aqara device send data to a coordinator without binding as far as I could see.

According to https://www.samotech.co.uk/products/zigbee-dimmer-sm309-s/, the receiving module has an On/Off cluster, but no 0x0008 Level Control cluster (it’s 0x0b08 according to the documentation) so level commands from 0x0008 will not be interpreted.

Check if you get any of the on-off commands.

@le_top sorry for the delayed reply, I had been testing out scenarios and have been able to confirm that even when it appears that the remote is no longer bound to any devices, it still appears to be speaking to the coordinator! Below is an example of one of my tests.

As a reminder, my Aqara opple remote is 04:cf:8c:df:3c:7c:6b:c5, the coordinator is 94:de:b8:ff:fe:97:7e:4f and the Samotech relay module is 90:35:ea:ff:fe:64:19:d5.

(Also, I believe the cluster info on the Samotech website is a typo as the device manual says Level Control is 0x0008 and that is also what I see in the Bindings section under the device’s Manage Zigbee Device.)

  1. Run ZHA toolkit binds_remove_all service call:
event_type: binds_remove_done
data:
  zha_toolkit_version: v1.1.5
  zigpy_version: 0.59.0
  zigpy_rf_version: 0.36.8
  ieee_org:
    - 197
    - 107
    - 124
    - 60
    - 223
    - 140
    - 207
    - 4
  ieee: 04:cf:8c:df:3c:7c:6b:c5
  command: binds_remove_all
  command_data: null
  start_time: "2023-11-04T17:35:13.240688+00:00"
  errors: []
  params:
    dir: 0
    tries: 100
    expect_reply: true
    args: []
    event_done: binds_remove_done
    read_before_write: true
    read_after_write: true
  replies:
    - - 0
      - 8
      - 0
      - - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 1
          ClusterId: 1
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
        - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 1
          ClusterId: 64704
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
    - - 0
      - 8
      - 2
      - - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 1
          ClusterId: 8
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
        - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 1
          ClusterId: 6
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
    - - 0
      - 8
      - 4
      - - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 4
          ClusterId: 6
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
        - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 5
          ClusterId: 6
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
    - - 0
      - 8
      - 6
      - - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 6
          ClusterId: 6
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
        - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 1
          ClusterId: 6
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 213
              - 25
              - 100
              - 254
              - 255
              - 234
              - 53
              - 144
            endpoint: 1
    - - 0
    - - 0
    - - 0
    - - 0
    - - 0
    - - 0
    - - 0
    - - 0
  success: true
  result:
    removed:
      - src: 04:cf:8c:df:3c:7c:6b:c5
        src_ep: 1
        cluster_id: "0x0001"
        dst:
          addrmode: 3
          dst_ieee: 94:de:b8:ff:fe:97:7e:4f
          dst_ep: 1
      - src: 04:cf:8c:df:3c:7c:6b:c5
        src_ep: 1
        cluster_id: "0xFCC0"
        dst:
          addrmode: 3
          dst_ieee: 94:de:b8:ff:fe:97:7e:4f
          dst_ep: 1
      - src: 04:cf:8c:df:3c:7c:6b:c5
        src_ep: 1
        cluster_id: "0x0008"
        dst:
          addrmode: 3
          dst_ieee: 94:de:b8:ff:fe:97:7e:4f
          dst_ep: 1
      - src: 04:cf:8c:df:3c:7c:6b:c5
        src_ep: 1
        cluster_id: "0x0006"
        dst:
          addrmode: 3
          dst_ieee: 94:de:b8:ff:fe:97:7e:4f
          dst_ep: 1
      - src: 04:cf:8c:df:3c:7c:6b:c5
        src_ep: 4
        cluster_id: "0x0006"
        dst:
          addrmode: 3
          dst_ieee: 94:de:b8:ff:fe:97:7e:4f
          dst_ep: 1
      - src: 04:cf:8c:df:3c:7c:6b:c5
        src_ep: 5
        cluster_id: "0x0006"
        dst:
          addrmode: 3
          dst_ieee: 94:de:b8:ff:fe:97:7e:4f
          dst_ep: 1
      - src: 04:cf:8c:df:3c:7c:6b:c5
        src_ep: 6
        cluster_id: "0x0006"
        dst:
          addrmode: 3
          dst_ieee: 94:de:b8:ff:fe:97:7e:4f
          dst_ep: 1
      - src: 04:cf:8c:df:3c:7c:6b:c5
        src_ep: 1
        cluster_id: "0x0006"
        dst:
          addrmode: 3
          dst_ieee: 90:35:ea:ff:fe:64:19:d5
          dst_ep: 1
    skipped: []
origin: LOCAL
time_fired: "2023-11-04T17:35:38.202882+00:00"
context:
  id: 01HEDPF4PTW9A7P9HEE9S87E72
  parent_id: null
  user_id: null
  1. Run ZHA toolkit binds_get service call:
event_type: binds_get_done
data:
  zha_toolkit_version: v1.1.5
  zigpy_version: 0.59.0
  zigpy_rf_version: 0.36.8
  ieee_org:
    - 197
    - 107
    - 124
    - 60
    - 223
    - 140
    - 207
    - 4
  ieee: 04:cf:8c:df:3c:7c:6b:c5
  command: binds_get
  command_data: null
  start_time: "2023-11-04T17:36:22.900228+00:00"
  errors: []
  params:
    dir: 0
    tries: 100
    expect_reply: true
    args: []
    event_done: binds_get_done
    read_before_write: true
    read_after_write: true
  replies:
    - - 0
      - 0
      - 0
      - []
  success: true
  result: {}
origin: LOCAL
time_fired: "2023-11-04T17:36:40.104896+00:00"
context:
  id: 01HEDPH15835F2SGCCAE6K9NRG
  parent_id: null
  user_id: null
  1. Me clicking the remote buttons immediately after:
    image

I have an automation that uses the remote button press to toggle the relay module (and connected dumb lights) and when I reactivated it the automation continued to perform as normal!

…and after a short while I tried the get_binds service again and it now looks like this, everything that had appeared to have been removed is magically back!

event_type: binds_get_done
data:
  zha_toolkit_version: v1.1.5
  zigpy_version: 0.59.0
  zigpy_rf_version: 0.36.8
  ieee_org:
    - 197
    - 107
    - 124
    - 60
    - 223
    - 140
    - 207
    - 4
  ieee: 04:cf:8c:df:3c:7c:6b:c5
  command: binds_get
  command_data: null
  start_time: "2023-11-04T18:41:10.542941+00:00"
  errors: []
  params:
    dir: 0
    tries: 100
    expect_reply: true
    args: []
    event_done: binds_get_done
    read_before_write: true
    read_after_write: true
  replies:
    - - 0
      - 7
      - 0
      - - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 3
          ClusterId: 6
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
        - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 4
          ClusterId: 6
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
    - - 0
      - 7
      - 2
      - - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 5
          ClusterId: 6
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
        - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 6
          ClusterId: 6
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
    - - 0
      - 7
      - 4
      - - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 1
          ClusterId: 1
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
        - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 1
          ClusterId: 64704
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
    - - 0
      - 7
      - 6
      - - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 1
          ClusterId: 768
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 79
              - 126
              - 151
              - 254
              - 255
              - 184
              - 222
              - 148
            endpoint: 1
  success: true
  result:
    "0":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 3
      cluster_id: "0x0006"
      dst:
        addrmode: 3
        dst_ieee: 94:de:b8:ff:fe:97:7e:4f
        dst_ep: 1
    "1":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 4
      cluster_id: "0x0006"
      dst:
        addrmode: 3
        dst_ieee: 94:de:b8:ff:fe:97:7e:4f
        dst_ep: 1
    "2":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 5
      cluster_id: "0x0006"
      dst:
        addrmode: 3
        dst_ieee: 94:de:b8:ff:fe:97:7e:4f
        dst_ep: 1
    "3":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 6
      cluster_id: "0x0006"
      dst:
        addrmode: 3
        dst_ieee: 94:de:b8:ff:fe:97:7e:4f
        dst_ep: 1
    "4":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 1
      cluster_id: "0x0001"
      dst:
        addrmode: 3
        dst_ieee: 94:de:b8:ff:fe:97:7e:4f
        dst_ep: 1
    "5":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 1
      cluster_id: "0xFCC0"
      dst:
        addrmode: 3
        dst_ieee: 94:de:b8:ff:fe:97:7e:4f
        dst_ep: 1
    "6":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 1
      cluster_id: "0x0300"
      dst:
        addrmode: 3
        dst_ieee: 94:de:b8:ff:fe:97:7e:4f
        dst_ep: 1
origin: LOCAL
time_fired: "2023-11-04T18:42:46.834043+00:00"
context:
  id: 01HEDTA2XJ55Z4A9BM5NXZ777Q
  parent_id: null
  user_id: null

EDIT

…and one more update. I removed all bindings again and this time used the ZHA toolkit bind_ieee service and specifically selected target and destination endpoint 1 for the remote and relay module. Running the binds_get service I now see this returned but pressing the button on the remote doesn’t toggle the lights at all!

event_type: binds_get_done
data:
  zha_toolkit_version: v1.1.5
  zigpy_version: 0.59.0
  zigpy_rf_version: 0.36.8
  ieee_org:
    - 197
    - 107
    - 124
    - 60
    - 223
    - 140
    - 207
    - 4
  ieee: 04:cf:8c:df:3c:7c:6b:c5
  command: binds_get
  command_data: null
  start_time: "2023-11-04T21:15:56.373167+00:00"
  errors: []
  params:
    dir: 0
    tries: 100
    expect_reply: true
    args: []
    event_done: binds_get_done
    read_before_write: true
    read_after_write: true
  replies:
    - - 0
      - 2
      - 0
      - - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 1
          ClusterId: 6
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 213
              - 25
              - 100
              - 254
              - 255
              - 234
              - 53
              - 144
            endpoint: 1
        - SrcAddress:
            - 197
            - 107
            - 124
            - 60
            - 223
            - 140
            - 207
            - 4
          SrcEndpoint: 1
          ClusterId: 8
          DstAddress:
            addrmode: 3
            nwk: null
            ieee:
              - 213
              - 25
              - 100
              - 254
              - 255
              - 234
              - 53
              - 144
            endpoint: 1
  success: true
  result:
    "0":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 1
      cluster_id: "0x0006"
      dst:
        addrmode: 3
        dst_ieee: 90:35:ea:ff:fe:64:19:d5
        dst_ep: 1
    "1":
      src: 04:cf:8c:df:3c:7c:6b:c5
      src_ep: 1
      cluster_id: "0x0008"
      dst:
        addrmode: 3
        dst_ieee: 90:35:ea:ff:fe:64:19:d5
        dst_ep: 1
origin: LOCAL
time_fired: "2023-11-04T21:16:03.672814+00:00"
context:
  id: 01HEE32R6RX7MQP1XRP08CZQ87
  parent_id: null
  user_id: null

Hi,

I’m trying to understand how binding works in my situation. I hope someone can confirm what I understand.

I’ve installed an ECO-DIM.07 dimmer. It dims the connected (non-zigbee) bulbs. I can also control it from HA via zigbee. I have some Zigbee bulbs in the same room. Obviously, those are not connected to this dimmer. But I want them to “follow” the dimmer, so I can basically control the light level in the whole room with a single dimmer.

I’ve achieved this with an automation, that triggers on changes in the level. This has the downside that there’s a small delay and that it will not work if HA should be down for some reason.

I think in theory I could use Zigbee binding to solve this. However, when I try to bind the dimmer to any of the bulbs or a group, it doesn’t work. When I look at the clusters of the dimmer, this is what I see:

There’s only a LevelControl cluster of type “in”. My assumption is that this means that the device can only receive level control commands, but not send them. Is that right? I guess that would mean that I’m out of luck with this device, unless it can be added with a firmware update?

1 Like

You say it doesn’t work - do you mean binding the lights to a group doesn’t work, or the bind works, but the dimmer switch doesn’t control all the lights?

I managed to bind a button to an (ikea) blind. I had to repeat the process several times, but it eventually worked. I detailed the whole process here. If it’s a binding problem this might help?

Regarding the LevelControl, I looked at my Zigbee Button (that controls the blind) and mine is “Type: out”, not “in” like yours, so that could be a problem as you suspect? I can’t find any documentation that explains what the “Type” means, but I agree it makes no sense for a button to only accept commands coming “in”!

Hi @cokelid, thanks for your reply. Yes, I can add the bulbs to a group and control the group from HA. But I can’t get the dimmer to control the group. I did read your detailed steps, that was helpful indeed.

I agree that it doesn’t make sense for a button to only accept commands coming “in”. However, my dimmer is not only a button. It is a electronic dimmer as well, that can dim physically connected “dumb” LED bulbs. That works fine: I can now dim those bulbs by turning the physical knob as well as by using a Lovelace card. So there is a good use for incoming commands in this case. However, it would be even better if the dimmer could also send outgoing commands. I’ll contact the manufacturer, maybe they can confirm whether this is possible now or with a future firmware update.