Aqara Remote Switch button presses not translated to command (Zigbee binding)

Hello everybody. Recently I’ve decided to start my journey with the home automation and, after investigating the topic and deciding not to go into any proprietary solutions, ended up getting OpenHAB running on Raspberry Pi 4 with XBee WRL-15128 S2C module, connected to the serial port GPIO pins. After spending some time with Xbee’s XCTU I’ve finally managed to bind my first two Aqara devices together from the PaperUI - wall plug and the door opening sensor. Those two things have the expected channels exposed (ON/OFF for the door sensor, ON/OFF and power consumption for the smart plug) and binding them to the items as well as creating some initial rules wasn’t a problem. There are some yet-to-be-fixed bugs with Xbee on the Zigbee binding like the problem with transaction queue, which results in lag on the module->openhab communication, but once that’s done, the automation will work equally as fast as with the official Aqara gateway.

However, I’ve stumbled into what I’ve been worried will happen sooner or later when I go with Zigbee instead of ZWave - not all the Zigbee-based devices are strictly documented and intercompatible. Namely - the battery-powered Aqara Remote Switch. This thing looks and feels quite well built and would make a fantastic remote to stick wherever I could possibly imagine, but instead it’s driving me crazy. After putting it in the discovery mode (hold the button until the two LEDs on the bottom start blinking), openHAB discovers the Zigbee device thing once I add it from the inbox - you can see the actual properties in the figure 1 below the post.

As you can see, although it managed to fetch some properties and resolve info like the vendor and model identifier (lumi.remote.b286acn01), the error has occurred, with the “no supported clusters found” error message, further described in the logs:

20:14:32.193 [INFO ] [smarthome.event.ThingUpdatedEvent    ] - Thing 'zigbee:device:2e46c6b5:00158d00027bd41a' has been updated.
20:14:32.193 [DEBUG] [ing.zigbee.handler.ZigBeeThingHandler] - 00158D00027BD41A: Checking endpoint 1 channels
20:14:32.196 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - TX ZCL: ZclHeader [frameType=ENTIRE_PROFILE_COMMAND, manufacturerSpecific=false, direction=SERVER_TO_CLIENT, disableDefaultResponse=false, manufacturerCode=0, sequenceNumber=221, commandId=0]
20:14:32.202 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - TX APS: ZigBeeApsFrame [sourceAddress=0000/1, destinationAddress=9190/1, profile=0104, cluster=0019, addressMode=DEVICE, radius=31, apsSecurity=false, ackRequest=true, apsCounter=C7, rssi=--, lqi=--, payload=08 DD 00 02 00]
20:14:32.204 [DEBUG] [s.zigbee.dongle.xbee.ZigBeeDongleXBee] - XBee send: XBeeTransmitRequestExplicitCommand [frameId=null, ieeeAddress=00158D00027BD41A, networkAddress=37264, sourceEndpoint=1, destinationEndpoint=1, cluster=25, profileId=260, broadcastRadius=0, options=[], data=08 DD 00 02 00]
20:14:32.206 [DEBUG] [dongle.xbee.internal.XBeeFrameHandler] - TX XBEE queue: 1: XBeeTransmitRequestExplicitCommand [frameId=222, ieeeAddress=00158D00027BD41A, networkAddress=37264, sourceEndpoint=1, destinationEndpoint=1, cluster=25, profileId=260, broadcastRadius=0, options=[], data=08 DD 00 02 00]
20:14:32.208 [DEBUG] [dongle.xbee.internal.XBeeFrameHandler] - TX XBEE: XBeeTransmitRequestExplicitCommand [frameId=222, ieeeAddress=00158D00027BD41A, networkAddress=37264, sourceEndpoint=1, destinationEndpoint=1, cluster=25, profileId=260, broadcastRadius=0, options=[], data=08 DD 00 02 00]
20:14:32.210 [DEBUG] [ing.zigbee.handler.ZigBeeThingHandler] - 00158D00027BD41A: Checking endpoint 2 channels
20:14:32.211 [DEBUG] [dongle.xbee.internal.XBeeFrameHandler] - TX XBEE Data: 00 19 11 DE 00 15 8D 00 02 7B D4 1A 91 90 01 01 00 19 01 04 00 00 08 DD 00 02 00 DB
20:14:32.217 [DEBUG] [ing.zigbee.handler.ZigBeeThingHandler] - 00158D00027BD41A: Checking endpoint 3 channels
20:14:32.226 [DEBUG] [ing.zigbee.handler.ZigBeeThingHandler] - 00158D00027BD41A: Dynamically created 0 channels
20:14:32.229 [DEBUG] [ing.zigbee.handler.ZigBeeThingHandler] - 00158D00027BD41A: Initializing device
20:14:32.231 [DEBUG] [ing.zigbee.handler.ZigBeeThingHandler] - 00158D00027BD41A: Channel initialisation complete
20:14:32.233 [WARN ] [ing.zigbee.handler.ZigBeeThingHandler] - 00158D00027BD41A: No supported clusters found
20:14:32.237 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'zigbee:device:2e46c6b5:00158d00027bd41a' changed from OFFLINE: Node has not completed discovery to OFFLINE (HANDLER_INITIALIZING_ERROR): No supported clusters found

