[Edge] Driver for Aqara Switches and Remotes

literally zero results.

please send a direct link from the https://zigbee.blakadder.com/

@veonua

I think the correct p/n is QBKG29LM

This have implementation in Z2M libraries:

Z2M Code
{
        zigbeeModel: ['lumi.switch.l3acn1'],
        model: 'QBKG29LM',
        vendor: 'Xiaomi',
        description: 'Aqara smart wall switch H1 EU (no neutral, triple rocker)',
        fromZigbee: [fz.on_off, fz.xiaomi_multistate_action, fz.aqara_opple],
        toZigbee: [tz.on_off, tz.xiaomi_switch_operation_mode_opple, tz.xiaomi_switch_power_outage_memory,
            tz.xiaomi_flip_indicator_light, tz.xiaomi_led_disabled_night, tz.aqara_switch_mode_switch],
        meta: {multiEndpoint: true},
        endpoint: (device) => ({left: 1, center: 2, right: 3}),
        exposes: [
            e.switch().withEndpoint('left'), e.switch().withEndpoint('center'), e.switch().withEndpoint('right'),
            e.power_outage_memory(), e.flip_indicator_light(), e.led_disabled_night(), e.power_outage_count(),
            exposes
                .enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
                .withDescription('Decoupled mode for left button')
                .withEndpoint('left'),
            exposes
                .enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
                .withDescription('Decoupled mode for center button')
                .withEndpoint('center'),
            exposes
                .enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
                .withDescription('Decoupled mode for right button')
                .withEndpoint('right'),
            exposes
                .enum('mode_switch', ea.ALL, ['anti_flicker_mode', 'quick_mode'])
                .withDescription(
                    'Anti flicker mode can be used to solve blinking issues of some lights.' +
                    'Quick mode makes the device respond faster.'),
            e.device_temperature().withAccess(ea.STATE),
            e.action([
                'single_left', 'double_left', 'single_center', 'double_center', 'single_right', 'double_right',
                'single_left_center', 'double_left_center', 'single_left_right', 'double_left_right',
                'single_center_right', 'double_center_right', 'single_all', 'double_all',
            ]),
        ],
        onEvent: preventReset,
        configure: async (device, coordinatorEndpoint, logger) => {
            await device.getEndpoint(1).write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f, disableResponse: true});
        },
    },

Hi @veonua , @dotan_shai is right. My apologies for the typo!

try v1.12.
the Decoupled mode for the 3rd(right) button will not work. I don’t know the code.
But other functions should work if we are lucky (and the device supports the Opple protocol)

Hi I’m trying to obtain the logs for my device in ST.

I’m not tech trained so I have difficulty finding the cli edge logs

Could you help me with a step by step guide to getting the logs ?

Sorry to trouble you.

Your help is most appreciated

Try this step:

2 Likes

Works like a charm, thank you so much!

1 Like

I have 2 x WXKG02LM that I bought in 2016 and I was never able to pair it with Smartthings hub. I think I finally managed to do it. But they are just sitting there and I am not able to do anything with them. They are called Thing and I can’t do anything with them from the mobile app. When I press on the device nothing happens. When I go to IDE and thing this device here is what I see

  • application: 05
  • endpointId: 01
  • manufacturer: LUMI
  • model: lumi.sensor_86sw2Un
  • zigbeeNodeType: SLEEPY_END_DEVICE

When I go to see the events, nothing shows up, not the button presses, nothing. Any idea what the issue is? Do I have a defective switch? I have 1.12 drivers installed on my hub. I also have WXKG01LM that I bought around the same time and I was able to pair it to the hub and it is working perfectly.

Anything that shows up as a “Thing” has not connected to a usable driver and will not work.

You need to go find a driver that works.

I have a WXKG02LM and I am using the following driver

This used to be supported with Device Handler Type (obsolete solution) , @veonua can you please look here:

and convert/add to your driver. This should not be too difficult

Hi Dotan

I managed to get into CLI and run the log that i needed. Thank you so much for reaching out! I am very very grateful for the help!!!

Many thanks lanpeng

1 Like

try v 1.13…

I didn’t find a good list of the supported actions for your model,
it seems like different firmware versions support different actions. so now it’s defaulted to single and double press.

2 Likes

Thank you so much, it is working perfectly. 7 years later and I can finally take advantage of these two switches I bought!!

3 Likes

Hi @veonua
Is it poosible to add Single Switch Module T1 (With Neutral) Model DLKZMK11LM,

zigbeeModel: lumi.switch.n0acn2

Thanks…

It is a different type of equipment that requires the creation of a new profile.
Unfortunately, I am unaware of the features that can be integrated into the ST.

1 Like

Just informing you and others,
My friend manage to control DLKZMK11LM with Generic EF00 cluster driver by @w35l3y
using switch profile.

