Stuck in "Starting Interview" state: Xiaomi Wireless switch (lumi.sensor_switch) via ZHA

Hi,
I’m totally a newbie with this type of technology… so I went the easiest path and used ZHA with ConBee II.

I see others seem to have success with the Mi Wireless Switch (WXKG01LM). For me, however, pairing them stays forever in the Device Found - Starting Interview state.

Screenshot 2021-01-13 at 23.25.44
This is the log output from the web interface:

0x0000:zdo] ZDO request ZDOCmd.Mgmt_Permit_Joining_req: [60, <Bool.false: 0>]
[0x957F:1:0x0b04]: async_update
Device 0x74c1 (00:15:8d:00:04:5a:13:ae) joined the network
Device 00:15:8d:00:04:5a:13:ae changed id (0x90f5 => 0x74c1)
[0x74c1:zdo] ZDO request ZDOCmd.Device_annce: [0x74C1, 00:15:8d:00:04:5a:13:ae, 128]
[0x74c1] Requesting 'Node Descriptor'
Tries remaining: 2
[0x74c1] Extending timeout for 0x69 request
Received frame on uninitialized device 00:15:8d:00:04:5a:13:ae (Status.NEW) for endpoint: 1
[0x74c1] Received ZCL while uninitialized on endpoint id 1, cluster 0x0000 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=0 command_id=Command.Report_Attributes>, payload: b'\x05\x00B\x12lumi.sensor_switch'
[0x74c1] Uninitialized device command 'Command.Report_Attributes' args: [[Attribute(attrid=5, value=<TypeValue type=CharacterString, value=lumi.sensor_switch>)]]
Received frame on uninitialized device 00:15:8d:00:04:5a:13:ae (Status.NEW) for endpoint: 1
[0x74c1] Received ZCL while uninitialized on endpoint id 1, cluster 0x0000 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=1 command_id=Command.Report_Attributes>, payload: b'\x01\x00 \n'
[0x74c1] Uninitialized device command 'Command.Report_Attributes' args: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=10>)]]
Received frame on uninitialized device 00:15:8d:00:04:5a:13:ae (Status.NEW) for endpoint: 1
[0x74c1] Received ZCL while uninitialized on endpoint id 1, cluster 0x0000 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=True is_reply=True disable_default_response=True> manufacturer=4660 tsn=2 command_id=Command.Report_Attributes>, payload: b'\x02\xffL\x06\x00\x10\x01!\x00\x0c!\xa8\x01$\x00\x00\x00\x00\x00!\x0c\x01 ['
[0x74c1] Uninitialized device command 'Command.Report_Attributes' args: [[Attribute(attrid=65282, value=<TypeValue type=ZCLStructure, value=[<TypeValue type=Bool, value=Bool.true>, <TypeValue type=uint16_t, value=3072>, <TypeValue type=uint16_t, value=424>, <TypeValue type=uint40_t, value=0>, <TypeValue type=uint16_t, value=268>, <TypeValue type=uint8_t, value=91>]>)]]
[0x74c1] Delivery error for seq # 0x69, on endpoint id 0 cluster 0x0002: message send failure
Tries remaining: 1
[0x74c1] Extending timeout for 0x6b request
[0x74c1] Delivery error for seq # 0x6b, on endpoint id 0 cluster 0x0002: message send failure
[0x74c1] Requesting Node Descriptor failed
[0x74c1] Discovering endpoints
Tries remaining: 3
[0x74c1] Extending timeout for 0x6d request
[0x74c1] Delivery error for seq # 0x6d, on endpoint id 0 cluster 0x0005: message send failure
Tries remaining: 2
[0x74c1] Extending timeout for 0x6f request
[0x957F:1:0x0b04]: async_update
[0x74c1] Delivery error for seq # 0x6f, on endpoint id 0 cluster 0x0005: message send failure
Tries remaining: 1
[0x74c1] Extending timeout for 0x71 request
[0x74c1] Delivery error for seq # 0x71, on endpoint id 0 cluster 0x0005: message send failure
[0x74c1] Failed to discover active endpoints
[0x957F:1:0x0b04]: async_update

This is the log output found in home-assistant.log:

