Device Handler for Aqara 2 Gang Wired Wall Switch no Neutral

STATUS of device add

ID b139590e-af68-471e-b3bf-3093eb686738
{
“deviceId”: “91811b39-a807-4787-9a18-06fa7a9d01dc”
}

2,
ID 503259aa-f830-48e2-8710-e1290c7122bc

{
“deviceId”: “f6de83c5-b1df-4b55-b90c-59ae026d17d0”
}

ID 69bb1896-928c-4322-9e23-33a34986f362
{
“deviceId”: “3c23ca75-8129-4f9c-a46d-b0e12b8350dc”
}

Hi @aonghusmor,
When I press the physical button, there nothing on my live logging. As for the child device handler, it was install in my device handler.

Hi!

That seems to confirm what @randyben01 said, that there is nothing sent from the switch to the hub, when the physical button is pressed.

Can you tell me what appears in your logs when you press the switch in the app? I expect either ‘CatchAll message ignored’ or ‘parse returned [name:switch …’

I have an idea how to arrange things to take this into account.

Hi @randyben01 and @illusionistXIII,

I’ve been thinking about the fact that you see nothing in the logs when the physical switch is pressed. The consequence of that is that it is impossible to keep the state of the switch in the app in sync with the physical switch. The best way to deal with that is to replace the switch in the app with a button. That way you can’t tell the state of the switch from the app. But you can’t tell the state of the physical switch anyway, so that is no different.

I’d like you to try the following:

Go to the Device Handler code and the section headed ‘metadata { definition’. Yo will see a series of pairs of lines starting 'vid’and ‘ocfDeviceType’, most of which are commented out (// at the beginning.
Please add // to the start of lines 34 & 35 (the ones labelled ‘switch without neutral wire’) and remove the // from lines 38 & 39 (the ones labelled ‘button ( no battery)’. Then press ‘save’ and ‘publish’ at the top.

This may change what appears in the app. If not go to ‘My Devices’ and the click on your device. Then go to the bottom and press ‘edit’. Under ‘Type’ replace ‘Aqara Wall Switch’ with somethng else and press ‘Update’ at the bottom. Then close the app and open it again at the DH. Go back to the device in the IDE and change the Type back to Aqara Wall Switch. Close the app and open it again.

Sorry this is such a rigmarole. Smartthings will no doubt claim it is not a bug but a feature.

You should now see a so-called momentary swich in the app. Let me know what appears in the logs.

Not sure why this behaved like this. However, I was able to deduce from this some extra information, which should make the smartthings system recognise the device more easily. This has been incorporated into the version Iposted 5 minutes ago.

Hi @aonghusmor,

The icon do change and it works. The only issue I have now is whenever I tried to rename the button, I keep getting an error and when I tried to pair the button, It added a total of 3 set of buttons and I have to manually remove the spare button.

Just so that I can understand better what the issue is. Apologies if you’ve answered this already.

  1. What happens to the icon in the app when you press the physical switch rather than the icon? Does it change accordingly?
  2. When you get the extra buttons, if you go to “My Devices” and look at the column “Device Network Id”, what does it give for these extra buttons?

Hi @aonghusmor,
This is the icon I see on my device

When I press the physical button, nothing changes. When I press the button from the apps the below image will be shown for awhile before showing back the first photo.

As for the extra button, it is not shown on my IDE (My Device).

@aonghusmor Did you see the new announcement regarding SmartThing Edge architecture? Would be amazing to be able to run the device handlers locally on the hub itself. Any chance you device handler might get ported over?

  • it’s a completely new language and architecture
  • there will be a new set of bumps and errors
  • there are no edge examples for switches and buttons (yes there are only sensors but no actuator examples)
  • child devices, only 1 button will be operable

when\if Samsung team can publish a working driver on the same level of complexity as the current one, it will make sense to try to adapt in for Aqara.
But do not expect better code quality from hobbyists that have a limited impact on the system.

1 Like

Hi @illusionistX111

I’ve just realised we may have been talking about different switches. There is a long conversation with @randyben1 about Lumi WS-USC02, but you are referring to QBKG25LM. I may have given you wrong information meant for the other switch.

I’d expect when this is installed that it creates 3 items in the app, 1 parent DHT and 2 children. The children should have the same name as the parent with the addition of ‘-(1)’ or ‘-(2)’. What do you get?

I haven’t had any difficulty changing the names of any of these. Go to the DHT in the app. Click on the 3 dots, top right, and then on ‘edit’. You should then be able to change the device name.

This can also be done within the IDE. In that case it is the ‘Label’ you should change, not the ‘Name’ or ‘Type’.

As far as the interface in the app is concerned. If all 3 switches are wired, I’d leave the setting under ‘metatdata { definition’ as a switch, rather than a button. The button setting is more approriate for an unwired switch.

I don’t have a 3 button switch, so there are some issues I haven’t addressed, such as what happens when 2 switches are pressed simultaneously?

Hi @aonghusmor,

Yes, it does create the children. No issue changing the name previosly. The problem that I’m facing is that on the interface, the default is set to off even thought if the switch was already on therefore it will cause an issue. Even if I’m able to turn it on, the interface will still show as off meaning I can only turn it on.

Hi @illusionistXIII

Firstly, I’m going to be away from home for the next couple of weeks and won’t have easy access to my code, etc. I should be able to answer some questions though.

With the ‘button’ interface the state of the switch shouldn’t matter, as a ‘toggle’ command is sent when the button is pressed in the app.

With the switch interface I would expect the app to be sync’d with the switch after a couple of presses. If that isn’t happening I’ll need to see the logs to try to work out why it isn’t happening. Is this behaviour the same for the main DHT and the left hand switch as for the child DHT and the other switches?

Most of the Xiaomi switches have a feature that they check in at least once/hour. Can you see this happening in the logs? You should see a ‘catchall’ message followed by various other things, even if you’ve done nothing.

Finally, I’m assuming that the main DHT and the children all have the first 2 settings set to ‘false’.

1 Like

Hi @aonghusmor
I recently bought an Aqara Double Rocker Wired Switch WS-EUK02 - the EU 2021 version.
A link with the product can be found here: Aqara Switch WS-EUK02 No Neutral

I bought one in order to test, if it works properly with STH.

My use case is as follows:
I wanted a SmartSwitch that can Convert to a Wireless Switch if needed for a long time, due to the fact that I have Smart Lights, and always someone will switch off the physical switch rendering the Smart Lights useless ( I use Smart Lights vs Smart Switches due to the fact that a Smart switch cannot control color temperature or colors.)

My issue:
After I imported your repo inside My handlers section, the Switch was still added as a thing.
I edited your DTH locally and added this 2 lines:

  1. After line 95 (in your original DTH):
fingerprint profileId: "0104", deviceId: "0100", inClusters: "0000,0002,0003,0004,0005,0006,0009", outClusters: "000A,0019", 
                manufacturer: "LUMI", model: "lumi.switch.l2aeu1", deviceJoinName: "Aqara Switch EU-02"
  1. After the line 870 (also in your original DTH) :
case "lumi.switch.l2aeu1": //Aqara Switch EU-02
        	state.numSwitches = 2
            state.numButtons = 2
            state.endpoints = [0x01,0x02,0xF3,0x05,0x06,0xF5,0xF6]
			state.oldOnOff = true
			break    
  • If I add the device in the new app using your DTH it will create 4 devices, but no device will appear in IDE, and only one rocker will work from the app.
  • If I add the device with a generic DTH like “Zigbee Multiswitch” and then switch to your DTH, only 2 devices will remain (parent and child) but only one rocker will work.

I also tried to change the child device default DTH to yours but I get the following error all the time:

Error
    500: Internal Server Error
URI
    /device/update
Reference Id
    7568abc8-240c-4afd-be6b-1b52c4e8fcdf
Date
    Sun Aug 29 11:32:09 UTC 2021

The Raw description from IDE is this:

01 0104 0100 01 07 0000 0002 0003 0004 0005 0006 0009 02 000A 0019

Model Name:

 model: lumi.switch.l2aeu1 

As you can see the “inClusters” and "outClusters: are pretty much the same.

Also the Decoupled option turns to true or false, but the switch will also turn off the power, regardless of the boolean value.

Do you think you can help implement this version also?
I’m interested in the conversion function to work from psychical switch to a soft switch, otherwise this switch is pretty useless to me.
Thank you

I’m not at home at the moment. Back in a week.

I suggest changing the 1st 2 endpoints to 0x02, 0x03 in line with the other no neutral switches.

I’ve had other reports about issues with the creation of children and inconsistencies between the app and the ide, but have been unable to reproduce them so far.

unfortunately, l2aeu is very different from previous versions.
It is Zigbee3 but I was not able to run it properly. Even normal on\off notification doesn’t work smoothly.
Decouple option seems to be not an option also.

What do you mean by “Normal Notification” ?
When you use this DTH, how many parent and child devices is adding for you. In my case it adds 4 parent and 4 child devices, and it’s not present in IDE, I must remove them only from the app.

Can you explain why a Zigbee 3 device is very different? Shouldn’t be backwards compatible ?
Thanks

Take your time, it wasn’t a demand. Please drop me a line when you come back.
I tried what you said, it didn’t help.
Also I see 4 parent devices and 4 child devices…

I think this started to happen after I re-added and deleted the device multiple times, in order to test. Maybe I must change the “vid” ?

the standard ZigBee on\off cluster is 0x0006.
when I try to subscribe for the cluster notifications, the device reports ok. but I never got the status change on this cluster.

I have my own DTH based on aonghusmor’s. Also, I own a one-button version

  • profileId: ‘0104’ in: ‘0000,0002,0003,0004,0005,0006,0009’ out: ‘000A,0019’ manufacturer: ‘LUMI’ model: ‘lumi.switch.l1aeu1’

so I have only one parent device.

Can you explain why a Zigbee 3 device is very different? Shouldn’t be backward compatible?

well, I can’t explain but it is supposed to be more standard in terms of protocol and more powerful in hub-less mode (binding). It should be compatible, but the device I own is way more limited than previous cheaper versions.