From 648dee90b654f62565997e506f0b66b631e078ae Mon Sep 17 00:00:00 2001 From: "piyush.c" Date: Fri, 16 Dec 2016 15:19:11 +0530 Subject: [PATCH] [CHF-480] Health Check implementation for Z-Wave Thermostat --- .../zwave-thermostat.src/zwave-thermostat.groovy | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy b/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy index 404882a..8d9f117 100644 --- a/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy +++ b/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy @@ -20,6 +20,7 @@ metadata { capability "Configuration" capability "Polling" capability "Sensor" + capability "Health Check" attribute "thermostatFanState", "string" @@ -30,6 +31,7 @@ metadata { fingerprint deviceId: "0x08" fingerprint inClusters: "0x43,0x40,0x44,0x31" + fingerprint mfr:"0039", prod:"0011", model:"0001", deviceJoinName: "Honeywell Z-Wave Thermostat" } // simulator metadata @@ -123,6 +125,11 @@ metadata { } } +def updated(){ + // 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]) +} + def parse(String description) { def map = createEvent(zwaveEvent(zwave.parse(description, [0x42:1, 0x43:2, 0x31: 3]))) @@ -393,6 +400,14 @@ def setCoolingSetpoint(Double degrees, Integer delay = 30000) { ], delay) } +/** + * PING is used by Device-Watch in attempt to reach the Device + * */ +def ping() { + log.debug "ping() called" + poll() +} + def configure() { delayBetween([ zwave.thermostatModeV2.thermostatModeSupportedGet().format(),