Device Handler for Aqara 2 Gang Wired Wall Switch no Neutral

Just tried out the new DH and it works great with the neutral version QBKG23LM!

Physical interactions (both on and off) with the switch is now being recognized and reflected on the app. Software interactions (both on and off) with the switch via the SmartThings app is still working as previously.

Though there seems to be a new error exception being thrown which doesn’t seem to affect the operations.

e79d175f-4f6c-48a9-b971-298cd1438247 7:28:34 AM: error groovy.lang.MissingMethodException: No signature of method: script_dth_df83b7ab4dd3a0ca0eefd3742a3e089ce73ad15e0ab818b58e595e287122285e.diplayDebugLog() is applicable for argument types: (java.lang.String) values: [Endpoint 0x000C seen and ignored] @line 558 (parseReportAttributeMessage)

Here are some logs in case you’re interested:

Physical Press On

e79d175f-4f6c-48a9-b971-298cd1438247 7:28:34 AM: error groovy.lang.MissingMethodException: No signature of method: script_dth_df83b7ab4dd3a0ca0eefd3742a3e089ce73ad15e0ab818b58e595e287122285e.diplayDebugLog() is applicable for argument types: (java.lang.String) values: [Endpoint 0x000C seen and ignored] @line 558 (parseReportAttributeMessage)
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:34 AM: debug Water Heater Parsing 'read attr - raw: 9BB402000C0E550039EC51B83F, dni: 9BB4, endpoint: 02, cluster: 000C, size: 14, attrId: 0055, result: success, encoding: 39, value: 3fb851ec'
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:08 AM: debug Water Heater Parse returned: [[name:switch, value:on, isStateChange:true, linkText:Water Heater, descriptionText:Water Heater switch is on, displayed:true], [name:button, value:pushed, data:[buttonNumber:1], isStateChange:true, linkText:Water Heater, descriptionText:Water Heater button is pushed, displayed:true], [name:lastCheckin, value:07:28:08 Sun 06 Dec (SGT)
hard, descriptionText:Check-In, displayed:true, linkText:Water Heater, isStateChange:true]]
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:08 AM: debug Water Heater parsing flags: hard on null null 1607210888143
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:08 AM: debug Water Heater Endpoint 0x0012 seen for hard press.
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:08 AM: debug Water Heater Parsing 'read attr - raw: 9BB40500120A5500210100, dni: 9BB4, endpoint: 05, cluster: 0012, size: 10, attrId: 0055, result: success, encoding: 21, value: 0001'
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:07 AM: debug Water Heater Parse returned: [[name:lastCheckin, value:07:28:07 Sun 06 Dec (SGT)
hard, descriptionText:Check-In, displayed:true, linkText:Water Heater, isStateChange:true]]
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:07 AM: debug Water Heater parsing flags: null on null null 1607210887600
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:07 AM: debug Water Heater Parsing 'read attr - raw: 9BB4010006160000100100F02300B49B03, dni: 9BB4, endpoint: 01, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 039bb40023f00001'
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:07 AM: debug Water Heater Parsing 'read attr - raw: 9BB4010006160000100100F02300B49B03, dni: 9BB4, endpoint: 01, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 039bb40023f00001'
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:04 AM: debug Water Heater Parse returned: [[name:temperature, value:32, unit:C, linkText:Water Heater, descriptionText:Water Heater temperature is 32°C, isStateChange:false, displayed:false], [name:lastCheckin, value:07:28:04 Sun 06 Dec (SGT)
hard, descriptionText:Check-In, displayed:true, linkText:Water Heater, isStateChange:true]]
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:04 AM: debug Water Heater parsing flags: null null null null 1607210884287
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:04 AM: debug Water Heater DH synced with hardware - off - off
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:04 AM: debug Water Heater Number of Switches: 1
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:04 AM: debug Water Heater setTemp: [[name:temperature, value:32, unit:C, linkText:Water Heater, descriptionText:Water Heater temperature is 32°C, isStateChange:false, displayed:false]]
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:04 AM: debug Water Heater Temperature is now 32°
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:04 AM: debug Water Heater Map: [100:false, 3:32, 152:0.0, 149:0.044225506, 5:17, 154:0, 8:4157, 7:0, 9:256]
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:04 AM: debug Water Heater SmartShield(text: null, manufacturerId: 0x115f, direction: 0x01, data: [0x01, 0xff, 0x42, 0x2b, 0x64, 0x10, 0x00, 0x03, 0x28, 0x20, 0x98, 0x39, 0x00, 0x00, 0x00, 0x00, 0x95, 0x39, 0xce, 0x25, 0x35, 0x3d, 0x05, 0x21, 0x11, 0x00, 0x9a, 0x20, 0x00, 0x08, 0x21, 0x3d, 0x10, 0x07, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x21, 0x00, 0x01], number: null, isManufacturerSpecific: true, messageType: 0x00, senderShortId: 0x9bb4, isClusterSpecific: false, sourceEndpoint: 0x01, profileId: 0x0104, command: 0x0a, clusterId: 0x0000, destinationEndpoint: 0x01, options: 0x0000)
e79d175f-4f6c-48a9-b971-298cd1438247 7:28:04 AM: debug Water Heater Parsing 'catchall: 0104 0000 01 01 0000 00 9BB4 00 01 115F 0A 01 01FF422B6410000328209839000000009539CE25353D052111009A200008213D100727000000000000000009210001'

