From 515fab9fa4ed916ead83428b7141851ba98fb7e2 Mon Sep 17 00:00:00 2001 From: Parijat Das Date: Wed, 29 Mar 2017 18:15:20 -0700 Subject: [PATCH] Added health-check for Zigbee Lock --- .../smartthings/zigbee-lock.src/.st-ignore | 2 + .../smartthings/zigbee-lock.src/README.md | 46 +++++++++++++++++++ .../zigbee-lock.src/zigbee-lock.groovy | 11 +++++ 3 files changed, 59 insertions(+) create mode 100644 devicetypes/smartthings/zigbee-lock.src/.st-ignore create mode 100644 devicetypes/smartthings/zigbee-lock.src/README.md diff --git a/devicetypes/smartthings/zigbee-lock.src/.st-ignore b/devicetypes/smartthings/zigbee-lock.src/.st-ignore new file mode 100644 index 0000000..f78b46e --- /dev/null +++ b/devicetypes/smartthings/zigbee-lock.src/.st-ignore @@ -0,0 +1,2 @@ +.st-ignore +README.md diff --git a/devicetypes/smartthings/zigbee-lock.src/README.md b/devicetypes/smartthings/zigbee-lock.src/README.md new file mode 100644 index 0000000..2dc27b4 --- /dev/null +++ b/devicetypes/smartthings/zigbee-lock.src/README.md @@ -0,0 +1,46 @@ +# Zigbee Lock + +Cloud Execution + +Works with: + +* [Yale Push Button Deadbolt (YRD210-HA)](https://www.smartthings.com/works-with-smartthings/door-locks/yale-push-button-deadbolt-yrd210) +* [Yale Touchscreen Lever (YRL220-ZB)](https://www.smartthings.com/works-with-smartthings/door-locks/yale-touchscreen-lever-yrl220) +* [Yale Touchscreen Deadbolt (YRD220-HA))](https://www.smartthings.com/works-with-smartthings/door-locks/yale-touchscreen-deadbolt-yrd220) +* [Yale Key Free Touchscreen Deadbolt (YRD240-HA)](https://www.smartthings.com/works-with-smartthings/door-locks/yale-key-free-touchscreen-deadbolt-yrd240) +* [Yale Push Button Lever Lock (YRL210-HA)](https://www.smartthings.com/works-with-smartthings/door-locks/yale-push-button-lever-lock-yrl210) + +## Table of contents + +* [Capabilities](#capabilities) +* [Health](#device-health) +* [Battery](#battery-specification) +* [Troubleshooting](#troubleshooting) + +## Capabilities + +* **Actuator** - represents that a Device has commands +* **Lock** - allows for the control of a lock device +* **Refresh** - _refresh()_ command for status updates +* **Sensor** - detects sensor events +* **Battery** - defines device uses a battery +* **Configuration** - _configure()_ command called when device is installed or device preferences updated +* **Health Check** - indicates ability to get device health notifications + +## Device Health + +Yale Push Button Deadbolt (YRD210-HA) is a Zigbee device and checks in every 1 hour. +Device-Watch allows 2 check-in misses from device plus some lag time. So Check-in interval = (2*60 + 2)mins = 122 mins. + + * __122min__ checkInterval + +## Battery Specification + +Four AA 1.5V batteries are required. + +## Troubleshooting + +If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the device is out of range. +Pairing needs to be tried again by placing the device closer to the hub. +Instructions related to pairing, resetting and removing the sensor from SmartThings can be found in the following link: +* [Yale Locks Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/205138400) \ No newline at end of file diff --git a/devicetypes/smartthings/zigbee-lock.src/zigbee-lock.groovy b/devicetypes/smartthings/zigbee-lock.src/zigbee-lock.groovy index fb31a6b..b14730d 100644 --- a/devicetypes/smartthings/zigbee-lock.src/zigbee-lock.groovy +++ b/devicetypes/smartthings/zigbee-lock.src/zigbee-lock.groovy @@ -24,6 +24,7 @@ import physicalgraph.zigbee.zcl.DataType capability "Sensor" capability "Battery" capability "Configuration" + capability "Health Check" fingerprint profileId: "0104", inClusters: "0000,0001,0003,0004,0005,0009,0020,0101,0402,0B05,FDBD", outClusters: "000A,0019", manufacturer: "Kwikset", model: "SMARTCODE_DEADBOLT_5", deviceJoinName: "Kwikset 5-Button Deadbolt" fingerprint profileId: "0104", inClusters: "0000,0001,0003,0004,0005,0009,0020,0101,0402,0B05,FDBD", outClusters: "000A,0019", manufacturer: "Kwikset", model: "SMARTCODE_LEVER_5", deviceJoinName: "Kwikset 5-Button Lever" @@ -83,6 +84,9 @@ def uninstalled() { } def configure() { + // Device-Watch allows 2 check-in misses from device + ping (plus 2 min lag time) + sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) + def cmds = zigbee.configureReporting(CLUSTER_DOORLOCK, DOORLOCK_ATTR_LOCKSTATE, DataType.ENUM8, 0, 3600, null) + @@ -92,6 +96,13 @@ def configure() { return refresh() + cmds // send refresh cmds as part of config } +/** + * PING is used by Device-Watch in attempt to reach the Device + * */ +def ping() { + zigbee.readAttribute(CLUSTER_DOORLOCK, DOORLOCK_ATTR_LOCKSTATE) +} + def refresh() { def cmds = zigbee.readAttribute(CLUSTER_DOORLOCK, DOORLOCK_ATTR_LOCKSTATE) +