From ef8611d2eaa8bcb529ecb4984292dadb727133a9 Mon Sep 17 00:00:00 2001 From: "piyush.c" Date: Fri, 16 Dec 2016 17:21:02 +0530 Subject: [PATCH 01/12] [CHF-482] Health Check implementation for Z-Wave Metering Dimmer --- .../zwave-metering-dimmer.groovy | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/devicetypes/smartthings/zwave-metering-dimmer.src/zwave-metering-dimmer.groovy b/devicetypes/smartthings/zwave-metering-dimmer.src/zwave-metering-dimmer.groovy index 4631203..7773917 100644 --- a/devicetypes/smartthings/zwave-metering-dimmer.src/zwave-metering-dimmer.groovy +++ b/devicetypes/smartthings/zwave-metering-dimmer.src/zwave-metering-dimmer.groovy @@ -25,10 +25,12 @@ metadata { capability "Switch Level" capability "Sensor" capability "Actuator" + capability "Health Check" command "reset" fingerprint inClusters: "0x26,0x32" + fingerprint mfr:"0086", prod:"0003", model:"001B", deviceJoinName: "Aeon Labs Micro Smart Dimmer 2E" } simulator { @@ -98,6 +100,9 @@ def parse(String description) { } 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]) + response(refresh()) } @@ -162,6 +167,14 @@ def poll() { ], 1000) } +/** + * PING is used by Device-Watch in attempt to reach the Device + * */ +def ping() { + log.debug "ping() called" + refresh() +} + def refresh() { delayBetween([ zwave.switchMultilevelV1.switchMultilevelGet().format(), From 00224c2d0b8f57201e068690018dfa825e222583 Mon Sep 17 00:00:00 2001 From: Zach Varberg Date: Thu, 30 Mar 2017 15:44:40 -0500 Subject: [PATCH 02/12] Support config on both temp-humidty firmwares This solves an issue with invalid configuration of the reporting for humidity on the smartsense-temp-humidity-sensor. This issue was masked by the fact that the device has a default configuration for reporting humidity, but the configuration has never been valid as it used an incorrect dataType for the configuration. This resolves: https://smartthings.atlassian.net/browse/DPROT-263 This resolves: https://smartthings.atlassian.net/browse/EBF-1205 This resolves: https://smartthings.atlassian.net/browse/DVCSMP-2420 --- .../smartsense-temp-humidity-sensor.groovy | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy b/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy index a655c21..4210ee2 100644 --- a/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy +++ b/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy @@ -135,10 +135,7 @@ def refresh() { return zigbee.readAttribute(0xFC45, 0x0000, ["mfgCode": 0x104E]) + // New firmware zigbee.readAttribute(0xFC45, 0x0000, ["mfgCode": 0xC2DF]) + // Original firmware zigbee.readAttribute(zigbee.TEMPERATURE_MEASUREMENT_CLUSTER, 0x0000) + - zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0020) + - zigbee.configureReporting(0xFC45, 0x0000, DataType.INT16, 30, 3600, 100) + - zigbee.batteryConfig() + - zigbee.temperatureConfig(30, 300) + zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0020) } def configure() { @@ -150,5 +147,10 @@ def configure() { // temperature minReportTime 30 seconds, maxReportTime 5 min. Reporting interval if no activity // battery minReport 30 seconds, maxReportTime 6 hrs by default - return refresh() + return refresh() + + zigbee.configureReporting(0xFC45, 0x0000, DataType.UINT16, 30, 3600, 100, ["mfgCode": 0x104E]) + // New firmware + zigbee.configureReporting(0xFC45, 0x0000, DataType.UINT16, 30, 3600, 100, ["mfgCode": 0xC2DF]) + // Original firmware + zigbee.batteryConfig() + + zigbee.temperatureConfig(30, 300) + } From 515fab9fa4ed916ead83428b7141851ba98fb7e2 Mon Sep 17 00:00:00 2001 From: Parijat Das Date: Wed, 29 Mar 2017 18:15:20 -0700 Subject: [PATCH 03/12] 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) + From 43bedd41a8430bd5dbf88ee56fa61cab25872a5a Mon Sep 17 00:00:00 2001 From: CosmicPuppy Date: Mon, 3 Apr 2017 00:21:11 -0700 Subject: [PATCH 04/12] To Wattvision power metering Sensor DTH, added Capability "Sensor" per http://docs.smartthings.com/en/latest/device-type-developers-guide/overview.html?highlight=sensor%20actuator#actuator-and-sensor. --- devicetypes/smartthings/wattvision.src/wattvision.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/devicetypes/smartthings/wattvision.src/wattvision.groovy b/devicetypes/smartthings/wattvision.src/wattvision.groovy index e87a344..e2d136c 100644 --- a/devicetypes/smartthings/wattvision.src/wattvision.groovy +++ b/devicetypes/smartthings/wattvision.src/wattvision.groovy @@ -20,6 +20,7 @@ metadata { definition(name: "Wattvision", namespace: "smartthings", author: "Steve Vlaminck") { capability "Power Meter" capability "Refresh" + capability "Sensor" attribute "powerContent", "string" } From 2fd8cf14162807d30ddda173e6e17c308f230b8f Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Tue, 4 Apr 2017 14:38:11 -0700 Subject: [PATCH 05/12] Revert "Revert "Added health-check for Logitech Harmony Hub"" --- .../logitech-harmony-hub-c2c.groovy | 15 +++++++++++++++ .../logitech-harmony-connect.groovy | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy b/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy index 8395f80..e287e94 100644 --- a/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy +++ b/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy @@ -7,6 +7,7 @@ metadata { definition (name: "Logitech Harmony Hub C2C", namespace: "smartthings", author: "SmartThings") { capability "Media Controller" capability "Refresh" + capability "Health Check" command "activityoff" command "alloff" @@ -38,6 +39,16 @@ metadata { } } +def installed() { + log.debug "installed()" + sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false) +} + +def updated() { + log.debug "updated()" + sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false) +} + def startActivity(String activityId) { log.debug "Executing 'Start Activity'" log.trace parent.activity("$device.deviceNetworkId-$activityId","start") @@ -58,6 +69,10 @@ def poll() { log.trace parent.poll() } +def ping() { + refresh() +} + def refresh() { log.debug "Executing 'Refresh'" log.trace parent.poll() diff --git a/smartapps/smartthings/logitech-harmony-connect.src/logitech-harmony-connect.groovy b/smartapps/smartthings/logitech-harmony-connect.src/logitech-harmony-connect.groovy index 43c55fa..72763ef 100644 --- a/smartapps/smartthings/logitech-harmony-connect.src/logitech-harmony-connect.groovy +++ b/smartapps/smartthings/logitech-harmony-connect.src/logitech-harmony-connect.groovy @@ -511,6 +511,10 @@ def pollResponse(response, data) { if (ResponseValues) { def map = [:] ResponseValues.hubs.each { + // Device-Watch relies on the Logitech Harmony Cloud to get the Device state. + def isAlive = it.value.status + def d = getChildDevice("harmony-${it.key}") + d?.sendEvent(name: "DeviceWatch-DeviceStatus", value: isAlive!=504? "online":"offline", displayed: false, isStateChange: true) if (it.value.message == "OK") { map["${it.key}"] = "${it.value.response.data.currentAvActivity},${it.value.response.data.activityStatus}" def hub = getChildDevice("harmony-${it.key}") From 1545707ae3f9c493f27a741532b2f0267c538853 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Tue, 4 Apr 2017 14:38:54 -0700 Subject: [PATCH 06/12] Revert "[CHF-571] [CHF-568] Revert untested Health Check on Keen Home EcoNet" --- .../keen-home-smart-vent.src/keen-home-smart-vent.groovy | 4 ++-- devicetypes/smartthings/econet-vent.src/econet-vent.groovy | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/devicetypes/keen-home/keen-home-smart-vent.src/keen-home-smart-vent.groovy b/devicetypes/keen-home/keen-home-smart-vent.src/keen-home-smart-vent.groovy index ee9e703..78ab8b7 100644 --- a/devicetypes/keen-home/keen-home-smart-vent.src/keen-home-smart-vent.groovy +++ b/devicetypes/keen-home/keen-home-smart-vent.src/keen-home-smart-vent.groovy @@ -11,7 +11,7 @@ metadata { capability "Sensor" capability "Temperature Measurement" capability "Battery" - // capability "Health Check" + capability "Health Check" command "getLevel" command "getOnOff" @@ -476,7 +476,7 @@ def configure() { // Device-Watch allows 2 check-in misses from device + ping (plus 1 min lag time) // enrolls with default periodic reporting until newer 5 min interval is confirmed - // sendEvent(name: "checkInterval", value: 2 * 10 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) + sendEvent(name: "checkInterval", value: 2 * 10 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) // get ZigBee ID by hidden tile because that's the only way we can do it setZigBeeIdTile() diff --git a/devicetypes/smartthings/econet-vent.src/econet-vent.groovy b/devicetypes/smartthings/econet-vent.src/econet-vent.groovy index 344f1b5..f441beb 100644 --- a/devicetypes/smartthings/econet-vent.src/econet-vent.groovy +++ b/devicetypes/smartthings/econet-vent.src/econet-vent.groovy @@ -26,13 +26,13 @@ metadata { capability "Sensor" capability "Polling" capability "Configuration" - // capability "Health Check" + capability "Health Check" command "open" command "close" fingerprint deviceId: "0x1100", inClusters: "0x26,0x72,0x86,0x77,0x80,0x20" - // fingerprint mfr:"0157", prod:"0100", model:"0100", deviceJoinName: "EcoNet Controls Z-Wave Vent" + fingerprint mfr:"0157", prod:"0100", model:"0100", deviceJoinName: "EcoNet Controls Z-Wave Vent" } simulator { @@ -88,7 +88,7 @@ def parse(String description) { //send the command to stop polling 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]) + sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) response("poll stop") } From 8197097e1da51c00844fbe45f100f4347dc87910 Mon Sep 17 00:00:00 2001 From: jackchi Date: Thu, 6 Apr 2017 14:15:08 -0700 Subject: [PATCH 07/12] Revert "Added health-check for FortrezZ Siren Strobe Alarm" This reverts commit 7a7a08ea6ea413de32a5fb67ba219fff077e1bbc. --- .../smartthings/zwave-siren.src/.st-ignore | 2 - .../smartthings/zwave-siren.src/README.md | 42 ------------------- .../zwave-siren.src/zwave-siren.groovy | 14 ------- 3 files changed, 58 deletions(-) delete mode 100644 devicetypes/smartthings/zwave-siren.src/.st-ignore delete mode 100644 devicetypes/smartthings/zwave-siren.src/README.md diff --git a/devicetypes/smartthings/zwave-siren.src/.st-ignore b/devicetypes/smartthings/zwave-siren.src/.st-ignore deleted file mode 100644 index f78b46e..0000000 --- a/devicetypes/smartthings/zwave-siren.src/.st-ignore +++ /dev/null @@ -1,2 +0,0 @@ -.st-ignore -README.md diff --git a/devicetypes/smartthings/zwave-siren.src/README.md b/devicetypes/smartthings/zwave-siren.src/README.md deleted file mode 100644 index ed17b1e..0000000 --- a/devicetypes/smartthings/zwave-siren.src/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Z-wave Siren - -Cloud Execution - -Works with: - -* [FortrezZ Siren Strobe Alarm](https://www.smartthings.com/works-with-smartthings/other/fortrezz-water-valve) - -## Table of contents - -* [Capabilities](#capabilities) -* [Health](#device-health) -* [Troubleshooting](#troubleshooting) - -## Capabilities - -* **Actuator** - represents that a Device has commands -* **Alarm** - allows for interacting with devices that serve as alarms -* **Battery** - defines device uses a battery -* **Health Check** - indicates ability to get device health notifications -* **Polling** - represents that poll() can be implemented for the device -* **Refresh** - _refresh()_ command for status updates -* **Sensor** - detects sensor events -* **Switch** - can detect state (possible values: on/off) - -## Device Health - -FortrezZ Siren Strobe Alarm is polled by the hub. -As of hubCore version 0.14.38 the hub sends up reports every 15 minutes regardless of whether the state changed. -Device-Watch allows 2 check-in misses from device plus some lag time. So Check-in interval = (2*15 + 2)mins = 32 mins. -Not to mention after going OFFLINE when the device is plugged back in, it might take a considerable amount of time for -the device to appear as ONLINE again. This is because if this listening device does not respond to two poll requests in a row, -it is not polled for 5 minutes by the hub. This can delay up the process of being marked ONLINE by quite some time. - -* __32min__ 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. -Instructions related to pairing, resetting and removing the device from SmartThings can be found in the following link: -* [FortrezZ Siren Strobe Alarm Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/202294760-FortrezZ-Siren-Strobe-Alarm) \ No newline at end of file diff --git a/devicetypes/smartthings/zwave-siren.src/zwave-siren.groovy b/devicetypes/smartthings/zwave-siren.src/zwave-siren.groovy index d368610..9ee8071 100644 --- a/devicetypes/smartthings/zwave-siren.src/zwave-siren.groovy +++ b/devicetypes/smartthings/zwave-siren.src/zwave-siren.groovy @@ -20,7 +20,6 @@ metadata { capability "Actuator" capability "Alarm" capability "Battery" - capability "Health Check" capability "Polling" capability "Refresh" capability "Sensor" @@ -28,7 +27,6 @@ metadata { fingerprint inClusters: "0x20,0x25,0x86,0x80,0x85,0x72,0x71" - fingerprint mfr:"0084", prod:"0313", model:"010B", deviceJoinName: "FortrezZ Siren Strobe Alarm" } simulator { @@ -60,11 +58,6 @@ 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 createEvents(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) { def map = [ name: "battery", unit: "%" ] if (cmd.batteryLevel == 0xFF) { @@ -126,13 +119,6 @@ def both() { on() } -/** - * PING is used by Device-Watch in attempt to reach the Device - * */ -def ping() { - refresh() -} - def refresh() { log.debug "sending battery refresh command" zwave.batteryV1.batteryGet().format() From 664b300b37693cb3bb6d068ecfe1ba04ac456815 Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Mon, 10 Apr 2017 14:10:32 -0700 Subject: [PATCH 08/12] ICP-554 ocf resource type update --- devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy | 2 +- .../zwave-dimmer-switch-generic.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy index 68878df..cd2bca1 100644 --- a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy +++ b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy @@ -13,7 +13,7 @@ */ metadata { - definition (name: "ZigBee Dimmer", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { + definition (name: "ZigBee Dimmer", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Configuration" capability "Refresh" diff --git a/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy b/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy index bb94d36..5b0890c 100644 --- a/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy +++ b/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy @@ -12,7 +12,7 @@ * */ metadata { - definition (name: "Z-Wave Dimmer Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { + definition (name: "Z-Wave Dimmer Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Switch Level" capability "Actuator" capability "Health Check" From daefec9d1fd52f3d5f74ba8f320c48e4cf0fc0ac Mon Sep 17 00:00:00 2001 From: Parijat Das Date: Tue, 11 Apr 2017 09:30:01 +0530 Subject: [PATCH 09/12] Added checkInterval sendEvent in installed() section for all zwave DTHs --- .../aeon-multisensor-gen5.src/aeon-multisensor-gen5.groovy | 5 +++++ devicetypes/smartthings/aeon-siren.src/aeon-siren.groovy | 5 +++++ .../smartthings/dimmer-switch.src/dimmer-switch.groovy | 5 +++++ devicetypes/smartthings/econet-vent.src/econet-vent.groovy | 5 +++++ .../fortrezz-water-valve.src/fortrezz-water-valve.groovy | 5 +++++ .../smartsense-moisture.src/smartsense-moisture.groovy | 5 +++++ .../zwave-dimmer-switch-generic.groovy | 5 +++++ .../zwave-door-window-sensor.groovy | 5 +++++ .../zwave-garage-door-opener.groovy | 5 +++++ devicetypes/smartthings/zwave-lock.src/zwave-lock.groovy | 5 +++++ .../zwave-metering-dimmer.src/zwave-metering-dimmer.groovy | 5 +++++ .../zwave-metering-switch.src/zwave-metering-switch.groovy | 5 +++++ .../zwave-motion-sensor.src/zwave-motion-sensor.groovy | 7 ++++++- .../zwave-smoke-alarm.src/zwave-smoke-alarm.groovy | 7 ++++++- .../zwave-switch-generic.src/zwave-switch-generic.groovy | 5 +++++ .../smartthings/zwave-switch.src/zwave-switch.groovy | 5 +++++ .../zwave-thermostat.src/zwave-thermostat.groovy | 5 +++++ 17 files changed, 87 insertions(+), 2 deletions(-) diff --git a/devicetypes/smartthings/aeon-multisensor-gen5.src/aeon-multisensor-gen5.groovy b/devicetypes/smartthings/aeon-multisensor-gen5.src/aeon-multisensor-gen5.groovy index 358f2a5..ab1b50c 100644 --- a/devicetypes/smartthings/aeon-multisensor-gen5.src/aeon-multisensor-gen5.groovy +++ b/devicetypes/smartthings/aeon-multisensor-gen5.src/aeon-multisensor-gen5.groovy @@ -100,6 +100,11 @@ 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]) +} + 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]) diff --git a/devicetypes/smartthings/aeon-siren.src/aeon-siren.groovy b/devicetypes/smartthings/aeon-siren.src/aeon-siren.groovy index 8b961aa..1015a9b 100644 --- a/devicetypes/smartthings/aeon-siren.src/aeon-siren.groovy +++ b/devicetypes/smartthings/aeon-siren.src/aeon-siren.groovy @@ -58,6 +58,11 @@ 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]) +} + 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]) diff --git a/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy b/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy index 892baf1..370ecb7 100644 --- a/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy +++ b/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy @@ -84,6 +84,11 @@ 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]) +} + 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]) diff --git a/devicetypes/smartthings/econet-vent.src/econet-vent.groovy b/devicetypes/smartthings/econet-vent.src/econet-vent.groovy index f441beb..f91f6c1 100644 --- a/devicetypes/smartthings/econet-vent.src/econet-vent.groovy +++ b/devicetypes/smartthings/econet-vent.src/econet-vent.groovy @@ -85,6 +85,11 @@ def parse(String description) { result } +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]) +} + //send the command to stop polling def updated() { // Device-Watch simply pings if no device events received for 32min(checkInterval) diff --git a/devicetypes/smartthings/fortrezz-water-valve.src/fortrezz-water-valve.groovy b/devicetypes/smartthings/fortrezz-water-valve.src/fortrezz-water-valve.groovy index 77b9595..80ee6a0 100644 --- a/devicetypes/smartthings/fortrezz-water-valve.src/fortrezz-water-valve.groovy +++ b/devicetypes/smartthings/fortrezz-water-valve.src/fortrezz-water-valve.groovy @@ -50,6 +50,11 @@ 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]) +} + 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]) diff --git a/devicetypes/smartthings/smartsense-moisture.src/smartsense-moisture.groovy b/devicetypes/smartthings/smartsense-moisture.src/smartsense-moisture.groovy index e2d78f4..4395e53 100644 --- a/devicetypes/smartthings/smartsense-moisture.src/smartsense-moisture.groovy +++ b/devicetypes/smartthings/smartsense-moisture.src/smartsense-moisture.groovy @@ -91,6 +91,11 @@ def parse(String description) { return result } +def installed() { + // Device-Watch simply pings if no device events received for 482min(checkInterval) + sendEvent(name: "checkInterval", value: 2 * 4 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) +} + def updated() { // Device-Watch simply pings if no device events received for 482min(checkInterval) sendEvent(name: "checkInterval", value: 2 * 4 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) diff --git a/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy b/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy index 5b0890c..40f7ce6 100644 --- a/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy +++ b/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy @@ -78,6 +78,11 @@ 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]) +} + 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]) diff --git a/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy b/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy index 0f751e9..d5493a5 100644 --- a/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy +++ b/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy @@ -79,6 +79,11 @@ def parse(String description) { return result } +def installed() { + // Device-Watch simply pings if no device events received for 482min(checkInterval) + sendEvent(name: "checkInterval", value: 2 * 4 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) +} + def updated() { // Device-Watch simply pings if no device events received for 482min(checkInterval) sendEvent(name: "checkInterval", value: 2 * 4 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) diff --git a/devicetypes/smartthings/zwave-garage-door-opener.src/zwave-garage-door-opener.groovy b/devicetypes/smartthings/zwave-garage-door-opener.src/zwave-garage-door-opener.groovy index 65357e4..59fc29c 100644 --- a/devicetypes/smartthings/zwave-garage-door-opener.src/zwave-garage-door-opener.groovy +++ b/devicetypes/smartthings/zwave-garage-door-opener.src/zwave-garage-door-opener.groovy @@ -65,6 +65,11 @@ metadata { import physicalgraph.zwave.commands.barrieroperatorv1.* +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]) +} + 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]) diff --git a/devicetypes/smartthings/zwave-lock.src/zwave-lock.groovy b/devicetypes/smartthings/zwave-lock.src/zwave-lock.groovy index 697fe3d..38f9e43 100644 --- a/devicetypes/smartthings/zwave-lock.src/zwave-lock.groovy +++ b/devicetypes/smartthings/zwave-lock.src/zwave-lock.groovy @@ -68,6 +68,11 @@ metadata { import physicalgraph.zwave.commands.doorlockv1.* import physicalgraph.zwave.commands.usercodev1.* +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]) +} + 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]) diff --git a/devicetypes/smartthings/zwave-metering-dimmer.src/zwave-metering-dimmer.groovy b/devicetypes/smartthings/zwave-metering-dimmer.src/zwave-metering-dimmer.groovy index 514ef34..05a2737 100644 --- a/devicetypes/smartthings/zwave-metering-dimmer.src/zwave-metering-dimmer.groovy +++ b/devicetypes/smartthings/zwave-metering-dimmer.src/zwave-metering-dimmer.groovy @@ -100,6 +100,11 @@ def parse(String description) { result } +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]) +} + 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]) diff --git a/devicetypes/smartthings/zwave-metering-switch.src/zwave-metering-switch.groovy b/devicetypes/smartthings/zwave-metering-switch.src/zwave-metering-switch.groovy index 5f1d0c9..deb07d1 100644 --- a/devicetypes/smartthings/zwave-metering-switch.src/zwave-metering-switch.groovy +++ b/devicetypes/smartthings/zwave-metering-switch.src/zwave-metering-switch.groovy @@ -74,6 +74,11 @@ 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]) +} + 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]) diff --git a/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy b/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy index 2395602..653e219 100644 --- a/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy +++ b/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy @@ -51,7 +51,12 @@ metadata { } } -def updated(){ +def installed() { +// Device wakes up every 4 hours, this interval allows us to miss one wakeup notification before marking offline + sendEvent(name: "checkInterval", value: 8 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) +} + +def updated() { // Device wakes up every 4 hours, this interval allows us to miss one wakeup notification before marking offline sendEvent(name: "checkInterval", value: 8 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) } diff --git a/devicetypes/smartthings/zwave-smoke-alarm.src/zwave-smoke-alarm.groovy b/devicetypes/smartthings/zwave-smoke-alarm.src/zwave-smoke-alarm.groovy index f644386..a5de607 100644 --- a/devicetypes/smartthings/zwave-smoke-alarm.src/zwave-smoke-alarm.groovy +++ b/devicetypes/smartthings/zwave-smoke-alarm.src/zwave-smoke-alarm.groovy @@ -53,7 +53,12 @@ metadata { } } -def updated(){ +def installed() { +// Device checks in every hour, this interval allows us to miss one check-in notification before marking offline + sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) +} + +def updated() { // Device checks in every hour, this interval allows us to miss one check-in notification before marking offline sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) } diff --git a/devicetypes/smartthings/zwave-switch-generic.src/zwave-switch-generic.groovy b/devicetypes/smartthings/zwave-switch-generic.src/zwave-switch-generic.groovy index e2f65d4..2a14e8e 100644 --- a/devicetypes/smartthings/zwave-switch-generic.src/zwave-switch-generic.groovy +++ b/devicetypes/smartthings/zwave-switch-generic.src/zwave-switch-generic.groovy @@ -61,6 +61,11 @@ metadata { } } +def installed(){ +// Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time + sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) +} + def updated(){ // Device-Watch simply pings if no device events received for checkInterval duration of 32min = 2 * 15min + 2min lag time sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) diff --git a/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy b/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy index 151a116..0406a1e 100644 --- a/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy +++ b/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy @@ -65,6 +65,11 @@ 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]) +} + 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]) diff --git a/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy b/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy index 69c6c20..743ab0f 100644 --- a/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy +++ b/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy @@ -124,6 +124,11 @@ 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]) +} + 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]) From 096f4f767f391ca5b0ed2f7d96b3678c3c419665 Mon Sep 17 00:00:00 2001 From: jackchi Date: Tue, 11 Apr 2017 08:52:45 -0700 Subject: [PATCH 10/12] [CHF-596] Device Health Enrollment Fix --- .../logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy b/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy index e287e94..b3d3888 100644 --- a/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy +++ b/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy @@ -1,3 +1,4 @@ +import groovy.json.JsonOutput /** * Logitech Harmony Hub * From 1f6a27f3817d21da5944625fd39a17f07dd20382 Mon Sep 17 00:00:00 2001 From: juano2310 Date: Tue, 11 Apr 2017 13:55:43 -0400 Subject: [PATCH 11/12] ICP-554 - ocfDeviceType: "oic.d.light" more --- devicetypes/smartthings/cree-bulb.src/cree-bulb.groovy | 2 +- devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy | 2 +- .../smartthings/lifx-color-bulb.src/lifx-color-bulb.groovy | 4 ++-- .../smartthings/lifx-white-bulb.src/lifx-white-bulb.groovy | 4 ++-- devicetypes/smartthings/rgbw-light.src/rgbw-light.groovy | 2 +- .../sylvania-ultra-iq.src/sylvania-ultra-iq.groovy | 2 +- .../zigbee-dimmer-power.src/zigbee-dimmer-power.groovy | 2 +- .../smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy | 2 +- devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy | 2 +- .../smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy | 2 +- .../zll-white-color-temperature-bulb-5000k.groovy | 4 ++-- .../zll-white-color-temperature-bulb.groovy | 2 +- .../zwave-dimmer-switch-generic.groovy | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/devicetypes/smartthings/cree-bulb.src/cree-bulb.groovy b/devicetypes/smartthings/cree-bulb.src/cree-bulb.groovy index e04a47a..ff3b3d9 100644 --- a/devicetypes/smartthings/cree-bulb.src/cree-bulb.groovy +++ b/devicetypes/smartthings/cree-bulb.src/cree-bulb.groovy @@ -15,7 +15,7 @@ */ metadata { - definition (name: "Cree Bulb", namespace: "smartthings", author: "SmartThings") { + definition (name: "Cree Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Configuration" diff --git a/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy b/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy index 2510a2f..778796b 100644 --- a/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy +++ b/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy @@ -42,7 +42,7 @@ */ metadata { - definition (name: "GE Link Bulb", namespace: "smartthings", author: "SmartThings") { + definition (name: "GE Link Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Configuration" diff --git a/devicetypes/smartthings/lifx-color-bulb.src/lifx-color-bulb.groovy b/devicetypes/smartthings/lifx-color-bulb.src/lifx-color-bulb.groovy index 964f8bf..f49a7a1 100644 --- a/devicetypes/smartthings/lifx-color-bulb.src/lifx-color-bulb.groovy +++ b/devicetypes/smartthings/lifx-color-bulb.src/lifx-color-bulb.groovy @@ -5,7 +5,7 @@ * */ metadata { - definition (name: "LIFX Color Bulb", namespace: "smartthings", author: "LIFX") { + definition (name: "LIFX Color Bulb", namespace: "smartthings", author: "LIFX", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Color Control" capability "Color Temperature" @@ -190,7 +190,7 @@ def off() { def refresh() { log.debug "Executing 'refresh'" - + def resp = parent.apiGET("/lights/${selector()}") if (resp.status == 404) { state.online = false diff --git a/devicetypes/smartthings/lifx-white-bulb.src/lifx-white-bulb.groovy b/devicetypes/smartthings/lifx-white-bulb.src/lifx-white-bulb.groovy index 472f269..5f0908e 100644 --- a/devicetypes/smartthings/lifx-white-bulb.src/lifx-white-bulb.groovy +++ b/devicetypes/smartthings/lifx-white-bulb.src/lifx-white-bulb.groovy @@ -5,7 +5,7 @@ * */ metadata { - definition (name: "LIFX White Bulb", namespace: "smartthings", author: "LIFX") { + definition (name: "LIFX White Bulb", namespace: "smartthings", author: "LIFX", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Color Temperature" capability "Switch" @@ -119,7 +119,7 @@ def off() { def refresh() { log.debug "Executing 'refresh'" - + def resp = parent.apiGET("/lights/${selector()}") if (resp.status == 404) { state.online = false diff --git a/devicetypes/smartthings/rgbw-light.src/rgbw-light.groovy b/devicetypes/smartthings/rgbw-light.src/rgbw-light.groovy index f4c3c81..c27affd 100644 --- a/devicetypes/smartthings/rgbw-light.src/rgbw-light.groovy +++ b/devicetypes/smartthings/rgbw-light.src/rgbw-light.groovy @@ -17,7 +17,7 @@ */ metadata { - definition (name: "RGBW Light", namespace: "smartthings", author: "SmartThings") { + definition (name: "RGBW Light", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Switch Level" capability "Color Control" capability "Color Temperature" diff --git a/devicetypes/smartthings/sylvania-ultra-iq.src/sylvania-ultra-iq.groovy b/devicetypes/smartthings/sylvania-ultra-iq.src/sylvania-ultra-iq.groovy index 1916ada..1fd3535 100644 --- a/devicetypes/smartthings/sylvania-ultra-iq.src/sylvania-ultra-iq.groovy +++ b/devicetypes/smartthings/sylvania-ultra-iq.src/sylvania-ultra-iq.groovy @@ -15,7 +15,7 @@ //DEPRECATED - Using the generic DTH for this device. Users need to be moved before deleting this DTH metadata { - definition (name: "Sylvania Ultra iQ", namespace:"smartthings", author: "SmartThings") { + definition (name: "Sylvania Ultra iQ", namespace:"smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Switch Level" capability "Configuration" capability "Switch" diff --git a/devicetypes/smartthings/zigbee-dimmer-power.src/zigbee-dimmer-power.groovy b/devicetypes/smartthings/zigbee-dimmer-power.src/zigbee-dimmer-power.groovy index c7130a3..2579423 100644 --- a/devicetypes/smartthings/zigbee-dimmer-power.src/zigbee-dimmer-power.groovy +++ b/devicetypes/smartthings/zigbee-dimmer-power.src/zigbee-dimmer-power.groovy @@ -13,7 +13,7 @@ */ metadata { - definition (name: "ZigBee Dimmer Power", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { + definition (name: "ZigBee Dimmer Power", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Configuration" capability "Refresh" diff --git a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy index 68878df..cd2bca1 100644 --- a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy +++ b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy @@ -13,7 +13,7 @@ */ metadata { - definition (name: "ZigBee Dimmer", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { + definition (name: "ZigBee Dimmer", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Configuration" capability "Refresh" diff --git a/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy b/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy index 1e5345f..64ab4a1 100644 --- a/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy +++ b/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy @@ -14,7 +14,7 @@ import physicalgraph.zigbee.zcl.DataType metadata { - definition (name: "ZLL RGB Bulb", namespace: "smartthings", author: "SmartThings") { + definition (name: "ZLL RGB Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Color Control" diff --git a/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy b/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy index 74cb921..aab76fb 100644 --- a/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy +++ b/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy @@ -14,7 +14,7 @@ import physicalgraph.zigbee.zcl.DataType metadata { - definition (name: "ZLL RGBW Bulb", namespace: "smartthings", author: "SmartThings") { + definition (name: "ZLL RGBW Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Color Control" diff --git a/devicetypes/smartthings/zll-white-color-temperature-bulb-5000k.src/zll-white-color-temperature-bulb-5000k.groovy b/devicetypes/smartthings/zll-white-color-temperature-bulb-5000k.src/zll-white-color-temperature-bulb-5000k.groovy index a43c948..924c042 100644 --- a/devicetypes/smartthings/zll-white-color-temperature-bulb-5000k.src/zll-white-color-temperature-bulb-5000k.groovy +++ b/devicetypes/smartthings/zll-white-color-temperature-bulb-5000k.src/zll-white-color-temperature-bulb-5000k.groovy @@ -16,7 +16,7 @@ import groovy.transform.Field @Field Boolean hasConfiguredHealthCheck = false metadata { - definition (name: "ZLL White Color Temperature Bulb 5000K", namespace: "smartthings", author: "SmartThings") { + definition (name: "ZLL White Color Temperature Bulb 5000K", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Color Temperature" @@ -101,7 +101,7 @@ def refresh() { if (!((device.getDataValue("manufacturer") == "Eaton") && (device.getDataValue("model") == "Halo_LT01"))) { cmds = cmds + zigbee.onOffConfig() + zigbee.levelConfig() + zigbee.colorTemperatureConfig() } - + cmds } diff --git a/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy b/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy index ee3130d..f143395 100644 --- a/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy +++ b/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy @@ -16,7 +16,7 @@ import groovy.transform.Field @Field Boolean hasConfiguredHealthCheck = false metadata { - definition (name: "ZLL White Color Temperature Bulb", namespace: "smartthings", author: "SmartThings") { + definition (name: "ZLL White Color Temperature Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Color Temperature" diff --git a/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy b/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy index bb94d36..5b0890c 100644 --- a/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy +++ b/devicetypes/smartthings/zwave-dimmer-switch-generic.src/zwave-dimmer-switch-generic.groovy @@ -12,7 +12,7 @@ * */ metadata { - definition (name: "Z-Wave Dimmer Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { + definition (name: "Z-Wave Dimmer Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Switch Level" capability "Actuator" capability "Health Check" From b2b03604a78c0fbfc1eea1fb2c3d46293480d6c7 Mon Sep 17 00:00:00 2001 From: jackchi Date: Tue, 11 Apr 2017 12:16:05 -0700 Subject: [PATCH 12/12] [CHF-595] Device Health enrollment needs to be in both updated() & installed() --- .../smartthings/hue-bloom.src/hue-bloom.groovy | 12 +++++++++++- .../smartthings/hue-bridge.src/hue-bridge.groovy | 12 +++++++++++- devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy | 12 +++++++++++- .../smartthings/hue-lux-bulb.src/hue-lux-bulb.groovy | 11 ++++++++++- .../hue-white-ambiance-bulb.groovy | 12 +++++++++++- .../lifx-color-bulb.src/lifx-color-bulb.groovy | 12 +++++++++++- .../lifx-white-bulb.src/lifx-white-bulb.groovy | 12 +++++++++++- .../logitech-harmony-hub-c2c.groovy | 8 ++++++-- 8 files changed, 82 insertions(+), 9 deletions(-) diff --git a/devicetypes/smartthings/hue-bloom.src/hue-bloom.groovy b/devicetypes/smartthings/hue-bloom.src/hue-bloom.groovy index f7a755e..f5b44ca 100644 --- a/devicetypes/smartthings/hue-bloom.src/hue-bloom.groovy +++ b/devicetypes/smartthings/hue-bloom.src/hue-bloom.groovy @@ -57,10 +57,20 @@ metadata { } } -void installed() { +def initialize() { sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false) } +void installed() { + log.debug "installed()" + initialize() +} + +def updated() { + log.debug "updated()" + initialize() +} + // parse events into attributes def parse(description) { log.debug "parse() - $description" diff --git a/devicetypes/smartthings/hue-bridge.src/hue-bridge.groovy b/devicetypes/smartthings/hue-bridge.src/hue-bridge.groovy index b6e4267..ed230c0 100644 --- a/devicetypes/smartthings/hue-bridge.src/hue-bridge.groovy +++ b/devicetypes/smartthings/hue-bridge.src/hue-bridge.groovy @@ -45,10 +45,20 @@ metadata { } } -void installed() { +def initialize() { sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false) } +void installed() { + log.debug "installed()" + initialize() +} + +def updated() { + log.debug "updated()" + initialize() +} + // parse events into attributes def parse(description) { log.debug "Parsing '${description}'" diff --git a/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy b/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy index 377f05b..f2f0b99 100644 --- a/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy +++ b/devicetypes/smartthings/hue-bulb.src/hue-bulb.groovy @@ -66,10 +66,20 @@ metadata { } } -void installed() { +def initialize() { sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false) } +void installed() { + log.debug "installed()" + initialize() +} + +def updated() { + log.debug "updated()" + initialize() +} + // parse events into attributes def parse(description) { log.debug "parse() - $description" diff --git a/devicetypes/smartthings/hue-lux-bulb.src/hue-lux-bulb.groovy b/devicetypes/smartthings/hue-lux-bulb.src/hue-lux-bulb.groovy index d82ce66..bd786a1 100644 --- a/devicetypes/smartthings/hue-lux-bulb.src/hue-lux-bulb.groovy +++ b/devicetypes/smartthings/hue-lux-bulb.src/hue-lux-bulb.groovy @@ -50,10 +50,19 @@ metadata { } } -void installed() { +def initialize() { sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false) } +void installed() { + log.debug "installed()" + initialize() +} + +def updated() { + initialize() +} + // parse events into attributes def parse(description) { log.debug "parse() - $description" diff --git a/devicetypes/smartthings/hue-white-ambiance-bulb.src/hue-white-ambiance-bulb.groovy b/devicetypes/smartthings/hue-white-ambiance-bulb.src/hue-white-ambiance-bulb.groovy index 419fe37..bae3501 100644 --- a/devicetypes/smartthings/hue-white-ambiance-bulb.src/hue-white-ambiance-bulb.groovy +++ b/devicetypes/smartthings/hue-white-ambiance-bulb.src/hue-white-ambiance-bulb.groovy @@ -55,10 +55,20 @@ metadata { } } -void installed() { +def initialize() { sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"LAN\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device.hub.hardwareID}\"}", displayed: false) } +void installed() { + log.debug "installed()" + initialize() +} + +def updated() { + log.debug "updated()" + initialize() +} + // parse events into attributes def parse(description) { log.debug "parse() - $description" diff --git a/devicetypes/smartthings/lifx-color-bulb.src/lifx-color-bulb.groovy b/devicetypes/smartthings/lifx-color-bulb.src/lifx-color-bulb.groovy index f49a7a1..a4e50b6 100644 --- a/devicetypes/smartthings/lifx-color-bulb.src/lifx-color-bulb.groovy +++ b/devicetypes/smartthings/lifx-color-bulb.src/lifx-color-bulb.groovy @@ -64,8 +64,18 @@ metadata { } } +def initialize() { + sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}", displayed: false) +} + void installed() { - sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}") + log.debug "installed()" + initialize() +} + +def updated() { + log.debug "updated()" + initialize() } // handle commands diff --git a/devicetypes/smartthings/lifx-white-bulb.src/lifx-white-bulb.groovy b/devicetypes/smartthings/lifx-white-bulb.src/lifx-white-bulb.groovy index 5f0908e..cd95eec 100644 --- a/devicetypes/smartthings/lifx-white-bulb.src/lifx-white-bulb.groovy +++ b/devicetypes/smartthings/lifx-white-bulb.src/lifx-white-bulb.groovy @@ -55,8 +55,18 @@ metadata { } } +def initialize() { + sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}", displayed: false) +} + void installed() { - sendEvent(name: "DeviceWatch-Enroll", value: "{\"protocol\": \"cloud\", \"scheme\":\"untracked\", \"hubHardwareId\": \"${device?.hub?.hardwareID}\"}") + log.debug "installed()" + initialize() +} + +def updated() { + log.debug "updated()" + initialize() } // handle commands diff --git a/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy b/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy index b3d3888..f455be4 100644 --- a/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy +++ b/devicetypes/smartthings/logitech-harmony-hub-c2c.src/logitech-harmony-hub-c2c.groovy @@ -40,14 +40,18 @@ metadata { } } +def initialize() { + sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false) +} + def installed() { log.debug "installed()" - sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false) + initialize() } def updated() { log.debug "updated()" - sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "cloud", scheme:"untracked"]), displayed: false) + initialize() } def startActivity(String activityId) {