[OBSOLETE] Device Handler for Aqara Wired Wall Switch

I tried your DTH, and it works great also for the Xiaomi Aqara Wireless Relay Controller (LLKZMK11LM).
The measured temperature is not calibrated (44-47˚c), but that’s a minor issue.
If I read correctly, the module allows configuring to use push buttons instead of toggle switches. Do you know how this can be added to your DTH?

Thanks for your information. Let me check it.
About the temperature, besides the equipment errors needed to be calibrated, please note that it is temperature inside chip circuit, not room temperature. So it may be higher than room temperature.

Agreed it might be higher, but 47°c when the room temperature is ~28°c doesn’t seem reasonable when the lights are off. That’s really a minor detail, though. Having the child DTH is incredibly helpful, and I can finally use it with Google Home.

I got a single gang QBKG11LM Switch with neutral wired. I reviewed the whole thread. Only can see the DTH for single gang no neutral. Can anyone tell me if the DTH is working with the neutral wired version as well?

Hi!

Can you explain in detail how I should use the DHT and ABC in my case:

I have a 2 gang wall wired Aqara switch, where the left button is wired and the right button is unwired.
I want to use the right button to power up an Ikea Trådfri bulb.

I’ve already set the right button on “unwired” and set up the “button1” from ABC to toggle on/off the IKEA Trådfri bulb, but it seems that it’s not working.sometimes I see the “pushed” sign on SmartThings classic app, but nothing happens and sometimes I don’t

Please explain to me in detail

Hello,

Can you explain please how to use for example the SW1 as an unwired switch? To act as a button?

Thank you,
Vlad

OK! I assume you’ve got the latest version of the DH. On the setup screen you should have “Identify the unwired switch” set to “Right”. Also, for diagnostic purposes, I suggest you set both the “Display” toggles on. If you are using the IDE then it would be good if you could tell me what you get in the logs when you try to use the switch. In the ABC app you should have “Button 1” set to “Toggle On/Off” your IKEA Bulb.
Mine is set up the other way round, so it’s just possible I’ve missed something. However, I would expect the response in the App to show up on the small icon on the left below the main window rather than in the main window itself. This is related to the issue that smartthings doesn’t cope well with devices with multiple endpoints.

Hello,
I’ve come back with a snip of the logs!
So in this moment my setup is like this:
Latest version of your DHT, right switch set as “unwired” and the ABC linked to Ikea Bulb.
As far as i noticed, the problem is that the DHT does not update smartthings with the latest status of the switch.When i hard press on any switch, it does not update the status in Classic ST app, therefore i cannot use the secondary unwired button as i should.

I’ve also tested the DHT from @lpthanh and i noticed that this one does update very quickly the status of the physical switch to Classic ST app, but that DHT lack of the “unwired” feature.

It would be very nice if you guys can combine both :smiley:

Thank you,
Vlad

“state code: eff” isn’t supposed to happen. Looks like the code has got confused as a result of trying several things before the previous one has been acted upon. Can you tell me what happens when you press the “refresh” button, bottom left in the App., waiting a few seconds and then trying the hard switch. I’ll try to find time to look at the code with a view to catching this situation.

After I hit refresh button, and hard press on the switch nothing happens in Classic ST app :frowning: no status change.

Thanks for support!
Vlad

I have a few ideas on how the DH might be improved. However, I want to clarify your expectations.
If I look at the behaviour of the equivalent unwired device I note that there is no expectation that the DH is synced with the bulb. However, what it does do is act as a toggle, such that it changes the on/off state of the bulb, irrespective of the initial state. When a switch is pressed the icon in the DH changes for about a second to blue and labelled “pressed” and then returns to its original state, gray and labelled “released”. This behaviour is preferable to the DH changing between “off” and “on” as there is no easy way to synchronise this with the state of the bulb, should that be changed by some other means, such as directly in the smarthings app. My point is that I have been trying to make the “unwired” switch on this device behave in the same way as the switches on the completely unwired device.
Another issue I have found is distinguishing between a simple press of the switch and the switch being held for a few seconds. The hardware produces different zigbee messages in these 2 cases. However, there is inevitably some latency in the system, a delay between the switch being pressed and the bulb responding. I suspect this leads the user to hold the switch until he/she sees a response, which may be long enough for the hardware to think it is being “held”. I’m wondering whether it would be better not to try to distinguish between pushed and held in the unwired case.
I’d value your views.
Angus