Physical Press Off

e79d175f-4f6c-48a9-b971-298cd1438247 7:35:48 AM: debug Water Heater Parse returned: [[name:switch, value:off, linkText:Water Heater, descriptionText:Water Heater switch is off, isStateChange:true, displayed:true], [name:button, value:pushed, data:[buttonNumber:1], isStateChange:true, linkText:Water Heater, descriptionText:Water Heater button is pushed, displayed:true], [name:lastCheckin, value:07:35:48 Sun 06 Dec (SGT)
hard, descriptionText:Check-In, displayed:true, linkText:Water Heater, isStateChange:true]]
e79d175f-4f6c-48a9-b971-298cd1438247 7:35:48 AM: debug Water Heater parsing flags: hard off null null 1607211348600
e79d175f-4f6c-48a9-b971-298cd1438247 7:35:48 AM: debug Water Heater Endpoint 0x0012 seen for hard press.
e79d175f-4f6c-48a9-b971-298cd1438247 7:35:48 AM: debug Water Heater Parsing 'read attr - raw: 9BB40500120A5500210100, dni: 9BB4, endpoint: 05, cluster: 0012, size: 10, attrId: 0055, result: success, encoding: 21, value: 0001'
e79d175f-4f6c-48a9-b971-298cd1438247 7:35:47 AM: debug Water Heater Parse returned: [[name:lastCheckin, value:07:35:47 Sun 06 Dec (SGT)
hard, descriptionText:Check-In, displayed:true, linkText:Water Heater, isStateChange:true]]
e79d175f-4f6c-48a9-b971-298cd1438247 7:35:47 AM: debug Water Heater parsing flags: null off null null 1607211347798
e79d175f-4f6c-48a9-b971-298cd1438247 7:35:47 AM: debug Water Heater Parsing 'read attr - raw: 9BB4010006160000100000F02300B49B03, dni: 9BB4, endpoint: 01, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 039bb40023f00000'
e79d175f-4f6c-48a9-b971-298cd1438247 7:35:47 AM: error groovy.lang.MissingMethodException: No signature of method: script_dth_df83b7ab4dd3a0ca0eefd3742a3e089ce73ad15e0ab818b58e595e287122285e.diplayDebugLog() is applicable for argument types: (java.lang.String) values: [Endpoint 0x000C seen and ignored] @line 558 (parseReportAttributeMessage)
e79d175f-4f6c-48a9-b971-298cd1438247 7:35:47 AM: debug Water Heater Parsing 'read attr - raw: 9BB402000C0E55003900000000, dni: 9BB4, endpoint: 02, cluster: 000C, size: 14, attrId: 0055, result: success, encoding: 39, value: 00000000'

I just checked the debug settings are true for the device.

Also another thing I noticed is that the device does not check in itself in the smarthing,
last online show as 19 hours ago…

|Last Activity At|2020-12-05 3:06 PM EST|
| — | — |
|Date Created|2020-12-04 9:51 AM EST|
|Last Updated|2020-12-06 10:20 AM EST|

I’ve posted another updated version, which should make the power visible in the History as well as getting rid of the error message you reported.

I’m a bit puzzled by your statement that the device does not check in. The first few lines of your ‘Physical Press On’ posting (at the bottom) are what I would expect to see when the device checks in. Can you tell me how often such lines appear in your logs?

@aonghusmor
These healthpoll is not for the switch, they are for other zigbee devices smartthings hub connected
I did not see any healthpoll for the switch devices at all. any suggestions?
Here is the screenshot show that switches last activity is a day ago…

Apologies. I got confused between the various messages coming from different people. It looks like the newer, D1, switches don’t check in in the same way as the older ones. I have actually included some code to try to force this to happen, but it isn’t working. I’ve inserted some code which may help to fix this.

@aonghusmor Thank you for your help! Right now it is working for me in the APP , already beyond my expectation! :slight_smile:

@aonghusmor
When I have time, I will update the device handler for D1 3Gangs, I will let you know the result. Thanks again!

evening @aonghusmor. I just updated the DH and my system is now acting odd. I have the D1 2 paddle no neutral, second paddle wired. it was working with the older DH - ie right paddle turned on a light and the left (unwired) was acting as a button - and was a child device in the IDE. I updated the DH for the right wired paddle and left the left as a child. but now in the new app the left child works - though not as a button but as a switch and the right one does not work at all programmatically (works fine physically).

I wonder, should I remove from SM and repair with the new DH which will create a fresh child? I have the correct switch labeled as unwired in settings (I see this now has options for up to 3 switches so it is the latest DH).

if so, very happy to try this but not sure how to put the switch into (de)pairing mode?

  • also, keen to get the power monitoring working!

thanks for all your work on this, loving mucking around with these.

Al.

PS: I tried changing a setting (temp offset) to force a reset too.

Hi! Are you able to post a log of what happens when you attempt this.

Also I note that you say " updated the DH for the right wired paddle and left the left as a child". It looks like there may be some crossed lines somewhere. I updated the DH a few weeks ago to create its own children rather than to use another smartapp to do this. It should now behave such that the left switch is in the main DH and the right is a child.

I have now posted a version with the following amendments:

  1. Power (in Watts) appears in the History when available. I think this is confined to the with neutral switches. Energy consumption in kWh may be available, but I’ve only seen a zero for that quantity so far, so have not included it.
  2. Code added to respond to poll() and ping() from the hub. This should force a response from the switch at least once per hour. May be required by the new D1 switches, which do not appear to check-in automatically

Thanks for the update @aonghusmor

Just loaded in and did several tests

Now First button works when pushed it virtually
Virtually press two child switches start to work after sometimes
Physical press switches no logs recorded, switch status not updated in APP

======Main Switch========

dfb11cdc-a8af-4800-ac71-2286fff64221 1:36:14 PM: debug Aqara Switch QBKG25LM Parse returned: [[name:switch, value:on, isStateChange:true, linkText:Aqara Switch QBKG25LM, descriptionText:Aqara Switch QBKG25LM switch is on, displayed:true], [name:button, value:pushed, data:[buttonNumber:1], isStateChange:true, linkText:Aqara Switch QBKG25LM, descriptionText:Aqara Switch QBKG25LM button is pushed, displayed:true], [name:lastCheckin, value:13:36:14 Tue 08 Dec (EST)
soft, descriptionText:Check-In, displayed:true, linkText:Aqara Switch QBKG25LM, isStateChange:true]]
dfb11cdc-a8af-4800-ac71-2286fff64221 1:36:14 PM: debug Aqara Switch QBKG25LM parsing flags: soft on null null 1607452574005
dfb11cdc-a8af-4800-ac71-2286fff64221 1:36:14 PM: debug Aqara Switch QBKG25LM SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x01, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x21ee, isClusterSpecific: false, sourceEndpoint: 0x01, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
dfb11cdc-a8af-4800-ac71-2286fff64221 1:36:14 PM: debug Aqara Switch QBKG25LM Parsing ‘catchall: 0104 0006 01 01 0000 00 21EE 00 00 0000 0B 01 0100’
dfb11cdc-a8af-4800-ac71-2286fff64221 1:36:13 PM: debug Aqara Switch QBKG25LM [st cmd 0x21EE 0x01 0x0006 0x01 {}, delay 2000]

Virtually press Child switches
=====Press other two Child Switch===

dfb11cdc-a8af-4800-ac71-2286fff64221 1:33:30 PM: debug Aqara Switch QBKG25LM Parse returned: [[name:button, value:pushed, data:[buttonNumber:5], isStateChange:true, linkText:Aqara Switch QBKG25LM, descriptionText:Aqara Switch QBKG25LM button is pushed, displayed:true], [name:lastCheckin, value:13:33:30 Tue 08 Dec (EST)
soft, descriptionText:Check-In, displayed:true, linkText:Aqara Switch QBKG25LM, isStateChange:true]]
dfb11cdc-a8af-4800-ac71-2286fff64221 1:33:30 PM: debug Aqara Switch QBKG25LM parsing flags: soft null null off 1607452410584
dfb11cdc-a8af-4800-ac71-2286fff64221 1:33:30 PM: debug Aqara Switch QBKG25LM SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x00, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x21ee, isClusterSpecific: false, sourceEndpoint: 0x03, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
dfb11cdc-a8af-4800-ac71-2286fff64221 1:33:30 PM: debug Aqara Switch QBKG25LM Parsing ‘catchall: 0104 0006 03 01 0000 00 21EE 00 00 0000 0B 01 0000’
1:33:30 PM: debug Aqara Switch QBKG25LM SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x00, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x21ee, isClusterSpecific: false, sourceEndpoint: 0x03, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
dfb11cdc-a8af-4800-ac71-2286fff64221 1:33:30 PM: debug Aqara Switch QBKG25LM Parsing ‘catchall: 0104 0006 03 01 0000 00 21EE 00 00 0000 0B 01 0000’
dfb11cdc-a8af-4800-ac71-2286fff64221 1:33:30 PM: debug Aqara Switch QBKG25LM [st cmd 0x21EE 0x03 0x0006 0x00 {}, delay 2000]

dfb11cdc-a8af-4800-ac71-2286fff64221 1:32:05 PM: debug Aqara Switch QBKG25LM Parse returned: [[name:button, value:pushed, data:[buttonNumber:3], isStateChange:true, linkText:Aqara Switch QBKG25LM, descriptionText:Aqara Switch QBKG25LM button is pushed, displayed:true], [name:lastCheckin, value:13:32:05 Tue 08 Dec (EST)
soft, descriptionText:Check-In, displayed:true, linkText:Aqara Switch QBKG25LM, isStateChange:true]]
dfb11cdc-a8af-4800-ac71-2286fff64221 1:32:05 PM: debug Aqara Switch QBKG25LM [Aqara Switch QBKG25LM-(3), Aqara Switch QBKG25LM-(2)]
dfb11cdc-a8af-4800-ac71-2286fff64221 1:32:05 PM: debug Aqara Switch QBKG25LM parsing flags: soft null on null 1607452325959
dfb11cdc-a8af-4800-ac71-2286fff64221 1:32:05 PM: debug Aqara Switch QBKG25LM SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x01, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x21ee, isClusterSpecific: false, sourceEndpoint: 0x02, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
dfb11cdc-a8af-4800-ac71-2286fff64221 1:32:05 PM: debug Aqara Switch QBKG25LM Parsing ‘catchall: 0104 0006 02 01 0000 00 21EE 00 00 0000 0B 01 0100’
dfb11cdc-a8af-4800-ac71-2286fff64221 1:32:05 PM: debug Aqara Switch QBKG25LM Parsing ‘catchall: 0104 0006 02 01 0000 00 21EE 00 00 0000 0B 01 0100’
dfb11cdc-a8af-4800-ac71-2286fff64221 1:32:05 PM: debug Aqara Switch QBKG25LM [st cmd 0x21EE 0x02 0x0006 0x01 {}, delay 2000]

Actually after a while, there are something fed in live log every hour

dfb11cdc-a8af-4800-ac71-2286fff64221 11:23:25 PM: debug Aqara Switch QBKG25LM Parse returned: [[name:switch, value:off, linkText:Aqara Switch QBKG25LM, descriptionText:Aqara Switch QBKG25LM switch is off, isStateChange:false, displayed:false], [name:button, value:pushed, data:[buttonNumber:1], isStateChange:true, linkText:Aqara Switch QBKG25LM, descriptionText:Aqara Switch QBKG25LM button is pushed, displayed:true], [name:lastCheckin, value:23:23:25 Tue 08 Dec (EST)
soft, descriptionText:Check-In, displayed:true, linkText:Aqara Switch QBKG25LM, isStateChange:true]]
dfb11cdc-a8af-4800-ac71-2286fff64221 11:23:25 PM: debug Aqara Switch QBKG25LM parsing flags: soft off null null 1607487805541
dfb11cdc-a8af-4800-ac71-2286fff64221 11:23:25 PM: debug Aqara Switch QBKG25LM SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x00, 0x00, 0x00, 0x10, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x21ee, isClusterSpecific: false, sourceEndpoint: 0x01, profileId: 0x0104, command: 0x01, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
dfb11cdc-a8af-4800-ac71-2286fff64221 11:23:25 PM: debug Aqara Switch QBKG25LM Parsing ‘catchall: 0104 0006 01 01 0000 00 21EE 00 00 0000 01 01 0000001000’

Hi,

Thanks @aonghusmor, yes I appreciate the update to remove need for smartapp. I’ve just removed the unit entirely from the IDE and reinstalled using DH from today (Tuesday). I swear the child is the left switch! This works as expected and the app is kept in sync (note it no longer acts as a button). But the right switch (parent) no longer works at all. The app on icon spins but does not update.

I’ve toggled various settings to no avai (last two are true) . Happy to post logs, assume these are from the live logging tab in the IDE (filtered for this device)?

I’m not seeing any power readinga at all.

The updated DH works perfectly for QBKG12LM (old neutral required 2 gang Aqara).

Both physical and app triggered actions register perfectly.

Thanks @aonghusmor!

OK! I see what must be wrong here. Some double switches are numbered 1,2 and others 2,3 (endpoints). I don’t undestand why. So, if yours were in the 2,3 category, but my DH thought it was 1,2 then I can see why we might get this sort of confusion. You press the left switch, the DH gets a message with endpoint 2 and assumes that refers to the right switch. I’ve posted a new version with this changed.
Can you check the information in the IDE under My Devices. Is the model given as lumi.switch.b2lacn02?

Thanks for this! It looks like there may be some confusion about the labelling of the 2 child devices. See the 2nd log down in your 3rd block above. To confirm this, can you go to the IDE, My Devices, and tell me the “Display Name” and the “Device Network ID” of the 2 child devices. In some contexts the code requires one of these labels and in other contexts it needs the other. It is awkward if they can be inconsistent.
The other possibility is that the DH asks smartthings for a list of child devices, but they are not always returned in the same order.

I’m concerned by your statement that physically pressing the switch doesn’t always appear in the logs. That sounds like a problem with the switch.

Thanks @aonghusmor

Attaching screenshot

Physical press the switch never update the switch status, also I did not see any related events in live log
Maybe there is something wrong with the switch. :frowning:

Your listing confirms that the names match up correctly. So it looks like the system sometimes lists the children in a different order. I’ve amended the code so that it is no longer dependent on the order. It’s not very elegant, but it should work.

On the failure of the physical pressing of the switch to appear in the logs, I suggest you look in “My Devices”. Near the bottom of the details for your switch click on “List Events”. Is there anything there which you can match up with physical presses?

Just curious whether your seeing the power and whether it looks sensible. It should appear in the History.

@aonghusmor
I did see some events in the “list events”, but it was events, new events do not show up in there
Just FYI

Aqara Switch QBKG25LM-(3) (Device) Events — [displayed](javascript://) | [all](javascript://) | [from device](javascript://)

Date Source Type Name Value User Displayed Text Changed
[ 2020-12-10 10:20:21.000 AM EST
4 hours ago ] DEVICE switch off Aqara Switch QBKG25LM-(3) switch is off true
[ 2020-12-10 10:20:14.000 AM EST
4 hours ago ] DEVICE switch on Aqara Switch QBKG25LM-(3) switch is on true
[ 2020-12-09 4:16:35.000 PM EST
22 hours ago ] DEVICE switch off Aqara Switch QBKG25LM-(3) switch is off true
[ 2020-12-09 3:34:39.000 PM EST
23 hours ago ] DEVICE switch on Aqara Switch QBKG25LM-(3) switch is on true
[ 2020-12-09 3:34:36.000 PM EST
23 hours ago ] DEVICE switch off Aqara Switch QBKG25LM-(3) switch is off true
[ 2020-12-09 2:36:58.000 PM EST
24 hours ago ] DEVICE switch on Aqara Switch QBKG25LM-(3) switch is on true
[ 2020-12-09 2:36:56.000 PM EST
24 hours ago ] DEVICE switch off Aqara Switch QBKG25LM-(3) switch is off true

evening @aonghusmor,

I am pleased to report that your latest edits have put everything right with my system. Real and app based pushes all record on my 2 button no neutral D1. the parent switch is now the unwired left switch - but the child operates the right switch wired light as expected once more.

pretty sure the syncing in the new app is now better - don’t think the parent (unwired) switch was as synchronised as it now is. Note this is acting as a button (as its unwired) but thats as expected (log reports as button press).

No power recordings as yet but only just updated.

out of interest, which code lines did you alter in the latest revision?