Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aqara Curtain Motor DTH (in beta) #116

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

veeceeoh
Copy link
Collaborator

I am starting work on a DTH for the Aqara Curtain Motor.

veeceeoh added 3 commits May 15, 2018 10:23
Changes
• changed capability `Switch` to `Door control`
• changed `on`/`off` references to `open`/`close` where needed
• added "open" and "close" app buttons which can be used in addition to pressing on the main tile (which works as a toggle)
• added an 8 second countdown timer to update `opening` / `closing` status to `open` / `closed`, respectively (because a attribute report message that the motor has finished opening / closing hasn't been confirmed)
• added `installed()`, `configure()`, and `updated()` routines to make sure health check interval is set either when the device is paired or preferences are set. These routines can be expanded later if anything else needs to be set up at the time of pairing or when preferences are saved.
• added user-selectable preferences for "Info" and Debug message logging, along with `displayDebugLog()` and `displayInfoLog()` routines.
• renamed `lastCheckin` custom event sent on every received message to `lastCheckinCoRE`, which now stores an Epoch Date/Time stamp that can be used in WebCoRE
• renamed `parseCustomMessage` to `parseOpenCloseReport`
• removed any code related to battery voltage / percentage
• updated deprecated zigbee command code to currently accepted ST zigbee function calls
• added lots of hopefully helpful comment lines
• various reformatting and more logical reordering of function calls


Sources for conversion to Door Control capability:
• http://docs.smartthings.com/en/latest/capabilities-reference.html#door-controlhttps://community.smartthings.com/t/door-control-capability-command/8495https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/master/devicetypes/smartthings/zwave-garage-door-opener.src/zwave-garage-door-opener.groovy
@veeceeoh
Copy link
Collaborator Author

I have updated the DTH to what should hopefully be a fully working beta.

The most important change was going from using capability switch to Door control, which is most appropriate device class to assign to a curtain motor device.

Also, the preference settings now include toggles for info and debug message output to Live Logging, and the info messages will include more specific information regarding relevant attribute report messages received from the motor that still need interpreting.

Change List
• changed capability Switch to Door control
• changed on/off references to open/close where needed
• added "open" and "close" app buttons which can be used in addition to pressing on the main tile (which works as a toggle)
• added an 8 second countdown timer to update opening / closing status to open / closed, respectively (because a attribute report message that the motor has finished opening / closing hasn't been confirmed)
• added installed(), configure(), and updated() routines to make sure health check interval is set either when the device is paired or preferences are set. These routines can be expanded later if anything else needs to be set up at the time of pairing or when preferences are saved.
• added user-selectable preferences for "Info" and Debug message logging, along with displayDebugLog() and displayInfoLog() routines.
• renamed lastCheckin custom event sent on every received message to lastCheckinCoRE, which now stores an Epoch Date/Time stamp that can be used in WebCoRE
• renamed parseCustomMessage to parseOpenCloseReport
• removed any code related to battery voltage / percentage
• updated deprecated zigbee command code to currently accepted ST zigbee function calls
• added lots of hopefully helpful comment lines
• various reformatting and more logical reordering of function calls

Sources for conversion to Door Control capability:
http://docs.smartthings.com/en/latest/capabilities-reference.html#door-control
https://community.smartthings.com/t/door-control-capability-command/8495
Z-Wave Garage Door Opener DTH on GitHub/SmartThingsPublic

Changes
• (Hopefully) fixed info log message output of specific bytes of interest in any read attribute messages from Cluster `000D` / Attribute ID `0055`
• Modified `parseReportAttributeMessage()` to handle motor finished opening/closing messages
• Removed some unnecessary log output messages
• Added traps in `open()` and `close()` to ignore redundant open/close requests
• Changed automatic countdown to call `motorfinished()` routine to 15 seconds
• Added trap in `motorfinished()` to prevent redundant `door open` or `door closed` events
• Fixed log output in `refresh()` to use `displayInfoLog()`
• Renamed `motorFinished()` to `motorFinishedCountdown()`
• Added more helpful comments in the code
@veeceeoh
Copy link
Collaborator Author

It turns out someone has finished a working SmartThings device handler for the curtain motor.

I will leave this Pull Request open because I've asked the author if his code can be added to the repository here, and I've already seen a few ways that it could possibly be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant