Device Handler for Aqara 2 Gang Wired Wall Switch no Neutral

Can you look at the logs in the IDE and tell me what happens when you press each of the physical switch buttons? I need to know what message the switch is sending to the hub.
At the moment I don’t have any information on how decoupled mode works with these particular switches. I also don’t have one of these switches to experiment with.
As a first test, could you look what appears in the logs when you switch decoupled mode on and off.

I’ve found a way to change modes in the Zigbee 3 devices. So if you like to test my driver please let me know.

When I toggle “Decoupled” option to ON in the app I get this messages:

fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:15:47 PM: debug Aqara Switch 2 Unwired Switches: [null, null]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:15:47 PM: debug Aqara Switch 2 Decoupled: [true, true]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:15:47 PM: debug Aqara Switch 2 [decoupled:true, infoLogging:true, debugLogging:true]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:15:47 PM: debug Aqara Switch 2 [unwiredSwitches:[null, null], decoupled:[false, true], tempNow:30, tempNow2:30]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:15:47 PM: debug Aqara Switch 2 Child Refresh: null 5ADA-1 [null, null] [false, true]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:15:47 PM: info Aqara Switch 2 Child Refresh: 5ADA-1 [5ADA-1] [decoupled:true] 

When I toggle “Decoupled” option to OFF in the app I get this messages:

 fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 [st rattr 0x5ADA 0x01 0x0001 0x0000, delay 2000, st rattr 0x5ADA 0x01 0x0002 0x0000, delay 2000, zcl mfg-code 0x115F, delay 200, zcl global write 0x0000 0xFF22 0x20 {12}, delay 200, send 0x5ADA 0x01 0x01, delay 2000, zcl mfg-code 0x115F, delay 200, zcl global write 0x0000 0xFF23 0x20 {FE}, delay 200, send 0x5ADA 0x01 0x01, delay 2000, zcl mfg-code 0x115F, delay 200, zcl global read 0x0000 0xFF22, delay 200, send 0x5ADA 0x01 0x01, delay 2000, zcl mfg-code 0x115F, delay 200, zcl global read 0x0000 0xFF23, delay 200, send 0x5ADA 0x01 0x01, delay 2000]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 State: [unwiredSwitches:[null, null], decoupled:[false, true], tempNow:30, tempNow2:30, lastTempTime:1633450758613, tempOffset:0, oldOnOff:true, opple:false, numSwitches:2, numButtons:2, endpoints:[1, 2, 243, 5, 6, 245, 246], childDevices:[5ADA-1], refreshOn:false]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 Decoupled: [false, true] false
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 Unwired Switches: [null, null]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 Devices: [5ADA-1]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 Aqara Switch 1 5ADA-1
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 Unwired Switches: [null, null]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 Children(b): [5ADA-1]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 Unwired: [null, null]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 endpoints: [1, 2, 243, 5, 6, 245, 246]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 Decoupled: [false, true]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 [decoupled:false, infoLogging:true, debugLogging:true]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 [unwiredSwitches:[null, null], decoupled:[true, true], tempNow:30, tempNow2:30]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: debug Aqara Switch 2 Child Refresh: null 5ADA-1 [null, null] [true, true]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:19:18 PM: info Aqara Switch 2 Child Refresh: 5ADA-1 [5ADA-1] [decoupled:true] type or paste code here

And when I press on any of the 2 physical buttons, I don’t get anything in the logs regarding to the switch. I have tried a few times, no messages whatsoever

