Binding remotes to lights with ZHA

I have this dimming remote in my small Zigbee network that I am playing around with - just the coordinator, the remote, a light switch, and a dimmable lamp:

If I try to bind the remote to either the light switch or the dimmer, I get a success message for the binding, but an failure message for the specific clusters :thinking:.

Here are debug logs for just the light:

2021-09-29 18:26:12 DEBUG (MainThread) [zigpy.topology] Finished scanning neighbors for all devices
2021-09-29 18:26:12 DEBUG (MainThread) [zigpy.zdo] [0x44da:zdo] processing cluster: 6 Bind_req --> [84:71:27:ff:fe:c7:a1:09]
2021-09-29 18:26:12 DEBUG (MainThread) [zigpy.device] [0x44da] Extending timeout for 0x44 request
2021-09-29 18:26:12 DEBUG (MainThread) [zigpy_znp.api] Sending request: ZDO.ExtRouteChk.Req(Dst=0x44DA, RtStatus=<RouteStatus.ACTIVE: 1>, Options=<RouteOptions.NO_ROUTE_CACHE|MTO_ROUTE: 3>)
2021-09-29 18:26:12 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.ExtRouteChk.Rsp(Status=<RoutingStatus.FAIL: 1>)
2021-09-29 18:26:12 DEBUG (MainThread) [zigpy_znp.api] Sending request: ZDO.ExtRouteDisc.Req(Dst=0x44DA, Options=<RouteDiscoveryOptions.UNICAST: 0>, Radius=30)
2021-09-29 18:26:12 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.ExtRouteDisc.Rsp(Status=<Status.SUCCESS: 0>)
2021-09-29 18:26:13 DEBUG (MainThread) [zigpy_znp.zigbee.application] Intercepted a ZDO request: dst_addr=AddrModeAddress(mode=<AddrMode.NWK: 2>, address=0x44DA), dst_ep=0, src_ep=0, cluster=ZDOCmd.Bind_req, sequence=68, options=TransmitOptions.SUPPRESS_ROUTE_DISC_NETWORK|ACK_REQUEST, radius=30, data=b"D\xf6\xa1\xcc\x01\x00\x8d\x15\x00\x01\x06\x00\x03\t\xa1\xc7\xfe\xff'q\x84\x01"
2021-09-29 18:26:13 DEBUG (MainThread) [zigpy_znp.zigbee.application] Intercepted AP ZDO request ZDOCmd.Bind_req({'SrcAddress': 00:15:8d:00:01:cc:a1:f6, 'SrcEndpoint': 1, 'ClusterID': 6, 'DstAddress': MultiAddress(addrmode=3, ieee=84:71:27:ff:fe:c7:a1:09, endpoint=1)}) and replaced with ZDO.BindReq.Req(Dst=0x44DA, Src=00:15:8d:00:01:cc:a1:f6, SrcEndpoint=1, ClusterId=6, Address=MultiAddress(addrmode=3, ieee=84:71:27:ff:fe:c7:a1:09, endpoint=1))
2021-09-29 18:26:13 DEBUG (MainThread) [zigpy_znp.api] Sending request: ZDO.BindReq.Req(Dst=0x44DA, Src=00:15:8d:00:01:cc:a1:f6, SrcEndpoint=1, ClusterId=6, Address=MultiAddress(addrmode=3, ieee=84:71:27:ff:fe:c7:a1:09, endpoint=1))
2021-09-29 18:26:13 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.BindReq.Rsp(Status=<Status.SUCCESS: 0>)
2021-09-29 18:26:26 DEBUG (MainThread) [zigpy_znp.api] Sending request: SYS.Ping.Req()
2021-09-29 18:26:26 DEBUG (MainThread) [zigpy_znp.api] Received command: SYS.Ping.Rsp(Capabilities=<MTCapabilities.APP_CNF|GP|UTIL|ZDO|AF|SYS: 1625>)
# Break here just to emphasise these lines
2021-09-29 18:26:28 DEBUG (MainThread) [zigpy.zdo] [0x44da:zdo] cluster: 6 Bind_req --> [84:71:27:ff:fe:c7:a1:09] failed:
2021-09-29 18:26:28 INFO (MainThread) [homeassistant.components.zha.api] Devices bound: source_ieee: [00:15:8d:00:01:cc:a1:f6]target_ieee: [84:71:27:ff:fe:c7:a1:09]

The last couple of lines are what jumped out to me - cluster 6 is OnOff and reports failed, but we go on to report the devices as bound.

It’s very similar for the dimmable lamp, only also with cluster 8 LevelControl:

