zbBridge + ZHA + Aqara E1 = only one gang reports it's state

Hi all! My first post here, hopefully i didn’t miss anything.

My situation is the following:
Aqara E1 switch, when being paired, sometimes don’t recognized as having double rocker, only one switch is available, and it works both ways (HA to switch and back). When i’m trying to pair it once more, second switch shows up in HA, but it only works form HA to switch, and rocker presses on the second gang don’t get reported to HA.

If I try to read clusters manually OnOff @ 0x0006, endpoint id 2 (2nd rocker), value changes from Bool.false to Bool.true, which tells that HA can in fact receive rocker state, but it foesnt happen automatically.

Please, help me with trying to understand who’s fault is it at this point, and what i can do.
Thanks in advance!

Config is:
Sonoff zbBridge flashed with Tasmota 10.0.0
ZHA integration
Aqara E1 switch QBKG39LM - no neutral, double rocker, QBKG39LM
Home Assistant 2021.11.0, hassio, Raspberry Pi 3b+

Pairing log (failed pairing - only 1 gang active):

[0x6113:1:0x0406] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=189 command_id=Command.Report_Attributes>
[0x6113:1:0x0406] ZCL request 0x000a: [[Attribute(attrid=0, value=<TypeValue type=bitmap8, value=bitmap8.1>)]]
[0x6113:1:0x0406] Attribute report received: occupancy=1
[0x6113:1:0x0500]: Updated alarm state: 1
[0xf844:1:0x0500] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=124 command_id=0>
[0xf844:1:0x0500] ZCL request 0x0000: [<ZoneStatus.Alarm_1: 1>, <bitmap8.0: 0>, 0, 0]
[0xF844:1:0x0500]: Updated alarm state: ZoneStatus.Alarm_1
New device 0x6984 (54:ef:44:10:00:17:e9:2a) joined the network
[0x6984] Scheduling initialization
Tries remaining: 3
[0x6984] Requesting 'Node Descriptor'
Tries remaining: 2
[0x6984] Extending timeout for 0x36 request
Device 0x6984 (54:ef:44:10:00:17:e9:2a) joined the network
[0x6984] Scheduling initialization
[0x6984] Canceling old initialize call
Received frame on uninitialized device <Device model=None manuf=None nwk=0x6984 ieee=54:ef:44:10:00:17:e9:2a is_initialized=False> from ep 0 to ep 0, cluster 19: b'\xd3\x84i*\xe9\x17\x00\x10D\xefT\x80'
[0x6984:zdo] ZDO request ZDOCmd.Device_annce: [0x6984, 54:ef:44:10:00:17:e9:2a, 128]
Tries remaining: 3
[0x6984] Requesting 'Node Descriptor'
Tries remaining: 2
[0x6984] Extending timeout for 0x38 request
Received frame on uninitialized device <Device model=None manuf=None nwk=0x6984 ieee=54:ef:44:10:00:17:e9:2a is_initialized=False> from ep 0 to ep 0, cluster 2: b'\xd4\x00\x00'
[0x6984:zdo] ZDO request ZDOCmd.Node_Desc_req: [0x0000]
[0x6984:zdo] Unsupported ZDO request:ZDOCmd.Node_Desc_req
Received frame on uninitialized device <Device model=None manuf=None nwk=0x6984 ieee=54:ef:44:10:00:17:e9:2a is_initialized=False> from ep 0 to ep 0, cluster 32770: b'6\x00\x84i\x02@\x80_\x11\x7fd\x00\x00,d\x00\x00'
[0x6984:zdo] ZDO request ZDOCmd.Node_Desc_rsp: [<Status.SUCCESS: 0>, 0x6984, 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=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, 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)]
[0x6984:zdo] Unsupported ZDO request:ZDOCmd.Node_Desc_rsp
Received frame on uninitialized device <Device model=None manuf=None nwk=0x6984 ieee=54:ef:44:10:00:17:e9:2a is_initialized=False> from ep 0 to ep 0, cluster 32770: b'8\x00\x84i\x02@\x80_\x11\x7fd\x00\x00,d\x00\x00'
[0x6984] Got 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=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, 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)
[0x6984] Discovering endpoints
Tries remaining: 3
[0x6984] Extending timeout for 0x3a request
Received frame on uninitialized device <Device model=None manuf=None nwk=0x6984 ieee=54:ef:44:10:00:17:e9:2a is_initialized=False> from ep 0 to ep 0, cluster 54: b'\xd5\xb4\x01'
[0x6984:zdo] ZDO request ZDOCmd.Mgmt_Permit_Joining_req: [180, <Bool.true: 1>]
Received frame on uninitialized device <Device model=None manuf=None nwk=0x6984 ieee=54:ef:44:10:00:17:e9:2a is_initialized=False> from ep 0 to ep 0, cluster 32773: b':\x00\x84i\x03\x01\x02\xf2'
[0x6984] Discovered endpoints: [1, 2, 242]
[0x6984] Initializing endpoints [<Endpoint id=1 in=[] out=[] status=<Status.NEW: 0>>, <Endpoint id=2 in=[] out=[] status=<Status.NEW: 0>>, <Endpoint id=242 in=[] out=[] status=<Status.NEW: 0>>]
[0x6984:1] Discovering endpoint information
Tries remaining: 3
[0x6984] Extending timeout for 0x3c request
Received frame on uninitialized device <Device model=None manuf=None nwk=0x6984 ieee=54:ef:44:10:00:17:e9:2a is_initialized=False> from ep 0 to ep 0, cluster 32772: b'<\x00\x84i\x1a\x01\x04\x01\x00\x01\x01\x07\x00\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\t\x00\x02\n\x00\x19\x00'
[0x6984:1] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=256, device_version=1, input_clusters=[0, 2, 3, 4, 5, 6, 9], output_clusters=[10, 25])
[0x6984:2] Discovering endpoint information
Tries remaining: 3
[0x6984] Extending timeout for 0x3e request
Received frame on uninitialized device <Device model=None manuf=None nwk=0x6984 ieee=54:ef:44:10:00:17:e9:2a is_initialized=False> from ep 0 to ep 0, cluster 32772: b'>\x00\x84i\x12\x02\x04\x01\x00\x01\x01\x05\x00\x00\x03\x00\x04\x00\x05\x00\x06\x00\x00'
[0x6984:2] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=2, profile=260, device_type=256, device_version=1, input_clusters=[0, 3, 4, 5, 6], output_clusters=[])
[0x6984:242] Discovering endpoint information
Tries remaining: 3
[0x6984] Extending timeout for 0x40 request
Received frame on uninitialized device <Device model=None manuf=None nwk=0x6984 ieee=54:ef:44:10:00:17:e9:2a is_initialized=False> from ep 0 to ep 0, cluster 32772: b'@\x00\x84i\n\xf2\xe0\xa1a\x00\x00\x00\x01!\x00'
[0x6984:242] Discovered endpoint information: SizePrefixedSimpleDescriptor(endpoint=242, profile=41440, device_type=97, device_version=0, input_clusters=[], output_clusters=[33])
[0x6984] Extending timeout for 0x42 request
[0x6984:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=66 command_id=Command.Read_Attributes_rsp>
[0x6984] Read model 'lumi.switch.b2lc04' and manufacturer 'LUMI' from <Endpoint id=1 in=[basic:0x0000, device_temperature:0x0002, identify:0x0003, groups:0x0004, scenes:0x0005, on_off:0x0006, alarms:0x0009] out=[time:0x000A, ota:0x0019] status=<Status.ZDO_INIT: 1>>
[0x6984] Discovered basic device information for <Device model='lumi.switch.b2lc04' manuf='LUMI' nwk=0x6984 ieee=54:ef:44:10:00:17:e9:2a is_initialized=True>
Device is initialized <Device model='lumi.switch.b2lc04' manuf='LUMI' nwk=0x6984 ieee=54:ef:44:10:00:17:e9:2a is_initialized=True>
Checking quirks for LUMI lumi.switch.b2lc04 (54:ef:44:10:00:17:e9:2a)
Considering <class 'zhaquirks.xbee.xbee_io.XBeeSensor'>
Fail because endpoint list mismatch: {232, 230} {1, 2, 242}
Considering <class 'zhaquirks.xbee.xbee3_io.XBee3Sensor'>
Fail because endpoint list mismatch: {232, 230} {1, 2, 242}
Considering <class 'zhaquirks.smartthings.tag_v4.SmartThingsTagV4'>
Fail because endpoint list mismatch: {1} {1, 2, 242}
Considering <class 'zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor'>
Fail because endpoint list mismatch: {1} {1, 2, 242}
Considering <class 'zhaquirks.netvox.z308e3ed.Z308E3ED'>
Fail because endpoint list mismatch: {1} {1, 2, 242}
Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'>
Fail because endpoint list mismatch: {11, 13} {1, 2, 242}
Considering <class 'bellows.zigbee.application.EZSPCoordinator'>
Fail because endpoint list mismatch: {1} {1, 2, 242}
device - 0x6984:54:ef:44:10:00:17:e9:2a entering async_device_initialized - is_new_join: True
device - 0x6984:54:ef:44:10:00:17:e9:2a has joined the ZHA zigbee network
[0x6984](lumi.switch.b2lc04): started configuration
[0x6984:ZDO](lumi.switch.b2lc04): 'async_configure' stage succeeded
Error handling '_save_attribute' event with (54:ef:44:10:00:17:e9:2a, 1, 0, 4, 'LUMI') params: FOREIGN KEY constraint failed
[0x6984] Extending timeout for 0x44 request
[0x6984:1:0x0000]: finished channel configuration
[0x6984:1:0x0019]: finished channel configuration
[0x6984] Extending timeout for 0x46 request
[0x6984:2:0x0000]: finished channel configuration
Error handling '_save_attribute' event with (54:ef:44:10:00:17:e9:2a, 1, 0, 5, 'lumi.switch.b2lc04') params: FOREIGN KEY constraint failed
[0x6984:1:0x0006]: bound 'on_off' cluster: Status.SUCCESS
[0x6984] Extending timeout for 0x48 request
[0x6984:2:0x0006]: bound 'on_off' cluster: Status.SUCCESS
[0x6984] Extending timeout for 0x4a request
[0x6984:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=72 command_id=Command.Configure_Reporting_rsp>
[0x6984:1:0x0006]: Successfully configured reporting for '{'on_off': (0, 900, 1)}' on 'on_off' cluster: [ConfigureReportingResponseRecord(status=0)]
[0x6984:1:0x0006]: finished channel configuration
[0x6984:1:0x0006]: 'async_configure' stage succeeded
[0x6984:1:0x0000]: 'async_configure' stage succeeded
[0x6984:1:0x0019]: 'async_configure' stage succeeded
[0x6984:2:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=74 command_id=Command.Configure_Reporting_rsp>
[0x6984:2:0x0006]: Successfully configured reporting for 'set()' on 'on_off' cluster
[0x6984:2:0x0006]: Failed to configure reporting for '['on_off']' on 'on_off' cluster: [ConfigureReportingResponseRecord(status=193, direction=0, attrid=0)]
[0x6984:2:0x0006]: finished channel configuration
[0x6984:2:0x0006]: 'async_configure' stage succeeded
[0x6984:2:0x0000]: 'async_configure' stage succeeded
[0x6984](lumi.switch.b2lc04): completed configuration
[0x6984](lumi.switch.b2lc04): stored in registry: ZhaDeviceEntry(name='LUMI lumi.switch.b2lc04', ieee='54:ef:44:10:00:17:e9:2a', last_seen=1636060571.4203372)
[0x6984] Extending timeout for 0x4c request
[0x6984:zdo] ZDO request ZDOCmd.Match_Desc_req: [0xFFFD, 260, [25], []]
[0x6984:1:0x0003] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=76 command_id=Command.Default_Response>
[0x6984:1:0x0003]: executed 'trigger_effect' command with args: '(2, 0)' kwargs: '{}' result: [64, <Status.UNSUP_CLUSTER_COMMAND: 129>]
[0x6984](lumi.switch.b2lc04): started initialization
[0x6984:ZDO](lumi.switch.b2lc04): 'async_initialize' stage succeeded
[0x6984:1:0x0006]: initializing channel: from_cache: False
[0x6984] Extending timeout for 0x4f request
[0x6984:1:0x0000]: initializing channel: from_cache: False
[0x6984:1:0x0000]: finished channel initialization
[0x6984:1:0x0019]: initializing channel: from_cache: False
[0x6984:1:0x0019]: finished channel initialization
[0x6984:2:0x0006]: initializing channel: from_cache: False
[0x6984] Extending timeout for 0x51 request
[0x6984:2:0x0000]: initializing channel: from_cache: False
[0x6984:2:0x0000]: finished channel initialization
[0x6984:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=79 command_id=Command.Read_Attributes_rsp>
[0x6984:1:0x0006]: finished channel initialization
[0x6984:1:0x0006]: 'async_initialize' stage succeeded
[0x6984:1:0x0000]: 'async_initialize' stage succeeded
[0x6984:1:0x0019]: 'async_initialize' stage succeeded
[0x6984:2:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=81 command_id=Command.Read_Attributes_rsp>
[0x6984:2:0x0006]: finished channel initialization
[0x6984:2:0x0006]: 'async_initialize' stage succeeded
[0x6984:2:0x0000]: 'async_initialize' stage succeeded
[0x6984](lumi.switch.b2lc04): power source: Battery or Unknown
[0x6984](lumi.switch.b2lc04): completed initialization
None: polling current state
[0x6984] Extending timeout for 0x53 request
None: polling current state
[0x6984] Extending timeout for 0x55 request
[0x6984:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=83 command_id=Command.Read_Attributes_rsp>
[0x6984:2:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=85 command_id=Command.Read_Attributes_rsp>
[0x6984:zdo] ZDO request ZDOCmd.IEEE_addr_req: [0x0000, 0, 0]
[0x6984:1:0x0019] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=77 command_id=1>
[0x6984:1:0x0019] ZCL request 0x0001: [0, 4447, 6664, 20, None]
[0x6984:1:0x0019] OTA query_next_image handler for 'LUMI lumi.switch.b2lc04': field_control=0, manufacture_id=4447, image_type=6664, current_file_version=20, hardware_version=None
[0x6984:1:0x0019] No OTA image is available

Zigbee signature:

{
  "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=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, 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": "0x0100",
      "in_clusters": [
        "0x0000",
        "0x0002",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0009"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "2": {
      "profile_id": 260,
      "device_type": "0x0100",
      "in_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006"
      ],
      "out_clusters": []
    },
    "242": {
      "profile_id": 41440,
      "device_type": "0x0061",
      "in_clusters": [],
      "out_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "LUMI",
  "model": "lumi.switch.b2lc04",
  "class": "zigpy.device.Device"

Any ideas on this one?
Tried to switch to zigbee2mqtt, it’s powerful indeed, but somehow i keep getting timeout errors, which effectively hang whole zigbee activity, rendering the system unusable.
Any help with this issue would be greatly appreciated!

Support for the zbBridge in zigbee2mqtt is experimental, and development seems to be stopped.

It is probably a bit too late here, but I’ve found that pressing the other gang to reset had solved the issue of ZHA only showing a single gang.

I have a 2-gang variant, and I initially pressed the right one to reset, and it appeared in ZHA. Then, I resetted the device a few times to try and get the left one to show up, but no luck.

Out of frustration I pressed the left gang 7s to reset the switch again, and this time both showed up. The communication between the switch and HA was laggy just as before, but the status did update from both sides. The lag is presumably because of the low LQI of just 123 (yes, this is not made up).

I also found that, after toggling the switch once in HA, subsequent toggles are super fast. I’ll try setting up a bandaid fix to keep the switch alive (stay in the quick-response mode) somehow.

P.S. This is the only thread I’ve found while googleing, hope that I could help someone else later.