veeceeoh / xiaomi-hubitat

veeceeoh's Xiaomi device drivers for the Hubitat Elevation Hub
Apache License 2.0
74 stars 47 forks source link

Updated Aqara Button device driver - adds model WXKG12LM #8

Closed veeceeoh closed 6 years ago

veeceeoh commented 6 years ago

Changes: • added compatibility with Aqara Button model WXKG12LM, which supports single-click, double-click, hold, release, and shake actions • added custom buttonPressed, buttonHeld, & buttonReleased events for webCoRE use • removed toggle mode for model WXKG11LM, because Rule Machine, webCoRE, etc. already have toggle switch actions • changed releaseTime preference description text for clarity and to specify it only applies to model WXKG11LM • added value: 1000 for cluster: 0006, attrId: 0000 messages to be parsed as model WXKG11LM single click • assigned some log messages to be "informational" log type • added "enable info logging" toggle preference • added / edited log messages for clarity • changed lastCheckin event to use Epoch Time stamp (for use with webCoRE) • removed lastCheckinDate because it serves no real purpose on Hubitat • changed resetBatteryReplacedDate() to use new Date() for date/time stamp • removed formatDate() function because it is not used anymore • removed date format and 24 hour clock settings because they are not used anymore • changed numberOfButtons to 4 on install / configure

kquinsland commented 6 years ago

Got the 1.0.4.706 hub update installed and this driver loaded.

Single, Double click & shake work. Press & release also shows up in event log.

Anything else i should be testing?

veeceeoh commented 6 years ago

@kquinsland - No, that's great, thank you! I've been too busy to test it but tonight I will make sure it's working with webCoRE. If it looks good, then I will merge the new code and announce the update.

kquinsland commented 6 years ago

@veeceeoh Just curious, waht's webCoRE? I see it mentioned a lot, but not clear to me what it is / why it's breaking things.

I've only had a few min to test. hopefully in the next 24h or so i'll be able to thoroughly test pairing new buttons (to make sure the signature works) and test the driver events w/ the hubitat -> mqtt bridge.

veeceeoh commented 6 years ago

WebCoRE stands for the web Community's own Rules Engine. It's a rather robust and powerful automation rules Smart app for SmartThings.

veeceeoh commented 6 years ago

I just committed a few fixes to the device handler. In my testing, it's now fully functional and works as expected!

veeceeoh commented 6 years ago

I am merging this pull request now, and announcing the update to the device driver on the Hubitat forum.