However, once I get back to the inbox and start the discovery, I will be able to add another device with the same MAC address, as you can see in the figure 2 below the post.

On the first look everything is okay - it’s online, has the properties resolved (shouldn’t it be Remote Switch instead of Wall Switch though?) and most importantly - it has the channels. The problem is that only the range check channel (clicking arbitrary button 5 times) is receiving the triggers I could use in the rules:

20:25:02.877 [DEBUG] [dongle.xbee.internal.XBeeFrameHandler] - RX XBEE Data: 00 2E 91 FF FF FF FF FF FF FF FF 91 90 01 01 00 00 01 04 00 18 0A 0A 05 00 42 15 6C 75 6D 69 2E 72 65 6D 6F 74 65 2E 62 32 38 36 61 63 6E 30 31 92
20:25:02.883 [DEBUG] [dongle.xbee.internal.XBeeFrameHandler] - RX XBEE: XBeeReceivePacketExplicitEvent [ieeeAddress=FFFFFFFFFFFFFFFF, networkAddress=37264, sourceEndpoint=1, destinationEndpoint=1, clusterId=0, profileId=260, receiveOptions=UNKNOWN, data=18 0A 0A 05 00 42 15 6C 75 6D 69 2E 72 65 6D 6F 74 65 2E 62 32 38 36 61 63 6E 30 31]
20:25:02.897 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - RX APS: ZigBeeApsFrame [sourceAddress=9190/1, destinationAddress=0000/1, profile=0104, cluster=0000, addressMode=null, radius=0, apsSecurity=false, ackRequest=false, apsCounter=--, rssi=--, lqi=--, payload=18 0A 0A 05 00 42 15 6C 75 6D 69 2E 72 65 6D 6F 74 65 2E 62 32 38 36 61 63 6E 30 31]
20:25:02.904 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - RX ZCL: ZclHeader [frameType=ENTIRE_PROFILE_COMMAND, manufacturerSpecific=false, direction=SERVER_TO_CLIENT, disableDefaultResponse=true, manufacturerCode=0, sequenceNumber=10, commandId=10]
20:25:02.911 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - RX CMD: ReportAttributesCommand [Basic: 9190/1 -> 0000/1, cluster=0000, TID=0A, reports=[AttributeReport [attributeDataType=CHARACTER_STRING, attributeIdentifier=5, attributeValue=lumi.remote.b286acn01]]]
20:25:02.917 [DEBUG] [.transaction.ZigBeeTransactionManager] - notifyTransactionCommand: ReportAttributesCommand [Basic: 9190/1 -> 0000/1, cluster=0000, TID=0A, reports=[AttributeReport [attributeDataType=CHARACTER_STRING, attributeIdentifier=5, attributeValue=lumi.remote.b286acn01]]] 
20:25:02.925 [DEBUG] [onverter.ZigBeeConverterGenericButton] - 00158D00027BD41A: Matching ZigBee attribute for press type shortpress received: ZclAttribute [cluster=Basic, id=5, name=Model Identifier, dataType=CHARACTER_STRING, lastValue=lumi.remote.b286acn01, lastReportTime=Tue Jun 30 20:25:02 CEST 2020, implemented=false]
20:25:02.930 [DEBUG] [ing.zigbee.handler.ZigBeeThingHandler] - 00158D00027BD41A: Triggering ZigBee channel zigbee:xiaomi_lumiremoteb286acn01:2e46c6b5:00158d00027bd41a:range-check with event SHORT_PRESSED
20:25:02.938 [INFO ] [smarthome.event.ChannelTriggeredEvent] - zigbee:xiaomi_lumiremoteb286acn01:2e46c6b5:00158d00027bd41a:range-check triggered SHORT_PRESSED

Pressing the actual button, no matter if left or right, results with the following message being logged in the Zigbee debug logs:

20:24:38.298 [DEBUG] [dongle.xbee.internal.XBeeFrameHandler] - RX XBEE Data: 00 1A 91 FF FF FF FF FF FF FF FF 91 90 01 01 00 12 01 04 00 18 09 0A 55 00 21 01 00 9A
20:24:38.308 [DEBUG] [dongle.xbee.internal.XBeeFrameHandler] - RX XBEE: XBeeReceivePacketExplicitEvent [ieeeAddress=FFFFFFFFFFFFFFFF, networkAddress=37264, sourceEndpoint=1, destinationEndpoint=1, clusterId=18, profileId=260, receiveOptions=UNKNOWN, data=18 09 0A 55 00 21 01 00]
20:24:38.316 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - RX APS: ZigBeeApsFrame [sourceAddress=9190/1, destinationAddress=0000/1, profile=0104, cluster=0012, addressMode=null, radius=0, apsSecurity=false, ackRequest=false, apsCounter=--, rssi=--, lqi=--, payload=18 09 0A 55 00 21 01 00]
20:24:38.324 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - RX ZCL: ZclHeader [frameType=ENTIRE_PROFILE_COMMAND, manufacturerSpecific=false, direction=SERVER_TO_CLIENT, disableDefaultResponse=true, manufacturerCode=0, sequenceNumber=9, commandId=10]
20:24:38.331 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - Unsupported local client cluster 0012
20:24:38.334 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - Incoming message from node 9190 did not translate to command

So, the XBee module is handling the incoming signal properly (also blinks its LED) and passes it to the code, so it doesn’t look like the module firmware configuration problem. The situation certainly doesn’t look as bad as with the Aqara light bulb, which got the window blinds and humidity channels exposed after adding it from inbox, but still - it’s not really working. :stuck_out_tongue: What’s more, I end up with having two separate things, as depicted in the figure 3 below the post.

When I remove the faulty thing, the working one gets kicked out from the Zigbee network:

20:29:44.947 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - 00158D00027BD41A: No successful response received to leave command (status code 65535)
20:29:44.951 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - 00158D00027BD41A: Force-removing node from the node list after unsuccessful leave request
20:29:44.956 [DEBUG] [rtsystems.zigbee.ZigBeeNetworkManager] - 00158D00027BD41A: Node 9190 is removed from the network
20:29:44.960 [DEBUG] [ee.transaction.ZigBeeTransactionQueue] - 00158D00027BD41A: Queue shutdown
20:29:44.961 [DEBUG] [pp.discovery.ZigBeeDiscoveryExtension] - 00158D00027BD41A: DISCOVERY Extension: Removing discoverer
20:29:44.982 [DEBUG] [.transaction.ZigBeeTransactionManager] - 00158D00027BD41A: Removing queue from transaction manager
20:29:44.985 [DEBUG] [discovery.ZigBeeNodeServiceDiscoverer] - 00158D00027BD41A: Node SVC Discovery: stopped
20:29:44.993 [INFO ] [smarthome.event.ThingUpdatedEvent    ] - Thing 'zigbee:xiaomi_lumiremoteb286acn01:2e46c6b5:00158d00027bd41a' has been updated.
20:29:44.998 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'zigbee:xiaomi_lumiremoteb286acn01:2e46c6b5:00158d00027bd41a' changed from ONLINE to OFFLINE (GONE)

According to the Zigbee binding documentation, Remote Switch is supported. Did anybody experience the same problems as I did? Could it be that I’m doing something wrong that two devices are appearing in my inbox and list of things? Is there any way to “extract” the necessary information from the PaperUI-added that would help me in building the .things file manually, which I could put then in the configuration directory on the Raspberry Pi? In case it’s a bug, on which repository on Github should I create a bug issue and describe it in detail there as well?

PS. Sorry for posting everything as one image with references, forum doesn’t allow to post more than one image per post for new users, but it wouldn’t be possible to show the issue properly without it. :frowning: