I created a device driver for the aqara button. But after looking at some of these posts it appears that the events for hubitat are quite different from smartthings??
For now it will create a button pressed and released event for button 1.
Yeah, using the SmartThings' sendEvent(name: "button", value: "pushed",etc. is not supported by Hubitat and won't be recognized by Rule Machine, the Button Controller App, other Hubitat-native apps, etc.
The sendEvent / createEvent mapped data should follow this format:
Also there is no support for a released state. So all of that can be removed, including the countdown timer.
But does the Aqara Button generate different messages when it's pressed versus released? If yes, then the "original" Xioami driver I'm working on could be adapted.
Same thing if the Aqara Button generates different messages for multi-clicks.
I'd love to help with the device driver, but I can only do that if I know what messages it produces with different click actions.
EDIT: For the official explanation of Hubitat's Button capability implementation, please see this forum thread.
That's unfortunate. I still don't understand why they removed that from the (original) Aqara model. At least the new Aqara Button model has more functionality.
Do you see any different messages for double-click, triple-click, etc?
While the device itself supports 7 different actions, that DTH supports maps different actions to up to 43 buttons!!!
Needless to say, it's a more complicated driver, and I'll want to do thorough testing. But since I have one, I am definitely going to make a Hubitat device driver.
If no-one else has said so before, you're a superstar. Also, 43 is too many. Who the hell could remember all the things.
Since I'm asking about odd little devices, what about the IR remote control?
If it could be used locally, it'd eliminate the need for Harmony (I find their software always just slightly lacking what I want to really make it work the way I want)
I tested the new attributes and everything works perfect!
Now there is a unique combination of triggers to track from practically all variants of presses and holds.
Thanks a ton for helping make things compatible with webCoRE!
As far as I know, this one only operates on 802.11 b/g/n wifi. So it's a completely different monster than anything ZigBee based, and I'd expect only works with Xiaomi's (Chinese-language-only) app. Probably way outside my realm of knowledge on how to get it cooperating with the Hubitat in any manner.
I am going to order one. Probably will take some weeks to arrive.
EDIT: Use code honeyza08 for $1 off.
NOTE: The KuKu Mi SmartThings device handler requires a Docker Daemon app to run continuously on a computer on your local network. Of course that computer must always be on.
I think Xiaomi is great for cost sensitive smart home stuff. I wouldnāt use it as a professional installer or really trust long term reliability but for setting up budget friendly systems it seems good enough. I also buy 3 if I need 2 just in case one is defective.
[RELEASE] v0.2 of Xiaomi Aqara Button (model WXKG11LM) Device Driver
Created by @brianspranger - thanks!!
EDIT: PLEASE NOTE THIS DEVICE HANDLER HAS SINCE BEEN UPDATED Please see this post for more information.
For convenience please copy the driver code from this direct link.
The Aqara model WXKG11LM button is different from the Xiaomi āoriginalā Button in that no message is sent when the button is released. However it does support multi-clicks up to a quadruple-click. So when set to Momentary mode in the preference settings, @brianspranger has included a countdown timer that, after a user-set delay, will automatically send a pushed - button 0 event to emulate a button āreleasedā event. This should theoretically be usable in WebCoRE to capture single-clicks.
Hereās a chart of what happens with each kind button press:
Aqara Button model WXKG11LM
Action
Hubitat button event(s)
Single click
button 1 pushed , then button 0 pushed after user-set delay
Double-click
button 2 pushed
Triple-click
button 3 pushed
Quadruple-click
button 4 pushed
Hold
Not supported (same behavior as single-click)
Other Features:
The Hubitat hub should correctly select this custom device driver when pairing.
The date/time of the most recent opening of the contact is stored as lastPressed (human readable) and lastPressedDate (java format).
Battery replacement date tracking, stored in batteryLastReplaced state
Commands / Preferences include:
ā¢ A preference to set how many seconds until single press is cleared with a button 0 āreleasedā event
ā¢ A Toggle / Momentary mode setting
ā¢ A Reset Battery Replaced Date command to track battery life
ā¢ Date / 24-hour clock settings for display of lastCheckin
ā¢ Min/Max voltage values used to calculate the battery percentage
ā¢ Display log message toggle setting. EDIT: in newest version of device handler there are two toggles settings for display of informational and/or debug log messages
Notes / Limitations:
This device driver is not final, and some features or preferences may be added / removed
There is a new version of the Aqara Button (model WXKG12LM) with more features which was released late last year. Currently this device driver will not work with it. I have ordered a couple of the new Aqara button model and plan to update this driver after they arrive. EDIT: The device driver has been updated with support for model WXKG12LM
Thnanks for all your work on the driver! Iām really grateful to know that the 11LM version supports multi-tap. Are you just listening to single press events and using the minimum timer simulate this or does the button send a unique value for each press type?
@brianspranger came up with this latest device driver, but as I've looked at his code I can tell you that the hardware natively supports multi-taps with unique messages for 2, 3, & 4 multi-taps.
Exactly what I posted above. All events are name: 'pushed' with value: button #
Looking at that code - it appears that the capability / subscription for button events may be incorrect. The author should refer to this forum thread about Hubitat's button capability implementation. Note that they plan to modify this implementation in future, so watch for any announcements on that.
Thanks for your work on porting all of these! And thanks to Hubitat for modifying their ZigBee stack to, apparently, now work with these devices (havenāt had any fall off since that update).
With regard to the buttons, has anyone figured out how to use them? Neither the unofficial Hubitat port of webCoRE nor Rule Machine seem to work with them: if thereās a ābuttonā capability in RM, I canāt find it, and these donāt show up as buttons at all in webCoRE. (Iām using one as a doorbell and want LANnouncer to chime and speak, so there are probably other ways to do this, which I would also be interested in, but I donāt want to hijack this thread for my specific use and am just curious in general if/how people are able to actually use these.)
I only have an "original" (round) Xiaomi Button, and it's working just fine in both Rule Machine and also Button Controller. Here's where I see it available in Rule Machine, when I'm in the Select Tigger Events menu:
As for WebCoRE - keeping in mind that it is not "officially" working on Hubitat yet - I don't use it personally, but @ajayjohnm confirmed that the latest beta of the "original" Xiaomi Button device driver is working for him in WebCoRE, and so I've pushed that new beta version through on GitHub so it can be copied from the link for the "original" Xiaomi Button device driver code (found up in the very first post of this thread.)
The Xiaomi Aqara Button device driver was just finished by @brianspranger, and although I don't have one of them, it should also work just great with Rule Machine, WebCoRE, etc.