Only if I press the virtual switch buttons in the app I will have messages like this ones:

 fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:58 PM: debug Aqara Switch 2 Parse returned: [[name:switch, value:on, isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 switch is on, displayed:true], [name:lastCheckin, value:19:30:58 Tue 05 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:58 PM: debug Aqara Switch 2 SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x01, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x5ada, isClusterSpecific: false, sourceEndpoint: 0x01, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:58 PM: debug Aqara Switch 2 Parsing 'catchall: 0104 0006 01 01 0000 00 5ADA 00 00 0000 0B 01 0100'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:57 PM: debug Aqara Switch 2 [st cmd 0x5ADA 0x01 0x0006 0x01 {}, delay 2000]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:57 PM: debug Aqara Switch 2 [name:button, value:pushed, data:[buttonNumber:1], isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 button is pushed, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:57 PM: debug Aqara Switch 2 Switch 1 pressed on
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:57 PM: debug Aqara Switch 2 Switch 1 pressed on
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:56 PM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:19:30:56 Tue 05 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:56 PM: debug Aqara Switch 2 {Child 1 [name:switch, value:on, isStateChange:true, linkText:Aqara Switch 1, descriptionText:Aqara Switch 1 switch is on, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:56 PM: debug Aqara Switch 2 SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x01, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x5ada, isClusterSpecific: false, sourceEndpoint: 0x02, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:56 PM: debug Aqara Switch 2 Parsing 'catchall: 0104 0006 02 01 0000 00 5ADA 00 00 0000 0B 01 0100'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:56 PM: debug Aqara Switch 2 SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x01, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x5ada, isClusterSpecific: false, sourceEndpoint: 0x02, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:56 PM: debug Aqara Switch 2 Parsing 'catchall: 0104 0006 02 01 0000 00 5ADA 00 00 0000 0B 01 0100'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:56 PM: debug Aqara Switch 2 ChildOn 5ADA-1 1 [st cmd 0x5ADA 0x02 0x0006 0x01 {}, delay 2000]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:46 PM: debug Aqara Switch 2 Parse returned: [[name:switch, value:off, isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 switch is off, displayed:true], [name:lastCheckin, value:19:30:46 Tue 05 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:46 PM: debug Aqara Switch 2 SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x00, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x5ada, isClusterSpecific: false, sourceEndpoint: 0x01, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:46 PM: debug Aqara Switch 2 Parsing 'catchall: 0104 0006 01 01 0000 00 5ADA 00 00 0000 0B 01 0000'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:46 PM: debug Aqara Switch 2 Parsing 'catchall: 0104 0006 01 01 0000 00 5ADA 00 00 0000 0B 01 0000'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:45 PM: debug Aqara Switch 2 [st cmd 0x5ADA 0x01 0x0006 0x00 {}, delay 2000]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:45 PM: debug Aqara Switch 2 [name:button, value:pushed, data:[buttonNumber:1], isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 button is pushed, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:45 PM: debug Aqara Switch 2 Switch 1 pressed off
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:45 PM: debug Aqara Switch 2 Switch 1 pressed off
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:40 PM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:19:30:40 Tue 05 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:40 PM: debug Aqara Switch 2 {Child 1 [name:switch, value:off, isStateChange:true, linkText:Aqara Switch 1, descriptionText:Aqara Switch 1 switch is off, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:40 PM: debug Aqara Switch 2 SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x00, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x5ada, isClusterSpecific: false, sourceEndpoint: 0x02, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:40 PM: debug Aqara Switch 2 Parsing 'catchall: 0104 0006 02 01 0000 00 5ADA 00 00 0000 0B 01 0000'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:30:39 PM: debug Aqara Switch 2 ChildOff 5ADA-1 1 [st cmd 0x5ADA 0x02 0x0006 0x00 {}, delay 2000] 

I can provide more information if needed.
Thank you

I find it very strange that nothing appears in the logs when the physical switch is pressed. I have heard a similar statement about a related US style switch. This may be a feature of these switches, or it could be a setting which can be changed, possibly related to the ‘decoupled’ setting. I note that there are no standard zigbee responses in these logs, statements copntaining ‘read attr’ for example, but it does react to some zigbee commands, to switch off and on, for example.
I’ll look into it,but can’t promise a quick result.

I think I know how to solve it
long story short the new switches are more like Opple devices. So they have two operation modes

OPPLE_CLUSTER = 0xFCC0, ATTR= 0x0009, mfa = 0x115F, Uint8, operationMode

  • 0 for command mode when switch sends commands to the zigbee group
  • 1 for the old-style events (most likely you want to use this option)

for decuple mode, there is attribute 0x0200 with values 0 or 1 (wired) for the one-button version,
I’d try with the bit map for a multi-button device.

Thanks for this information.
Is there a generally accessible source of this sort of information?

mostly there are pieces from github like

and experiments with my devices

I have posted a new version under the name ‘testcode’, which tries to implement the suggestions from @veonua. I’ve done this with a temporary name as I don’t want to risk making available a potentially bad version after the recent difficulty over multiple children, etc.
I’d be grateful if you,or anybody else, can check whether it works for your switch.

Hi sorry I am beginner when it comes to Smart Things. I just got myself the Smart things hub and a few aqara d1 two rocker non neutral switches. I having been googling for the past 1 hour trying to figure out what to click and I am so confused. At the top there are many github links and I was wondering which one do I click and copy and paste etc. A step by step tutorial would be amazing for some one like me since I have no clue what is going thanks

Hello @aonghusmor I updated the DTH, still nothing. Should I delete the official DTH, and re-add the Switch, or just changing the DTH to testcode it’s enough ?

I’ve just fixed a minor error in ‘testcode’, which may have prevented the change being effective.
No need to delete anything, but if you change the DTH it’s usually worthwhile to restart the mobile app, to make sure the change has taken effect properly.
I’d like to know what appears in the logs when you do that and if anything appears in the logs when you press the physical switches.

Now we got something, but only for the main rocker. For the child device(second rocker) I got nothing.

Messages when turning the Switch On:

 fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:05:07 AM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:03:05:07 Sun 10 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:05:07 AM: debug Aqara Switch 2 unknown cluster in [raw:5ADA01FCC04EF700412364100165100103281A052103009A20000A2169360B20000D230B0E00000E2300000000, dni:5ADA, endpoint:01, cluster:FCC0, size:78, attrId:00f7, result:success, encoding:41, value:00000000230e00000e0b230d00200b3669210a00209a000321051a280301106501106423]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:05:07 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA01FCC04EF700412364100165100103281A052103009A20000A2169360B20000D230B0E00000E2300000000, dni: 5ADA, endpoint: 01, cluster: FCC0, size: 78, attrId: 00f7, result: success, encoding: 41, value: 00000000230e00000e0b230d00200b3669210a00209a000321051a280301106501106423'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:05:07 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA01FCC04EF700412364100165100103281A052103009A20000A2169360B20000D230B0E00000E2300000000, dni: 5ADA, endpoint: 01, cluster: FCC0, size: 78, attrId: 00f7, result: success, encoding: 41, value: 00000000230e00000e0b230d00200b3669210a00209a000321051a280301106501106423'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:03:08 AM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:03:03:08 Sun 10 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:false]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:03:08 AM: debug Aqara Switch 2 invalid rad attr code
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:03:08 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA3300120A5500210100, dni: 5ADA, endpoint: 33, cluster: 0012, size: 10, attrId: 0055, result: success, encoding: 21, value: 0001'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:03:08 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA3300120A5500210100, dni: 5ADA, endpoint: 33, cluster: 0012, size: 10, attrId: 0055, result: success, encoding: 21, value: 0001'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:03:08 AM: debug Aqara Switch 2 Parse returned: [[name:switch, value:on, isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 switch is on, displayed:true], [name:lastCheckin, value:03:03:08 Sun 10 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:false]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:03:08 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0100061600001001F5002300DA5A03, dni: 5ADA, endpoint: 01, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 035ada002300f501'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:03:08 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0100061600001001F5002300DA5A03, dni: 5ADA, endpoint: 01, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 035ada002300f501' 

Messages when turning the Switch Off:

 fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:08:25 AM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:03:08:25 Sun 10 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:false]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:08:25 AM: debug Aqara Switch 2 invalid rad attr code
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:08:25 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA3300120A5500210100, dni: 5ADA, endpoint: 33, cluster: 0012, size: 10, attrId: 0055, result: success, encoding: 21, value: 0001'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:08:25 AM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:03:08:25 Sun 10 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:false]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:08:25 AM: debug Aqara Switch 2 {Child 1 [name:switch, value:off, isStateChange:true, linkText:Aqara Switch 1, descriptionText:Aqara Switch 1 switch is off, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:08:25 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0200061600001000F5002300DA5A03, dni: 5ADA, endpoint: 02, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 035ada002300f500'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:08:25 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0200061600001000F5002300DA5A03, dni: 5ADA, endpoint: 02, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 035ada002300f500'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:08:25 AM: debug Aqara Switch 2 Parse returned: [[name:switch, value:off, isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 switch is off, displayed:true], [name:lastCheckin, value:03:08:25 Sun 10 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:08:25 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0100061600001000F5002300DA5A03, dni: 5ADA, endpoint: 01, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 035ada002300f500'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 12:08:25 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0100061600001000F5002300DA5A03, dni: 5ADA, endpoint: 01, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 035ada002300f500' 

Decoupled mode is still ignored by the settings.

Please let me know if I need to test more, and as always, thank you for helping us

That looks like progress. I’ve made a couple of small changes and posted a new version of ‘testcode’. Let me know what happens.

When the Decoupled option from the app for the Main Device and the Child device is set to TRUE:

 fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:47:46 PM: debug Aqara Switch 2 Child Refresh: null 5ADA-1 [false, false] [true, true]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:47:46 PM: info Aqara Switch 2 Child Refresh: 5ADA-1 [5ADA-1] [unwired:false, decoupled:true]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:47:25 PM: debug Aqara Switch 2 Children(b): [5ADA-1]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:47:25 PM: debug Aqara Switch 2 [unwiredSwitches:[false, false], decoupled:[false, false], tempNow:30, tempNow2:30]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:47:25 PM: debug Aqara Switch 2 [unwired:false, decoupled:true, infoLogging:true, debugLogging:true]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:47:25 PM: info Aqara Switch 2 refreshing
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:47:25 PM: debug Aqara Switch 2 Child Refresh: null 5ADA-1 [false, false] [false, false]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:47:25 PM: info Aqara Switch 2 Child Refresh: 5ADA-1 [5ADA-1] [unwired:false, decoupled:false]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:47:25 PM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:19:47:25 Mon 11 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:47:25 PM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA01FCC04EF700412364100165100103281A052105009A20000A2169360B20000D230B0E00000E2300000000, dni: 5ADA, endpoint: 01, cluster: FCC0, size: 78, attrId: 00f7, result: success, encoding: 41, value: 00000000230e00000e0b230d00200b3669210a00209a000521051a280301106501106423' 

Pressing the Physical buttons in order to Switch Off:

fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:50:35 PM: error java.lang.NumberFormatException: For input string: "2A" @line 374 (parseSwitchOnOff)
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:50:34 PM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA2A00120A5500210100, dni: 5ADA, endpoint: 2A, cluster: 0012, size: 10, attrId: 0055, result: success, encoding: 21, value: 0001'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:50:34 PM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:19:50:34 Mon 11 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:50:34 PM: debug Aqara Switch 2 {Child 1 [name:switch, value:off, isStateChange:true, linkText:Aqara Switch 1, descriptionText:Aqara Switch 1 switch is off, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:50:34 PM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0200061600001000F5002300DA5A03, dni: 5ADA, endpoint: 02, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 035ada002300f500'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:50:33 PM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:19:50:33 Mon 11 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:50:33 PM: debug Aqara Switch 2 invalid rad attr code
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:50:33 PM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA2900120A5500210100, dni: 5ADA, endpoint: 29, cluster: 0012, size: 10, attrId: 0055, result: success, encoding: 21, value: 0001'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:50:32 PM: debug Aqara Switch 2 Parse returned: [[name:switch, value:off, isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 switch is off, displayed:true], [name:lastCheckin, value:19:50:32 Mon 11 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:50:32 PM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0100061600001000F5002300DA5A03, dni: 5ADA, endpoint: 01, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 035ada002300f500' 

Pressing the Physical buttons in order to Switch On:

fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:52:01 PM: error java.lang.NumberFormatException: For input string: "2A" @line 374 (parseSwitchOnOff)
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:52:01 PM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA2A00120A5500210100, dni: 5ADA, endpoint: 2A, cluster: 0012, size: 10, attrId: 0055, result: success, encoding: 21, value: 0001'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:52:01 PM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:19:52:01 Mon 11 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:52:01 PM: debug Aqara Switch 2 {Child 1 [name:switch, value:on, isStateChange:true, linkText:Aqara Switch 1, descriptionText:Aqara Switch 1 switch is on, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:52:01 PM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0200061600001001F5002300DA5A03, dni: 5ADA, endpoint: 02, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 035ada002300f501'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:51:56 PM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:19:51:56 Mon 11 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:false]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:51:56 PM: debug Aqara Switch 2 invalid rad attr code
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:51:56 PM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA2900120A5500210100, dni: 5ADA, endpoint: 29, cluster: 0012, size: 10, attrId: 0055, result: success, encoding: 21, value: 0001'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:51:56 PM: debug Aqara Switch 2 Parse returned: [[name:switch, value:on, isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 switch is on, displayed:true], [name:lastCheckin, value:19:51:56 Mon 11 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 7:51:56 PM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0100061600001001F5002300DA5A03, dni: 5ADA, endpoint: 01, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 035ada002300f501' 

That’s all for now, the switch still cuts off the power

I’ve made a few amendments in the light of these most recent logs. This should get rid of the “2A” error.
I am not clear whether decoupled was true or false for the latter 2 logs. It looks as though I may have found the correct option, but set it the wrong way round. Can you confirm what setting for ‘decoupled’ actually works.
I’d like to know whether anything appears in the logs occasionally without any switch, physical or software, being pressed. I’d expect something every 10 to 20 minutes.
It appears the switch transmits extra useful information, which I have managed to decode.

For the last 2 logs the decoupled option was set to FALSE
Only for the 1st log, the decoupled option was set to TRUE.

I tried your new code, the IDE logs did not register anything from the Aqara switch after 40 minutes.
And for now the Decoupled option is still not working.

I hope you’re not out of ideeas :grinning:

My understanding of what should be happening now is that, with decoupled set to false:

  1. Pressing each of the physical switches should switch the corresponding lamp on or off and that this should now be reflected in the state of the app (both main DH and child)
  2. Pressing the button in the app (both main DH and child) should switch each lamp on or off and leave the app in the correct state.

Is this correct?

However, I’m not sure about the decoupled mode as I don’t have enough information about how this is set on these newer switches. I can see that something has changed between the logs you posted on Oct 9th & 10th. So I need to go back and check what happened then, what I changed then.

As a simple experiment, does anything change in the behaviour, or in the logs, between both set to decoupled:true and both with decoupled:false?

For both 1 and 2 the switch and the app are in synch now. No more issues with statuses.
The only issue that remained is the Decoupled feature, which is why I bought the switch for.

I can share more logs.

  1. This is what happens if both main and child are off, and then if I toggle the Decoupled option to TRUE:
 fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:17:23 AM: debug Aqara Switch 2 Child Refresh: null 5ADA-1 [false, false] [true, true]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:17:23 AM: info Aqara Switch 2 Child Refresh: 5ADA-1 [5ADA-1] [unwired:false, decoupled:true]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:16:28 AM: debug Aqara Switch 2 Unwired Switches: [false, false]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:16:28 AM: debug Aqara Switch 2 updated
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:16:28 AM: debug Aqara Switch 2 Child Refresh: null 5ADA-1 [false, false] [false, false]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:16:28 AM: info Aqara Switch 2 Child Refresh: 5ADA-1 [5ADA-1] [unwired:false, decoupled:false] 
  1. Switching to ON both main and child with DECOUPLED option set to TRUE:
 fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:54 AM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:14:23:54 Sat 16 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:false]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:54 AM: debug Aqara Switch 2 {Child 1 [name:switch, value:on, isStateChange:true, linkText:Aqara Switch 1, descriptionText:Aqara Switch 1 switch is on, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:54 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0200061600001001F5002363000007, dni: 5ADA, endpoint: 02, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 070000632300f501'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:54 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0200061600001001F5002363000007, dni: 5ADA, endpoint: 02, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 070000632300f501'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:54 AM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:14:23:54 Sat 16 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:54 AM: debug Aqara Switch 2 {Child 1 [name:switch, value:on, isStateChange:true, linkText:Aqara Switch 1, descriptionText:Aqara Switch 1 switch is on, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:54 AM: debug Aqara Switch 2 SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x01, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x5ada, isClusterSpecific: false, sourceEndpoint: 0x02, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:54 AM: debug Aqara Switch 2 Parsing 'catchall: 0104 0006 02 01 0000 00 5ADA 00 00 0000 0B 01 0100'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:52 AM: debug Aqara Switch 2 Parse returned: [[name:switch, value:on, isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 switch is on, displayed:true], [name:lastCheckin, value:14:23:52 Sat 16 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:false]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:52 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0100061600001001F500235D000007, dni: 5ADA, endpoint: 01, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 0700005d2300f501'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:52 AM: debug Aqara Switch 2 Parse returned: [[name:switch, value:on, isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 switch is on, displayed:true], [name:lastCheckin, value:14:23:52 Sat 16 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:52 AM: debug Aqara Switch 2 SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x01, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x5ada, isClusterSpecific: false, sourceEndpoint: 0x01, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:52 AM: debug Aqara Switch 2 Parsing 'catchall: 0104 0006 01 01 0000 00 5ADA 00 00 0000 0B 01 0100'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:23:52 AM: debug Aqara Switch 2 Parsing 'catchall: 0104 0006 01 01 0000 00 5ADA 00 00 0000 0B 01 0100' 
  1. Switching to OFF both main and child with DECOUPLED option set to TRUE:
 fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:22 AM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:14:25:22 Sat 16 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:false]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:22 AM: debug Aqara Switch 2 {Child 1 [name:switch, value:off, isStateChange:true, linkText:Aqara Switch 1, descriptionText:Aqara Switch 1 switch is off, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:22 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0200061600001000F5002372000007, dni: 5ADA, endpoint: 02, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 070000722300f500'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:22 AM: debug Aqara Switch 2 Parse returned: [[name:lastCheckin, value:14:25:22 Sat 16 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:22 AM: debug Aqara Switch 2 {Child 1 [name:switch, value:off, isStateChange:true, linkText:Aqara Switch 1, descriptionText:Aqara Switch 1 switch is off, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:22 AM: debug Aqara Switch 2 SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x00, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x5ada, isClusterSpecific: false, sourceEndpoint: 0x02, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:22 AM: debug Aqara Switch 2 Parsing 'catchall: 0104 0006 02 01 0000 00 5ADA 00 00 0000 0B 01 0000'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:22 AM: debug Aqara Switch 2 ChildOff 5ADA-1 1 [st cmd 0x5ADA 0x02 0x0006 0x00 {}, delay 2000]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:21 AM: debug Aqara Switch 2 Parse returned: [[name:switch, value:off, isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 switch is off, displayed:true], [name:lastCheckin, value:14:25:21 Sat 16 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:false]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:21 AM: debug Aqara Switch 2 Parsing 'read attr - raw: 5ADA0100061600001000F5002371000007, dni: 5ADA, endpoint: 01, cluster: 0006, size: 22, attrId: 0000, result: success, encoding: 10, value: 070000712300f500'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:21 AM: debug Aqara Switch 2 Parse returned: [[name:switch, value:off, isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 switch is off, displayed:true], [name:lastCheckin, value:14:25:21 Sat 16 Oct (EEST), descriptionText:Check-In, displayed:true, linkText:Aqara Switch 2, isStateChange:true]]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:21 AM: debug Aqara Switch 2 SmartShield(text: null, manufacturerId: 0x0000, direction: 0x01, data: [0x00, 0x00], number: null, isManufacturerSpecific: false, messageType: 0x00, senderShortId: 0x5ada, isClusterSpecific: false, sourceEndpoint: 0x01, profileId: 0x0104, command: 0x0b, clusterId: 0x0006, destinationEndpoint: 0x01, options: 0x0000)
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:21 AM: debug Aqara Switch 2 Parsing 'catchall: 0104 0006 01 01 0000 00 5ADA 00 00 0000 0B 01 0000'
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:20 AM: debug Aqara Switch 2 [st cmd 0x5ADA 0x01 0x0006 0x00 {}, delay 2000]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:20 AM: debug Aqara Switch 2 [name:button, value:pushed, data:[buttonNumber:1], isStateChange:true, linkText:Aqara Switch 2, descriptionText:Aqara Switch 2 button is pushed, displayed:true, description:]
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:20 AM: debug Aqara Switch 2 Switch 1 pressed off
fe2db73a-a5e7-49ee-ae8f-3a028a3bf939 11:25:20 AM: debug Aqara Switch 2 Switch 1 pressed off 

If you can investigate further I will appreciate, if not at least the STATUS works both ways now.