Device Handler for Aqara 2 Gang Wired Wall Switch no Neutral

I’ve created this new topic for discussions of the Xiaomi Aqara Wall Switch, QBKG03LM, with no neutral wire, in particular my (@aonghusmor) DH.

This was my first smart device ever (0 experience with coding) and following your work plus the work of user [u/Mike_Rolle] to create the virtual switches i got it working!!! Now going to wire my entire house with Aqara switches!!! Been wanting to do this for over a year.

One question - do you guys have solutions for getting 2-way switches to work (using two seperate single button Aqara switches to control just one light)? I assume some kind of IFTTT would be needed, but if you can direct me to a thread or code that would do it for me, i would really appreciate it.

1 Like

There are several different ways to do this.

  1. if you are using a smart bulb, then it’s always possible to use more than one unwired switch to toggle (not switch on or off) the bulb.
  2. With a dumb bulb and one wired and one unwired switch, let the unwired switch soft toggle the wired one.
  3. With devices , such as those from Fibaro or Aeotec, which are not switches as such, but fit behind a conventional switch to make it smart, it’s possible to wire it up to use the existing 2 way switch wiring.
    The first 2 of these use an app, such as “Smart Ligting” or " ABC Manager" (Advanced Button Control) to link the unwired switch to the bulb or to the wired switch. In such cases it’s generally better to use ‘toggle’ rather than ‘on/off’, as otherwise it’s all too easy for the state of the switch to get out of sync with the state of the bulb or the other switch.
    Hope this helps.

Hi @aonghusmor, just a quick note to say a massive thank you to you and the others who have worked on this DH, works an absolute treat :smile:
Thanks Again!

Hope this isn’t hijacking this thread, (mods feel free to move if so) but has anyone ever had experience of this switch being stuck “On”?

My Smartthings is acting correctly with it’s automations for the switch, I can see from the IDE, however the light which is connected to my switch is permanently “on”.

If the switch is wired to the lamp then there must be a fault on the switch or, possibly, the wiring. If it’s a software connection then, there may be other possibilities. Is it a dumb lamp or a smart one?

1 Like

It’s a dumb lamp. I will turn the power off to the switch today to see if the switch “reboots”

If I’ve understood the situation correctly, the most obvious question is whether the switch is wired correctly. Is it possible that the switched wire is connected to the live one. As far as a dumb lamp is concerned it should act as a hardware switch, even if smarththings is switched off. As I assume we’re talking about a double switch, is the symptom the same for both switches?

So your DH has worked great for self detecting the 2-button switches but doesnt seem to work with 1-button switches.

a) It doesn’t detect itself as an Aqara switch
b) when i go into the IDE, i change the device type to “Aqara 2 Button Wired Wall Switch No Neutral” since the DH doesnt have a label for 1 button.

After that, the 1-button switch only works on the Classic app and not on the new app! Do you know why that’s the case?

Is there another DH floating around that works for the 1-button switch?

edit: stopgap solution was in the New app, i created the virtual switches and only one of them works. It’s fine, but a bit annoying having 3 seperate buttons the the switch on the app when only one works .

Nearly everything I changed from the @simic code was specific to the 2 button switch. I didn’t have a 1 button switch while I was doing this and it looks like something has made the code fail for the 1 button switch. I now have a 1 button switch, but haven’t had time to try it out yet. I suspect the issue is trivial. I’ll get back to you when I’ve had time to look at it.

was my error, I used the wrong DTH by mistake

Hi again @aonghusmor !

Can you tell me if is there any way to manually refresh the temperature of the device?
I’ve created a piston where i centralize all the temperatures based on Aqara Wall’s switches temp. sensor but i see that it’s kinda laggy, it refreshes once in 2-3-4 days.

Thank you,

When I added the capability of shifting the measured temperature to conform better with expectations I noted that this shift only took effect when the measured temperature changed. Part of the problem
is that the device only gives an integer temperature, so there may be a significant lag before that changes. The device itself checks in every 5 minutes or so and the DH checks whether the temperature has changed. There’s also some doubt as to whether
the temperature measured is the temperature of the surroundings or some sort of internal temperature.


I saw on one site that the temperature could be just for internal monitoring, like a protection.If the temp reaches 60 degrees Celsius or equivalent in Fahrenheit has a protection switch.

I will monitor if that temp it’s relevant to “outside” environment.I’ve already set my offsets using a real thermometer .

Anyway if you find out something else, let us know!


Hi @aonghusmor,

Thank you very much for the incredible work!

Would it be possible to integrate into your DTH the split into child DTH, as done by @lpthanh here?
The child DTH approach allows easy integration with Google Home etc., as well as with the new Smartthings app. This is the approach used by Fibaro, Qubino etc.

Also, I was wondering if you tried the Xiaomi Aqara Wireless Relay Controller (LLKZMK11LM). It works well with @lpthanh’s DTH (with the exception of weird temperature values). I’d be really interested if there was a way to convert the relay from toggle to momentary (push button). It seems to be possible with Xiaomi’s gateway.


I’ve now added an updated version to github under
This version should work for both the single and double switches. Note the change of name to reflect this change. I will try to arrange the github such that the old name still works, but I haven’t worked out how to do that yet.

I’ll try to look at that suggestion when I have time.
I am not familar with the relay controller, but I suspect the toggle vs momentary issue is a function fo the DH, especiallyif, as you say, itn works with the Xiaomi gateway.
In the meantime I have the single switch version working with my DH.

I have now modified my DH to work with the single button switch. See message 16 in this thread.

Can you provide a link to the single button DTH pls?

Look at message 16 on this topic.