2021-01-13 23:25:54 INFO (MainThread) [zigpy.device] [0x74c1] Discovering endpoints
2021-01-13 23:25:54 DEBUG (MainThread) [zigpy.util] Tries remaining: 3
2021-01-13 23:25:54 DEBUG (MainThread) [zigpy.device] [0x74c1] Extending timeout for 0x6d request
2021-01-13 23:25:54 DEBUG (MainThread) [zigpy_deconz.zigbee.application] Sending Zigbee request with tsn 109 under 110 request id, data: b'6dc174'
2021-01-13 23:25:54 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_request (18, 110, 0, <DeconzAddressEndpoint address_mode=2 address=29889 endpoint=0>, 0, <ZDOCmd.Active_EP_req: 0x0005>, 0, b'm\xc1t', 2, 0)
2021-01-13 23:25:54 DEBUG (MainThread) [zigpy_deconz.uart] Send: 0x12b800190012006e0002c17400000005000003006dc1740200
2021-01-13 23:25:54 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x12b80009000200226e
2021-01-13 23:25:54 DEBUG (MainThread) [zigpy_deconz.api] APS data request response: [2, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, 110]
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x0eb9000700a600
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_CONFIRM|2: 166>, 0]
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_confirm (0,)
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.uart] Send: 0x04b90007000000
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x04b90013000c00226e02c1740000f000000000
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.api] APS data confirm response for request with id 110: f0
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.api] Request id: 0x6e 'aps_data_confirm' for <DeconzAddressEndpoint address_mode=ADDRESS_MODE.NWK address=0x74c1 endpoint=0>, status: 0xf0
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.zigbee.application] Error while sending 110 req id frame: TXStatus.MAC_TRANSACTION_EXPIRED
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy.device] [0x74c1] Delivery error for seq # 0x6d, on endpoint id 0 cluster 0x0005: message send failure
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy.util] Tries remaining: 2
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy.device] [0x74c1] Extending timeout for 0x6f request
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.zigbee.application] Sending Zigbee request with tsn 111 under 112 request id, data: b'6fc174'
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_request (18, 112, 0, <DeconzAddressEndpoint address_mode=2 address=29889 endpoint=0>, 0, <ZDOCmd.Active_EP_req: 0x0005>, 0, b'o\xc1t', 2, 0)
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.uart] Send: 0x12ba0019001200700002c17400000005000003006fc1740200
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x12ba00090002002270
2021-01-13 23:26:02 DEBUG (MainThread) [zigpy_deconz.api] APS data request response: [2, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, 112]
2021-01-13 23:26:05 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x957F:1:0x0b04]: async_update
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x0ebb000700a600
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_CONFIRM|2: 166>, 0]
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_confirm (0,)
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.uart] Send: 0x04bb0007000000
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x04bb0013000c00227002c1740000f000000000
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.api] APS data confirm response for request with id 112: f0
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.api] Request id: 0x70 'aps_data_confirm' for <DeconzAddressEndpoint address_mode=ADDRESS_MODE.NWK address=0x74c1 endpoint=0>, status: 0xf0
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.zigbee.application] Error while sending 112 req id frame: TXStatus.MAC_TRANSACTION_EXPIRED
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy.device] [0x74c1] Delivery error for seq # 0x6f, on endpoint id 0 cluster 0x0005: message send failure
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy.util] Tries remaining: 1
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy.device] [0x74c1] Extending timeout for 0x71 request
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.zigbee.application] Sending Zigbee request with tsn 113 under 114 request id, data: b'71c174'
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_request (18, 114, 0, <DeconzAddressEndpoint address_mode=2 address=29889 endpoint=0>, 0, <ZDOCmd.Active_EP_req: 0x0005>, 0, b'q\xc1t', 2, 0)
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.uart] Send: 0x12bc0019001200720002c174000000050000030071c1740200
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x12bc00090002002272
2021-01-13 23:26:10 DEBUG (MainThread) [zigpy_deconz.api] APS data request response: [2, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, 114]
2021-01-13 23:26:18 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x0ebd000700a600
2021-01-13 23:26:18 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_CONFIRM|2: 166>, 0]
2021-01-13 23:26:18 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_confirm (0,)
2021-01-13 23:26:18 DEBUG (MainThread) [zigpy_deconz.uart] Send: 0x04bd0007000000
2021-01-13 23:26:18 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x04bd0013000c00227202c1740000f000000000
2021-01-13 23:26:18 DEBUG (MainThread) [zigpy_deconz.api] APS data confirm response for request with id 114: f0
2021-01-13 23:26:18 DEBUG (MainThread) [zigpy_deconz.api] Request id: 0x72 'aps_data_confirm' for <DeconzAddressEndpoint address_mode=ADDRESS_MODE.NWK address=0x74c1 endpoint=0>, status: 0xf0
2021-01-13 23:26:18 DEBUG (MainThread) [zigpy_deconz.zigbee.application] Error while sending 114 req id frame: TXStatus.MAC_TRANSACTION_EXPIRED
2021-01-13 23:26:18 DEBUG (MainThread) [zigpy.device] [0x74c1] Delivery error for seq # 0x71, on endpoint id 0 cluster 0x0005: message send failure
2021-01-13 23:26:18 WARNING (MainThread) [zigpy.device] [0x74c1] Failed to discover active endpoints
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/zigpy/device.py", line 119, in _initialize
    status, _, endpoints = await self.zdo.Active_EP_req(
  File "/usr/local/lib/python3.8/site-packages/zigpy/util.py", line 110, in retry
    r = await func()
  File "/usr/local/lib/python3.8/site-packages/zigpy/device.py", line 214, in request
    raise zigpy.exceptions.DeliveryError(
zigpy.exceptions.DeliveryError: [0x74c1:0:0x0005]: Message send failure
2021-01-13 23:26:35 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x957F:1:0x0b04]: async_update
2021-01-13 23:27:05 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x957F:1:0x0b04]: async_update

