[RELEASE] Xiaomi Aqara Mijia Sensors and Switches Driver

Thank you for that. That should be sufficient for me to add WXKG11LM to the driver. It looks like that version of the switch doesn't support hold/release so I'll exclude it.

1 Like

This is the driver that I have been using for this if it is any help.

EDIT Reading the comments in it, it seems there are 2 different versions of the same model number with slightly different behavoirs. Thanks Aqara!

Mine is the r1 version. I'm happy to do any amount of testing as I have a spare button connected to a spare hub.

veeceeoh's driver

I have pushed v0.09 which should hopefully support the older WXKG11LM variant of the Aqara button.

1 Like

The WXKG11LM offers single, double, triple and quadruple presses, but no hold. The WXKG12LM reports on single, double, hold and SHAKE!

1 Like

...and the shake is implemented :grinning:

2 Likes

Strange, no update in HPM


Forgot to update the HPM manifest. v0.09 should be there now.

Working perfectly. Picks up press and number of taps up to 4.

Instead of 6 different drivers for my Xiaomi devices I now have just this one and can use presence to check they are still connected as a bonus.

Thanks very much for all of your efforts on this. :+1:

2 Likes

Can anyone comment on how this driver compares to Markus's drivers?

Preface: Everyone's environment is different, so this comment is based solely on MY experience.

Short answer-
This driver is lean, error-free, and stable.

Long answer-
I had been using veeceeoh's drivers with great success. I hadn't had a device drop off in over a year and a half. I switched to Markus's drivers thinking that with new Xiaomi devices on the horizon, it'll be nice having support for them and the older ones too. It was a disaster. Devices started dropping, events weren't reported, I blew through seven batteries in three days, and the Pan ID changed twice (each time required re-pairing all zigbee devices).

I switched back to veeceeoh's drivers and all was well again, except now those drivers were periodically throwing errors and some of the preferences were not being respected, but at least I had all my events.

Then came @chirpy's unified driver. I jumped on it as soon as it was released and have had no problems, whatsoever. The only thing I feel this driver might need is temperature and humidity offset preferences for the Aqara sensors, but mine are fairly accurate so I'm not concerned. While the presence attribute is nice, I don't even need it because my devices are humming right along.

2 Likes

I have 4 Aqara contact sensors working w/out fail so far using this driver (knock on wood). However 3 of the 4 are reporting as Not Present even though each is sending battery volts & percentage every hour. Is there anything I can do to give them a "kick in the butt"? I have pushed Refresh & Configure. If not, no big deal. Like @bjcowles, I don't need it but it would be nice to have.

A few of mine needed some help. I changed the driver to "Device", cleared schedules, switched back to the Xiaomi driver, saved it, clicked configure, and then saved preferences. See if that gets them going.

I have a suggestion to throw out there for a possible option in this driver for the contact sensors.

I often want to use contact sensors on doors as if they were motion sensors for motion zones etc. EG I have a motion zone for outside lighting that I want to be active if either of 2 doors is open or 2 motion sensors are active. The effect can be achieved other ways but I managed to modify another Aqara contact sensor driver to also have capability Motion Sensor and to go active when it was open and inactive when it was closed. This makes it super easy to include them in a motion zone without any further rules or logic needed.

Is this too niche to be worth including or does anyone else (and more importantly @chirpy who is doing all the work!) see any value in this and maybe having an option for contact sensors to mimic motions sensors as well?

2 Likes

Neat idea. In your modification, do you keep both contact and motion attributes? I wonder if having both would lead to issues with how voice assistants discover device types. :thinking:

Yes I keep both. I don't use voice assistants so don't know, but it's a good point.

2 Likes

In case you need to look at another path, if you use the community app Event Engine (available in HPM) you can easily create automations combining all different types of sensors, and you can also add "helper" sensors to keep an automation active, etc. Would easily handle your use-case. Example below of a cog (EE automation) that would combine Time, Contact Sensor, and Motion Sensor in an automation.

2 Likes

I've added it for the next release as it's only a few lines of code and selectable via an option.

5 Likes

I haven’t used this driver, but I do agree that with a large number of devices, a leaner driver keeps Xiaomi devices more stable and report state more accurately (i.e no missing events)

4 Likes

Any chance that you might consider adding support for the wired light switches such as QBKG11LM and QBKG12LM
I'd be willing to help out on this

Markus' driver while it does support controlling those switches it doesn't correctly interpret the data when turning them on and off manually and the status ends up going out of sync. Also even though I sent on the logs to Markus in the other forum they don't seem to be maintaining their drivers anymore.

And the driver from guyeeba/veeceeoh seems to have gotten broken with a later Hubitat firmware update as it comes up with errors in the logs.

Thank you

There is some strange behaver when I use the button WXKG01LM

When I configure the button in Button controller I get this:

  • When I "push" , the Living PC light is toggling --> OK
  • When I "double tap" , the kitchen painting AND Living PC light is toggling
  • When I "held" , the Kitchen table AND Living PC light is toggling