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!
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 just saw this, this AM.
Perhaps it can be ported over....
If it could I would buy a couple of them now!
Harmony hubs are too expensive here (UK) to buy loads of them
Zapals lists the Xiaomi IR Remote for $12.50 US:
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:
lastPressed
(human readable) and lastPressedDate
(java format).batteryLastReplaced
statebutton 0
āreleasedā eventlastCheckin
info
rmational and/or debug
log messages
Notes / Limitations:
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?
Additionally, what event gets fired off for each button press? Iām aiming to use this w/ the event -> mqtt bridge: hubitat-mqtt-bridge/hubitat-mqtt-bridge-app.groovy at master Ā· jeubanks/hubitat-mqtt-bridge Ā· GitHub and iām wondering what additional capabilities/events that app needs to listen for to catch events from the button?
@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 the ref to the Button implementation! Iāll start diggingā¦
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.
Does that help?
This isnāt pretty but it works for a button trigger in WebCoRE; pushed and buttonPressed will show up for the Xiaomi button; here is an example for triggering off of button ā2ā (a double click):
if
Xiaomi Button 1ās pushed is equal to 2
and
Xiaomi Button 1ās buttonPressed changes
thenā¦
It does make sense, and that's what I'd expect, but I don't have "Button" as a capability in Rule Machine at all:
I do in webCoRE, but neither my square nor round buttons show up (but a different button does). This isn't as surprising to me since I know Hubitat's button model is different from ST's and I'm not sure what this unofficial webCoRE fork supports. Maybe I should ask support about my Rule Machine problem, however, unless I'm missing something obvious. (I should add that I'm using the latest drivers I can find on Github.)
Hubitat implements buttons differently from ST...
Since @brianspranger discovered that a pushed - button 0
event is valid, I realize I could yet again rework the "original" Xiaomi Button driver to use button 0
as a "released" state that always happens when the button is released or immediately after a multi-click. Would that be a "prettier" way of doing it for WebCoRE use?
Maybe @ajayjohnm could chime in here, because my latest code revision is working for him. I really need to get WebCoRE installed to fully understand the interaction because it's clearly not the same as what Rule Machine, Button Controller, and other apps are using for button events.
Yes, it seems you are missing something. You cannot use a button as a Condition
in Rule Machine. You need to use it as a Trigger Event
(as seen in my above screenshot.) Let us know if that works for you.
Oh, sweet baby clam juice, I just donāt know how to use Rule Machine. Thanks for catching my mistake! (I never used RM on ST because CoRE and very soon webCoRE was āthe thingā by the time I got tired of writing custom SmartApps every time, so youāll have to excuse my new-ness to RM here.) Thanks!
Sorry if I wasnāt clear, it is working for me in WebCoRE. The Xiaomi button does show up (it does need to be added to the āenabled devicesā list in the WebCoRE app on Hubitat, but that is expected). Iām fine with the driver as is; now that Iāve worked out which states change and which are static between button presses itās easy to use with WebCoRE as it is currently implemented.
I have to say this driver works really well with the Xiaomi button on Hubitat. I still have yet to experience a single missed click, unlike every other button device Iāve used with ST (including the minimote and the Xiaomis Iāve used on ST). It never seems to require a redundant wakeup click no matter how long its been since Iāve last used it. If I can manage to change the battery without destroying the device when it eventually wears out , it will have been the best $6 I smart thing I ever purchased.
Since @brianspranger discovered that a
pushed - button 0
event is valid, I realize I could yet again rework the āoriginalā Xiaomi Button driver to usebutton 0
as a āreleasedā state that always happens when the button is released or immediately after a multi-click. Would that be a āprettierā way of doing it for WebCoRE use?
@veeceeoh I think that would be a more cleaner way of reporting clicks, but I also have doubts on whether it would continue to be possible to use all the events that you opened up for us, once the pushed value starts getting reset to 0. I think some testing would be needed there and I'd be glad to help.
Maybe @ajayjohnm could chime in here, because my latest code revision is working for him. I really need to get WebCoRE installed to fully understand the interaction because itās clearly not the same as what Rule Machine, Button Controller, and other apps are using for button events.
@bertabcd1234 In webCoRE, buttons only show up in the 'Holdable Buttons', 'Sensors' and 'Battery Powered Devices' sections. If you are currently looking into the 'Buttons' section of the Available Devices menu, then you won't see your button there.
As for using button clicks as triggers, you always need to use a combination of conditions to pin-point what action took place. For e.g. to use a single button click trigger, use...
If buttonReleased
changes
and
If buttonHeld
did not change
and
If pushed
= 1
Lastly, @veeceeoh, if you want to get started with webCoRE, @ogiewon has done all of us a big favor and posted all the fixes and modifications needed to the webCoRE code, to make it run on Hubitat,
In that case, I think I'll wait until I get webCoRE set up on my Hubitat, and then do some testing myself. I've been keeping tabs on the thread with all the fixes needed to get it working, so I'll start with that, thanks!