[UPDATE] v0.6b of Xiaomi “Original” (round) Button Device Driver
For convenience please copy the updated beta round button driver code from this direct link.
- I discovered the button sends the hub one additional type of unique message for any multi-click over 4. So for any multi-click of 5 times or greater, a
pushed - button 6event is sent. I am calling this the “shizzle-click.” This is definitely my 7 year-old daughter’s favorite type of multi-click.
Added code to handle
Holdcommands (part of the current implementation of the
HoldableButtoncapabilities). The commands won’t do anything, however, because this button is non-controllable. See my note below for more information.
numberOfButtonsevent to be sent to the hub when the button is paired, configured, or updated (i.e., when preferences are saved). This lets Apps know how many buttons are available to use.
Added a preference setting to toggle the display of debug log messages, with a default of OFF.
Although the current Hubitat button implementation automatically adds commands that allow a button to be controlled, the
Holdcommands aren’t used by this device driver, because the Xiaomi “Original” button is only a trigger (actuator) device, and cannot be controlled. Please make sure not to select the Xiaomi “Original” button as a “controllable” device in any App as nothing will happen. It should only be used as a “trigger” device. As I understand it, the
Holdcommands for physical buttons will be changed or removed in a future update of the Hubitat button implementation.
Just because this device driver maps different types of clicks to 5 different button trigger events doesn’t mean they all must be used. Any type of press / multi-click to mapped buttons that are not used by any App are simply ignored.
I have tested this Device Handler with both Rule Machine and also the Button Controllers App. Everything is working as expected, and simple toggle or on/off switch actions based on different button press/click types are very responsive. I am leaving the beta status on this device driver for another week or so, hopefully to get more user feedback, and finalize the code.