One other question. I’ve included the temperature in the DH as my device seems to give a sensible temperature. However, most of the Aqara devices give a temperature, but it is often not sensible. How does your device behave in this regard?

Hello and Good Evening!

I totally understand what you mean with the physical differences between the switch and the button and in our case make perfect sense.we need the “button” mode for the unwired tap.

Actually my first thought was using a wireless version of this zugebe switch, but unfortunately the package did not arrived from China and now I’m trying to improvise and this is how i got into this situation.

Regarding the second part I also agree with you.All of this devices have a totally normal lag in their function and who does not know that (like my wife for example) tend to over push the buttons.As a response to your question I would remove the “held” feature for now.

Regarding my problem, my switch still does not synchronize at all with SmartThings App :frowning: the DHT does not recognize my “hard” pushes.

Hope you can help me!
Vlad

My devices all give some temperature informations, but it’s irrelevant because I think it’s the internal temperature of the device.
This is what i got:

Hope it helps!
Thanks,
Vlad

I’ve just pushed a major update to GitHub with the following changes:

  1. Corrected a typo which meant that the button functionality didn’t work for unwired right switch.
  2. “Held” now works for the unwired switch (button1).
  3. Added a temperature offset, analogous to the Xiaomi temperature sensor. I’d be interested to know whether this helps to make the temperatuire measurement work properly.

I’ve also done a major rewrite of the logic which was designed to cope with receiving multiple, almost simultaneous, zigbee commands. Each push of these switches results in at least 2 zigbee commands. The previous version occasionally failed to respond properly as the responses to each command could interfere with each other.

3 Likes

Hi @aonghusmor !

This DHT update it’s a just great, a real game changer! :smiley:

My setup works now like a charm!

Thank you for your good work!

I posted an improved version on GitHub. This quietly catches a few error conditions, which might have caused the DH to fail.
This version can distinguish ‘pushed’ from ‘held’ for both the wired and the unwired switch.
On the unwired switch this appears as button1 to apps, such as ABC (Advanced Button Controller).
if both switches are pressed ABC will see button2.
I’ve also redesigned the main screen of the DH to give the 2 switches equal weight.

As an example I have mine configured such that a simple press of the unwired switch toggles the lamp to 40% brightness, but holding the switch for a second or so gives 100% brightness. Pressing both switches at the same time toggles a completely different lamp (just as a test) along with the
the wired lamp.

I know there is some doubt about precisely what temperature this device measures. I have left this capability in the DH, but have added the possibility of adding a constant shift to the measured temperature. I get sensible numbers, but I know that other people don’t.

1 Like

Hi, the temperature is coming back as Fahrenheit, how do I change it to Celcius?

HI! The temperature scale is set by the hub, not by the DH. The switch itself gives the temperature in Celsius, but that is converted to Fahrenheit by the DH, if the Hub is set that way. My switch gives sensible temperatures, but I know others have reported getting silly numbers. A typical Fahrenheit temperature should be about 70.
If you are able to look in the logs, with the ‘debug’ switch on, you should see a line containing ‘SmartShield’ followed by one containing ‘Map’. In the map you should see 3: followed by the raw temperature given by the device.
If you have other devices in your setup giving sensible Celsius temperatures, then your Hub is almost certainly set up OK.

Hi, aonghusmor

last night after I asked the question, I went thru the DH code and I must admit my knowledge of coding is abysmal having coded the last time in basic (commodore 64), yes I’m old… from my very limited know how I found this “temp = celsiusToFahrenheit(temp)” and added “//” before it making it look like this on the line " // temp = celsiusToFahrenheit(temp) "

well… that did it… it’s now reporting 19ºC which is about right… is it wrong? dunno… :wink: