From e8939a77d78fa2c181b74b96d0b6b916057e0657 Mon Sep 17 00:00:00 2001 From: "sushant.k1" Date: Mon, 19 Jun 2017 15:33:01 +0530 Subject: [PATCH 1/3] [DHF-16] Added Health Check Implementation for Zigbee Button. --- .../smartthings/zigbee-button.src/.st-ignore | 2 + .../smartthings/zigbee-button.src/README.md | 43 +++++++++++++++++++ .../zigbee-button.src/zigbee-button.groovy | 10 +++++ 3 files changed, 55 insertions(+) create mode 100644 devicetypes/smartthings/zigbee-button.src/.st-ignore create mode 100644 devicetypes/smartthings/zigbee-button.src/README.md diff --git a/devicetypes/smartthings/zigbee-button.src/.st-ignore b/devicetypes/smartthings/zigbee-button.src/.st-ignore new file mode 100644 index 0000000..f78b46e --- /dev/null +++ b/devicetypes/smartthings/zigbee-button.src/.st-ignore @@ -0,0 +1,2 @@ +.st-ignore +README.md diff --git a/devicetypes/smartthings/zigbee-button.src/README.md b/devicetypes/smartthings/zigbee-button.src/README.md new file mode 100644 index 0000000..4bab466 --- /dev/null +++ b/devicetypes/smartthings/zigbee-button.src/README.md @@ -0,0 +1,43 @@ +# ZigBee Button + +Cloud Execution + +Works with: + +* [OSRAM LIGHTIFY Dimming Switch](https://support.smartthings.com/hc/en-us/articles/115000236823-SYLVANIA-Dimming-Switch) +* [Iris Smart Button](https://support.smartthings.com/hc/en-us/articles/115000190186-Iris-Smart-Button) +* [Iris KeyFob](https://support.smartthings.com/hc/en-us/articles/217409686-Iris-Smart-Fob) + +## Table of contents + +* [Capabilities](#capabilities) +* [Health](#device-health) +* [Troubleshooting](#troubleshooting) + +## Capabilities + +* **Actuator** - It represents that a device has commands. +* **Battery** - It defines that the device has a battery +* **Button** - It defines that a device has one or more buttons +* **Holdable Button** - It defines that a device has one or more holdable buttons +* **Configuration** - _configure()_ command called when device is installed or device preferences updated +* **Refresh** - _refresh()_ command for status updates +* **Sensor** - it represents that a Device has attributes. +* **Health Check** - indicates ability to get device health notifications + + +## Device Health + +SmartThings platform will ping the device after `checkInterval` seconds of inactivity in last attempt to reach the device before marking it `OFFLINE` + +* __722min__ checkInterval + +## 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. +It may also happen that you need to reset the device. +Instructions related to pairing, resetting and removing the device from SmartThings can be found in the following link: +* [OSRAM LIGHTIFY Dimming Switch Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/115000236823-SYLVANIA-Dimming-Switch) +* [Iris Smart Button Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/115000190186-Iris-Smart-Button) +* [Iris KeyFob Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/217409686-Iris-Smart-Fob) \ No newline at end of file diff --git a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy index f7e2064..2ab7b45 100644 --- a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy +++ b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy @@ -24,6 +24,7 @@ metadata { capability "Configuration" capability "Refresh" capability "Sensor" + capability "Health Check" command "enrollResponse" @@ -182,6 +183,13 @@ private Map parseNonIasButtonMessage(Map descMap){ } } +/** + * PING is used by Device-Watch in attempt to reach the Device + * */ +def ping() { + refresh() +} + def refresh() { log.debug "Refreshing Battery" @@ -190,6 +198,8 @@ def refresh() { } def configure() { + // Device-Watch allows 2 check-in misses from device (plus 2 mins lag time) + sendEvent(name: "checkInterval", value: 2 * 6 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) log.debug "Configuring Reporting, IAS CIE, and Bindings." def cmds = [] if (device.getDataValue("model") == "3450-L") { From c370e88a6b205ef8e338779111cb476c158cc715 Mon Sep 17 00:00:00 2001 From: jackchi Date: Fri, 30 Jun 2017 10:44:20 -0700 Subject: [PATCH 2/3] [DHF-16] ZigBee Button Device Health Update --- devicetypes/smartthings/zigbee-button.src/README.md | 3 +-- .../zigbee-button.src/zigbee-button.groovy | 13 ++++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/devicetypes/smartthings/zigbee-button.src/README.md b/devicetypes/smartthings/zigbee-button.src/README.md index 4bab466..1ca93ea 100644 --- a/devicetypes/smartthings/zigbee-button.src/README.md +++ b/devicetypes/smartthings/zigbee-button.src/README.md @@ -28,9 +28,8 @@ Works with: ## Device Health -SmartThings platform will ping the device after `checkInterval` seconds of inactivity in last attempt to reach the device before marking it `OFFLINE` +ZigBee Button is marked offline only in the case when Hub is offline. -* __722min__ checkInterval ## Troubleshooting diff --git a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy index 2ab7b45..81c8d64 100644 --- a/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy +++ b/devicetypes/smartthings/zigbee-button.src/zigbee-button.groovy @@ -13,6 +13,8 @@ * for the specific language governing permissions and limitations under the License. * */ + +import groovy.json.JsonOutput import physicalgraph.zigbee.zcl.DataType metadata { @@ -183,13 +185,6 @@ private Map parseNonIasButtonMessage(Map descMap){ } } -/** - * PING is used by Device-Watch in attempt to reach the Device - * */ -def ping() { - refresh() -} - def refresh() { log.debug "Refreshing Battery" @@ -198,8 +193,6 @@ def refresh() { } def configure() { - // Device-Watch allows 2 check-in misses from device (plus 2 mins lag time) - sendEvent(name: "checkInterval", value: 2 * 6 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) log.debug "Configuring Reporting, IAS CIE, and Bindings." def cmds = [] if (device.getDataValue("model") == "3450-L") { @@ -259,6 +252,8 @@ def updated() { } def initialize() { + // Arrival sensors only goes OFFLINE when Hub is off + sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "zigbee", scheme:"untracked"]), displayed: false) if ((device.getDataValue("manufacturer") == "OSRAM") && (device.getDataValue("model") == "LIGHTIFY Dimming Switch")) { sendEvent(name: "numberOfButtons", value: 2) } From c549a5bed09f5b47dd5b966955248b7b48407a2e Mon Sep 17 00:00:00 2001 From: twack Date: Tue, 4 Jul 2017 08:10:09 -0700 Subject: [PATCH 3/3] Added check valve initial state in installed() --- .../smartthings/zwave-water-valve.src/zwave-water-valve.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/devicetypes/smartthings/zwave-water-valve.src/zwave-water-valve.groovy b/devicetypes/smartthings/zwave-water-valve.src/zwave-water-valve.groovy index 4636291..6660640 100644 --- a/devicetypes/smartthings/zwave-water-valve.src/zwave-water-valve.groovy +++ b/devicetypes/smartthings/zwave-water-valve.src/zwave-water-valve.groovy @@ -58,6 +58,7 @@ metadata { def installed() { // Device-Watch simply pings if no device events received for 32min(checkInterval) sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) + response(refresh()) } def updated() {