It only gives the ability to on/off control but it is OK for her. I hope that one day @veonua will add this to his edge driver that will give more capabilities (like power measurements, disable led etc.) in the future. If someone is interested the driver by @w35l3y can be installed from here:

2 Likes

I have two of the (apparently) same switches, Aqara WXKG16LM.

I had both of them paired under the old Groovy regime and they worked fine, but at some point a change somewhere in the stack caused them to eat batteries like crazy.

When these Edge drivers became available, I upgraded and they seemed to work well for a while. More recently, they’ve been periodically going offline and I have to re-pair them, but once I do they work again.

This time, however, when I tried to re-pair them, one them began working again, but the other – though it appeared to pair okay according to the App – never seems to generate button press events. The error log below shows the same error as OP: [string “st/zigbee/device_management.lua”]:103: attempt to index a nil value (field ‘data_type’).

It’s perplexing that one works and the other doesn’t; I’ve tried deleting and re-pairing multiple times and rebooting my hub to no avail.

Any suggestions?

P.S. One other symptom, perhaps unrelated: when ST does find the device during pairing, it typically shows 2 or 3 instances of the device in the App UI. They’re obviously the same device underneath the hood, as changing the name of any one of them changes the name of all of them.

2023-05-05T18:52:17.362383332+00:00 TRACE Xiaomi/Aqara Switch and Button v1.13  Received event with handler device_lifecycle
2023-05-05T18:52:17.438934916+00:00 TRACE Xiaomi/Aqara Switch and Button v1.13  Zigbee Device: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10
Manufacturer: LUMI Model: lumi.remote.b1acn01
	[1]: Basic, 0x0012, Identify
2023-05-05T18:52:17.439517166+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  <ZigbeeDevice: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10 [0xCAFE] (WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker))> received lifecycle event: added
2023-05-05T18:52:17.440466416+00:00 TRACE Xiaomi/Aqara Switch and Button v1.13  Received event with handler device_lifecycle
2023-05-05T18:52:17.441083166+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  <ZigbeeDevice: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10 [0xCAFE] (WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker))> received lifecycle event: doConfigure
2023-05-05T18:52:17.453927332+00:00 TRACE Xiaomi/Aqara Switch and Button v1.13  Found DeviceLifecycleDispatcher handler in switch
2023-05-05T18:52:17.456182374+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  Ep#1 device_id:0x0103 profile_id:0x0104 model:'lumi.remote.b1acn01' manufacturer:'LUMI' Client clusters:[Basic, ] Server clusters:[Basic, MultistateInput, Identify, ]
2023-05-05T18:52:17.456884041+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  Found config for device: lumi.remote.b1acn01 {"first_switch_ep":0,"first_button_ep":1,"supported_button_values":["pushed","held","pushed_2x","pushed_3x","pushed_4x","pushed_5x"]}
2023-05-05T18:52:17.457596291+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  <ZigbeeDevice: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10 [0xCAFE] (WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker))> emitting event: {"attribute_id":"supportedButtonValues","capability_id":"button","component_id":"main","state":{"value":["pushed","held","pushed_2x","pushed_3x","pushed_4x","pushed_5x"]}}
2023-05-05T18:52:17.469903957+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  number of buttons:	1
2023-05-05T18:52:17.471919124+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  <ZigbeeDevice: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10 [0xCAFE] (WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker))> emitting event: {"attribute_id":"numberOfButtons","capability_id":"button","component_id":"main","state":{"value":1}}
2023-05-05T18:52:17.478894541+00:00 DEBUG Xiaomi/Aqara Switch and Button v1.13  WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker) device thread event handled
2023-05-05T18:52:17.487841166+00:00 TRACE Xiaomi/Aqara Switch and Button v1.13  Found DeviceLifecycleDispatcher handler in switch
2023-05-05T18:52:17.495081707+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  Ep#1 device_id:0x0103 profile_id:0x0104 model:'lumi.remote.b1acn01' manufacturer:'LUMI' Client clusters:[Basic, ] Server clusters:[Basic, MultistateInput, Identify, ]
2023-05-05T18:52:17.495660291+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  Found config for device: lumi.remote.b1acn01 {"first_switch_ep":0,"first_button_ep":1,"supported_button_values":["pushed","held","pushed_2x","pushed_3x","pushed_4x","pushed_5x"]}
2023-05-05T18:52:17.496334624+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  <ZigbeeDevice: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10 [0xCAFE] (WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker))> emitting event: {"attribute_id":"supportedButtonValues","capability_id":"button","component_id":"main","state":{"value":["pushed","held","pushed_2x","pushed_3x","pushed_4x","pushed_5x"]}}
2023-05-05T18:52:17.499907207+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  number of buttons:	1
2023-05-05T18:52:17.500788707+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  <ZigbeeDevice: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10 [0xCAFE] (WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker))> emitting event: {"attribute_id":"numberOfButtons","capability_id":"button","component_id":"main","state":{"value":1}}
2023-05-05T18:52:17.505491374+00:00 DEBUG Xiaomi/Aqara Switch and Button v1.13  WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker) device thread event handled
2023-05-05T18:52:17.518219582+00:00 TRACE Xiaomi/Aqara Switch and Button v1.13  Found DeviceLifecycleDispatcher handler in switch
2023-05-05T18:52:17.518782832+00:00 TRACE Xiaomi/Aqara Switch and Button v1.13  Found CapabilityCommandDispatcher handler in switch
2023-05-05T18:52:17.519432291+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  Ep#1 device_id:0x0103 profile_id:0x0104 model:'lumi.remote.b1acn01' manufacturer:'LUMI' Client clusters:[Basic, ] Server clusters:[Basic, MultistateInput, Identify, ]
2023-05-05T18:52:17.520058457+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  Found config for device: lumi.remote.b1acn01 {"first_switch_ep":0,"first_button_ep":1,"supported_button_values":["pushed","held","pushed_2x","pushed_3x","pushed_4x","pushed_5x"]}
2023-05-05T18:52:17.520681541+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  <ZigbeeDevice: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10 [0xCAFE] (WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker))> emitting event: {"attribute_id":"supportedButtonValues","capability_id":"button","component_id":"main","state":{"value":["pushed","held","pushed_2x","pushed_3x","pushed_4x","pushed_5x"]}}
2023-05-05T18:52:17.529074957+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  number of buttons:	1
2023-05-05T18:52:17.529871499+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  <ZigbeeDevice: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10 [0xCAFE] (WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker))> emitting event: {"attribute_id":"numberOfButtons","capability_id":"button","component_id":"main","state":{"value":1}}
2023-05-05T18:52:17.539592374+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  <ZigbeeDevice: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10 [0xCAFE] (WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker))> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xCAFE, dest_endpoint: 0x01, profile: 0x0000, cluster: 0x0021 >, < ZDOMessageBody || < ZDOHeader || seqno: 0x00 >, < BindRequest || src_address: 00158D0009108EA8, src_endpoint: 0x01, cluster: 0x0012, dest_addr_mode: 0x03, dest_address: 24FD5B0000026E42, dest_endpoint: 0x01 > > >
2023-05-05T18:52:17.557734457+00:00 ERROR Xiaomi/Aqara Switch and Button v1.13  WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker) thread encountered error: [string "st/dispatcher.lua"]:233: Error encountered while processing event for <ZigbeeDevice: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10 [0xCAFE] (WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker))>:
    arg1: doConfigure
    arg2: table: 0x2491c30