2021-09-29 18:26:59 DEBUG (MainThread) [zigpy.zdo] [0x44da:zdo] processing cluster: 6 Bind_req --> [08:6b:d7:ff:fe:5d:80:8c]
2021-09-29 18:26:59 DEBUG (MainThread) [zigpy.zdo] [0x44da:zdo] processing cluster: 8 Bind_req --> [08:6b:d7:ff:fe:5d:80:8c]
2021-09-29 18:26:59 DEBUG (MainThread) [zigpy.device] [0x44da] Extending timeout for 0x45 request
2021-09-29 18:26:59 DEBUG (MainThread) [zigpy_znp.api] Sending request: ZDO.ExtRouteChk.Req(Dst=0x44DA, RtStatus=<RouteStatus.ACTIVE: 1>, Options=<RouteOptions.NO_ROUTE_CACHE|MTO_ROUTE: 3>)
2021-09-29 18:26:59 DEBUG (MainThread) [zigpy.device] [0x44da] Extending timeout for 0x46 request
2021-09-29 18:26:59 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.ExtRouteChk.Rsp(Status=<RoutingStatus.FAIL: 1>)
2021-09-29 18:26:59 DEBUG (MainThread) [zigpy_znp.api] Sending request: ZDO.ExtRouteChk.Req(Dst=0x44DA, RtStatus=<RouteStatus.ACTIVE: 1>, Options=<RouteOptions.NO_ROUTE_CACHE|MTO_ROUTE: 3>)
2021-09-29 18:26:59 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.ExtRouteChk.Rsp(Status=<RoutingStatus.FAIL: 1>)
2021-09-29 18:26:59 DEBUG (MainThread) [zigpy_znp.api] Sending request: ZDO.ExtRouteDisc.Req(Dst=0x44DA, Options=<RouteDiscoveryOptions.UNICAST: 0>, Radius=30)
2021-09-29 18:26:59 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.ExtRouteDisc.Rsp(Status=<Status.SUCCESS: 0>)
2021-09-29 18:27:00 DEBUG (MainThread) [zigpy_znp.zigbee.application] Intercepted a ZDO request: dst_addr=AddrModeAddress(mode=<AddrMode.NWK: 2>, address=0x44DA), dst_ep=0, src_ep=0, cluster=ZDOCmd.Bind_req, sequence=69, options=TransmitOptions.SUPPRESS_ROUTE_DISC_NETWORK|ACK_REQUEST, radius=30, data=b'E\xf6\xa1\xcc\x01\x00\x8d\x15\x00\x01\x06\x00\x03\x8c\x80]\xfe\xff\xd7k\x08\x01'
2021-09-29 18:27:00 DEBUG (MainThread) [zigpy_znp.zigbee.application] Intercepted AP ZDO request ZDOCmd.Bind_req({'SrcAddress': 00:15:8d:00:01:cc:a1:f6, 'SrcEndpoint': 1, 'ClusterID': 6, 'DstAddress': MultiAddress(addrmode=3, ieee=08:6b:d7:ff:fe:5d:80:8c, endpoint=1)}) and replaced with ZDO.BindReq.Req(Dst=0x44DA, Src=00:15:8d:00:01:cc:a1:f6, SrcEndpoint=1, ClusterId=6, Address=MultiAddress(addrmode=3, ieee=08:6b:d7:ff:fe:5d:80:8c, endpoint=1))
2021-09-29 18:27:00 DEBUG (MainThread) [zigpy_znp.api] Sending request: ZDO.BindReq.Req(Dst=0x44DA, Src=00:15:8d:00:01:cc:a1:f6, SrcEndpoint=1, ClusterId=6, Address=MultiAddress(addrmode=3, ieee=08:6b:d7:ff:fe:5d:80:8c, endpoint=1))
2021-09-29 18:27:00 DEBUG (MainThread) [zigpy_znp.zigbee.application] Intercepted a ZDO request: dst_addr=AddrModeAddress(mode=<AddrMode.NWK: 2>, address=0x44DA), dst_ep=0, src_ep=0, cluster=ZDOCmd.Bind_req, sequence=70, options=TransmitOptions.SUPPRESS_ROUTE_DISC_NETWORK|ACK_REQUEST, radius=30, data=b'F\xf6\xa1\xcc\x01\x00\x8d\x15\x00\x01\x08\x00\x03\x8c\x80]\xfe\xff\xd7k\x08\x01'
2021-09-29 18:27:00 DEBUG (MainThread) [zigpy_znp.zigbee.application] Intercepted AP ZDO request ZDOCmd.Bind_req({'SrcAddress': 00:15:8d:00:01:cc:a1:f6, 'SrcEndpoint': 1, 'ClusterID': 8, 'DstAddress': MultiAddress(addrmode=3, ieee=08:6b:d7:ff:fe:5d:80:8c, endpoint=1)}) and replaced with ZDO.BindReq.Req(Dst=0x44DA, Src=00:15:8d:00:01:cc:a1:f6, SrcEndpoint=1, ClusterId=8, Address=MultiAddress(addrmode=3, ieee=08:6b:d7:ff:fe:5d:80:8c, endpoint=1))
2021-09-29 18:27:00 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.BindReq.Rsp(Status=<Status.SUCCESS: 0>)
2021-09-29 18:27:00 DEBUG (MainThread) [zigpy_znp.api] Sending request: ZDO.BindReq.Req(Dst=0x44DA, Src=00:15:8d:00:01:cc:a1:f6, SrcEndpoint=1, ClusterId=8, Address=MultiAddress(addrmode=3, ieee=08:6b:d7:ff:fe:5d:80:8c, endpoint=1))
2021-09-29 18:27:00 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.BindReq.Rsp(Status=<Status.SUCCESS: 0>)
# These:
2021-09-29 18:27:15 DEBUG (MainThread) [zigpy.zdo] [0x44da:zdo] cluster: 6 Bind_req --> [08:6b:d7:ff:fe:5d:80:8c] failed:
2021-09-29 18:27:15 DEBUG (MainThread) [zigpy.zdo] [0x44da:zdo] cluster: 8 Bind_req --> [08:6b:d7:ff:fe:5d:80:8c] failed:
2021-09-29 18:27:15 INFO (MainThread) [homeassistant.components.zha.api] Devices bound: source_ieee: [00:15:8d:00:01:cc:a1:f6]target_ieee: [08:6b:d7:ff:fe:5d:80:8c]

