Xiaomi
Xiaomi copied to clipboard
Aqara Curtain Motor DTH (in beta)
I am starting work on a DTH for the Aqara Curtain Motor.
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
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.