[string "st/zigbee/device_management.lua"]:103: attempt to index a nil value (field 'data_type')
2023-05-05T18:52:17.565061124+00:00 DEBUG Xiaomi/Aqara Switch and Button v1.13  WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker) device thread event handled
2023-05-05T18:52:17.812814832+00:00 TRACE Xiaomi/Aqara Switch and Button v1.13  Received event with handler device_lifecycle
2023-05-05T18:52:17.813590707+00:00 INFO Xiaomi/Aqara Switch and Button v1.13  <ZigbeeDevice: 1f8a5cb5-2350-4fff-9728-87f2ade7ee10 [0xCAFE] (WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker))> received lifecycle event: infoChanged
2023-05-05T18:52:17.819963249+00:00 TRACE Xiaomi/Aqara Switch and Button v1.13  Found DeviceLifecycleDispatcher handler in switch
2023-05-05T18:52:17.822087041+00:00 DEBUG Xiaomi/Aqara Switch and Button v1.13  WXKG11LM (remote.b1acn01) Wireless Switch (Single Rocker) device thread event handled

Your device is WXKG11LM while my device is WXKG16LM they look the same but the ZigBee messages are different. No existing driver for WXKG16LM for now, hopefully @veonua will repair the driver soon . I also have few WXKG11LM which work with no problems with @veonua driver. Look like your 2nd WXKG11LM is damage , I will try to replace the batteries and also buy a new device. The error that you are having does not appear when I create logs.

likely it has nothing to do with drivers, your wireless network is not good enough to keep devices working. You need to install compatible wired devices to act as a signal repeater. Please search this forum on the topic of how to build the Aqara network.

I had two buttons connected and working perfectly until Tuesday night. The first was the two gang switch I mentioned. The second was WXKG01LM. Now both switches are showing up as on standby but when I press them they are not registering any events. The driver version still shows up as 1.13 on the hub. Did something happen with the system in the last 48 hours?