Can anyone help me with this, please? Any firmware to update? I’m running 2021.1.1 on Home Assistant OS. Other devices SONOFFs, as well as Xiaomi Smart Plug and Temperature Sensor work fine.

Thanks
Steffen

Hello @stephenking!

Check this thread: ZHA - Xiaomi Mijia Wireless Button (WXKG01LM) Pairing issues
I also had issues with that hardware, easily solved with @BarTouZ tip! :smiley:
Try that, and report back hehe

1 Like

Oh, wow! Thanks for pointing me to this! It indeed worked!

My previous search didn’t reveal that thread.

1 Like

For me the button is not pairing. I keep seeing the Starting Interview screen. I press on the button during the pair, I see that my bridge is getting this data

Received frame on uninitialized device 00:15:8d:00:05:bd:b2:2d (Status.NEW) for endpoint: 1
[0x886e] Received ZCL while uninitialized on endpoint id 1, cluster 0x0006 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=19 command_id=Command.Report_Attributes>, payload: b'\x00\x80 \x02'
[0x886e] Uninitialized device command 'Command.Report_Attributes' args: [[Attribute(attrid=32768, value=<TypeValue type=uint8_t, value=2>)]]

But it never pairs.

Are you pressing it firmly enough so that you really press the pairing button? It took me also 2-3 pairing tries until it really worked.

Hi, I tried several times. It just won’t pair.
When I start the pair I see this in my logs, I see the lumi.sensor_switch:

Device 0xb47e (00:15:8d:00:05:bd:b2:2d) joined the network
[0xb47e] Requesting 'Node Descriptor'
Tries remaining: 2
[0xb47e] Extending timeout for 0x27 request
Device 0xb47e (00:15:8d:00:05:bd:b2:2d) joined the network
Skip initialization for existing device 00:15:8d:00:05:bd:b2:2d
Device 0xb47e (00:15:8d:00:05:bd:b2:2d) joined the network
Skip initialization for existing device 00:15:8d:00:05:bd:b2:2d
[0xb47e:zdo] ZDO request ZDOCmd.Device_annce: [0xB47E, 00:15:8d:00:05:bd:b2:2d, 128]
Received frame on uninitialized device 00:15:8d:00:05:bd:b2:2d (Status.NEW) for endpoint: 1
[0xb47e] Received ZCL while uninitialized on endpoint id 1, cluster 0x0000 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=0 command_id=Command.Report_Attributes>, payload: b'\x05\x00B\x12lumi.sensor_switch'
[0xb47e] Uninitialized device command 'Command.Report_Attributes' args: [[Attribute(attrid=5, value=<TypeValue type=CharacterString, value=lumi.sensor_switch>)]]

Then I press the button several times with a few seconds interval. Every time I press the button I se a receiving message in the logs. I see different ones when I double/tripple or hold the button, so there is a communication. This response is my previous post. The value 2 on the last line corresponds to a double click.
Then there are these lines:

[0xb47e] Delivery error for seq # 0x27, on endpoint id 0 cluster 0x0002: message send failure
Tries remaining: 1
[0xb47e] Extending timeout for 0x29 request

and

[0xb47e] Requesting Node Descriptor failed
[0xb47e] Discovering endpoints
Tries remaining: 3
[0xb47e] Extending timeout for 0x2b request

It just won’t pair no matter how many times I pressed the button. For now, I skip this button and use an other.

Ohm I think I misread the post. I’m pressing the normal button during the pairing process. I now am thinking I should press the pairing button again…

Yes, exactly! Make sure that you see the LED blinking to confirm that you really presses the pairing button on the back.

I also can confirm, pushing the pair button solves this issue. Thanks!

1 Like