I make sure the remote is awake just before attempting the bind, and have tried pressing buttons during the binding process too. I can see the button press events in the logs, so there is some level of communication working.

Can anyone help me figure out how to get these devices bound?

Bump, anyone have any suggestions here? :pray:

I have tried binding a second remote - an IKEA Styrbar - and see the same issues :confused:

2021-10-12 10:49:42 DEBUG (MainThread) [zigpy.zdo] [0xab4b:zdo] cluster: 6 Bind_req --> [08:6b:d7:ff:fe:5d:80:8c] failed:
2021-10-12 10:49:42 DEBUG (MainThread) [zigpy.zdo] [0xab4b:zdo] cluster: 8 Bind_req --> [08:6b:d7:ff:fe:5d:80:8c] failed:
2021-10-12 10:49:42 INFO (MainThread) [homeassistant.components.zha.api] Devices bound: source_ieee: [84:2e:14:ff:fe:70:36:e2] target_ieee: [08:6b:d7:ff:fe:5d:80:8c]

I guess it could be my coordinator?

I have no clue on the issue, but just to be sure:
Are you actually intending to bind the dimmer directly to the light, bypassing HA completely (besides using ZHA to do the binding)?

Yes that’s correct, for this use case I want to make sure the remote will continue to work even if HA or the coordinator is unavailable. Eventually I want this to work with a group of lights, and maybe even scenes.

Ok. First step would probably to show the device signatures of both the dimmer and whatever you want it to be bound to.

Here’s the Ikea remote:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4476, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0820",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0020",
        "0x1000",
        "0xfc57"
      ],
      "out_clusters": [
        "0x0003",
        "0x0005",
        "0x0006",
        "0x0008",
        "0x0019",
        "0x1000"
      ]
    }
  },
  "manufacturer": "IKEA of Sweden",
  "model": "Remote Control N2",
  "class": "zhaquirks.ikea.fourbtnremote.IkeaTradfriRemote"
}

And the dimmer:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4714, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0101",
      "in_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0008",
        "0x0b05",
        "0x1000"
      ],
      "out_clusters": [
        "0x0019"
      ]
    },
    "242": {
      "profile_id": 41440,
      "device_type": "0x0061",
      "in_clusters": [],
      "out_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "HZC",
  "model": "Dimmer-Switch-ZB3.0",
  "class": "zigpy.device.Device"
}

@DazWorrall any luck binding Styrbar and a bulb? I got a method successfully works for a small e1743 on/off switch and some other Tradfri device. But can not bind the Styrbar

@DazWorrall have you resolve the issue?

At some point you indicate that “the remote is awake before the bind”, but it should be awake after the bind request.

Why?

If the remote is awake before the bind request, then it is likely asleep when the request is actually pending on the router. So you need to wake it within a few seconds after sending the bind request.
In that case, when the remote wakes up, it checks if there is data with its parent which provides it if it is still in its internal table.
When you wake the remote before sending the request, the router does not have the binding request yet, so it just replies to the remote that all is fine, and the remote sleeps again.

1 Like

Digging up this old thread.
I want to mention that I successfully connected a E1743 with a LED1935C3 with binding to the device and not the individual clusters.
Had to unbind the controller (in my case a connected usb-stick from the E1734)
I read the techniques how to do this somewhat but I cannot remember where.
Afterwards one can connect the E1743 to the controller again if wanted.
Alll of this has been done using ZHA