From fc320315552d10237cfa15e9ebabef20f455094a Mon Sep 17 00:00:00 2001 From: Donald Kirker Date: Wed, 19 Apr 2017 18:25:21 -0700 Subject: [PATCH 1/7] Move revision history to README.md --- devicetypes/drzwave/ezmultipli.src/.st-ignore | 2 + devicetypes/drzwave/ezmultipli.src/README.md | 45 +++++++++++++++++++ .../drzwave/ezmultipli.src/ezmultipli.groovy | 21 --------- 3 files changed, 47 insertions(+), 21 deletions(-) create mode 100644 devicetypes/drzwave/ezmultipli.src/.st-ignore create mode 100644 devicetypes/drzwave/ezmultipli.src/README.md diff --git a/devicetypes/drzwave/ezmultipli.src/.st-ignore b/devicetypes/drzwave/ezmultipli.src/.st-ignore new file mode 100644 index 0000000..f78b46e --- /dev/null +++ b/devicetypes/drzwave/ezmultipli.src/.st-ignore @@ -0,0 +1,2 @@ +.st-ignore +README.md diff --git a/devicetypes/drzwave/ezmultipli.src/README.md b/devicetypes/drzwave/ezmultipli.src/README.md new file mode 100644 index 0000000..f7fc0da --- /dev/null +++ b/devicetypes/drzwave/ezmultipli.src/README.md @@ -0,0 +1,45 @@ +# Express Controls EZMultiPli + +Cloud Execution + +Works with: + +* [Express Controls EZMultiPli](https://www.smartthings.com/works-with-smartthings/) + +## Table of contents + +* [Release Notes](#releasenotes) +* [Capabilities](#capabilities) +* [Troubleshooting](#troubleshooting) + +## Release Notes + +* 2017-04-10 - DrZwave (with help from Donald Kirker) - changed fingerprint to the new format, lowered the OnTime and other parameters to be "more in line with ST user expectations", get the luminance in LUX so it reports in lux all the time. +* 2016-10-06 - erocm1231 - Added "updated" method to run when configuration options are changed. Depending on model of unit, luminance is being reported as a relative percentace or as a lux value. Added the option to configure this in the handler. +* 2016-01-28 - erocm1231 - Changed the configuration method to use scaledConfiguration so that it properly formatted negative numbers. Also, added configurationGet and a configurationReport method so that config values can be verified. +* 2015-12-04 - erocm1231 - added range value to preferences as suggested by @Dela-Rick. +* 2015-11-26 - erocm1231 - Fixed null condition error when adding as a new device. +* 2015-11-24 - erocm1231 - Added refresh command. Made a few changes to how the handler maps colors to the LEDs. Fixed the device not having its on/off status updated when colors are changed. +* 2015-11-23 - erocm1231 - Changed the look to match SmartThings v2 devices. +* 2015-11-21 - erocm1231 - Made code much more efficient. Also made it compatible when setColor is passed a hex value. Mapping of special colors: Soft White - Default - Yellow, White - Concentrate - White, Daylight - Energize - Teal, Warm White - Relax - Yellow +* 2015-11-19 - erocm1231 - Fixed a couple incorrect colors, changed setColor to be more compatible with other apps +* 2015-11-18 - erocm1231 - Added to setColor for compatibility with Smart Lighting +* v0.1.0 - DrZWave - chose better icons, Got color LED to work - first fully functional version +* v0.0.9 - jrs - got the temp and luminance to work. Motion works. Debugging the color wheel. +* v0.0.8 - DrZWave 2/25/2015 - change the color control to be tiles since there are only 8 colors. +* v0.0.7 - jrs - 02/23/2015 - Jim Sulin + +## Capabilities + +* **Actuator** - represents that a Device has commands +* **Sensor** - detects sensor events +* **Motion Sensor** - can detect motion +* **Temperature Measurement** - defines device measures current temperature +* **Illuminance Measurement** - gives the illuminance reading from devices that support it +* **Switch** - can detect state (possible values: on/off) +* **Color Control** - represents that the color attributes of a device can be controlled (hue, saturation, color value +* **Configuration** - configure() command called when device is installed or device preferences updated +* **Refresh** - refresh() command for status updates + +## Troubleshooting + diff --git a/devicetypes/drzwave/ezmultipli.src/ezmultipli.groovy b/devicetypes/drzwave/ezmultipli.src/ezmultipli.groovy index f86774d..cd034cf 100644 --- a/devicetypes/drzwave/ezmultipli.src/ezmultipli.groovy +++ b/devicetypes/drzwave/ezmultipli.src/ezmultipli.groovy @@ -2,27 +2,6 @@ // Motion Sensor - Temperature - Light level - 8 Color Indicator LED - Z-Wave Range Extender - Wall Powered // driver for SmartThings // The EZMultiPli is also known as the HSM200 from HomeSeer.com -// -// 2017-04-10 - DrZwave (with help from Don Kirker) - changed fingerprint to the new format, lowered the OnTime -// and other parameters to be "more in line with ST user expectations", get the luminance in LUX so it reports in lux all the time. -// 2016-10-06 - erocm1231 - Added "updated" method to run when configuration options are changed. Depending on model of unit, luminance is being -// reported as a relative percentace or as a lux value. Added the option to configure this in the handler. -// 2016-01-28 - erocm1231 - Changed the configuration method to use scaledConfiguration so that it properly formatted negative numbers. -// Also, added configurationGet and a configurationReport method so that config values can be verified. -// 2015-12-04 - erocm1231 - added range value to preferences as suggested by @Dela-Rick. -// 2015-11-26 - erocm1231 - Fixed null condition error when adding as a new device. -// 2015-11-24 - erocm1231 - Added refresh command. Made a few changes to how the handler maps colors to the LEDs. Fixed -// the device not having its on/off status updated when colors are changed. -// 2015-11-23 - erocm1231 - Changed the look to match SmartThings v2 devices. -// 2015-11-21 - erocm1231 - Made code much more efficient. Also made it compatible when setColor is passed a hex value. -// Mapping of special colors: Soft White - Default - Yellow, White - Concentrate - White, -// Daylight - Energize - Teal, Warm White - Relax - Yellow -// 2015-11-19 - erocm1231 - Fixed a couple incorrect colors, changed setColor to be more compatible with other apps -// 2015-11-18 - erocm1231 - Added to setColor for compatibility with Smart Lighting -// v0.1.0 - DrZWave - chose better icons, Got color LED to work - first fully functional version -// v0.0.9 - jrs - got the temp and luminance to work. Motion works. Debugging the color wheel. -// v0.0.8 - DrZWave 2/25/2015 - change the color control to be tiles since there are only 8 colors. -// v0.0.7 - jrs - 02/23/2015 - Jim Sulin metadata { definition (name: "EZmultiPli", namespace: "DrZWave", author: "Eric Ryherd", oauth: true) { From 573630232fa4af03f98f3082009aa19f085e6be5 Mon Sep 17 00:00:00 2001 From: jackchi Date: Sat, 22 Apr 2017 04:19:29 +0900 Subject: [PATCH 2/7] [CHF-601] Health Check Arrival Sensor (2015 Model) --- .../smartthings/arrival-sensor.src/.st-ignore | 2 + .../smartthings/arrival-sensor.src/README.md | 49 +++++++++++++++++++ .../arrival-sensor.src/arrival-sensor.groovy | 8 +++ 3 files changed, 59 insertions(+) create mode 100644 devicetypes/smartthings/arrival-sensor.src/.st-ignore create mode 100644 devicetypes/smartthings/arrival-sensor.src/README.md diff --git a/devicetypes/smartthings/arrival-sensor.src/.st-ignore b/devicetypes/smartthings/arrival-sensor.src/.st-ignore new file mode 100644 index 0000000..f78b46e --- /dev/null +++ b/devicetypes/smartthings/arrival-sensor.src/.st-ignore @@ -0,0 +1,2 @@ +.st-ignore +README.md diff --git a/devicetypes/smartthings/arrival-sensor.src/README.md b/devicetypes/smartthings/arrival-sensor.src/README.md new file mode 100644 index 0000000..0ec5084 --- /dev/null +++ b/devicetypes/smartthings/arrival-sensor.src/README.md @@ -0,0 +1,49 @@ +# Arrival Sensor (2015 Model) + +Cloud Execution + +Works with: + +* [Arrival Sensor](https://www.smartthings.com/products/samsung-smartthings-arrival-sensor) + +## Table of contents + +* [Capabilities](#capabilities) +* [Health](#device-health) +* [Battery](#battery) +* [Troubleshooting](#troubleshooting) + + +## Capabilities + +* **Tone** - beep command to allow an audible tone +* **Actuator** - device has commands +* **Signal Strength** - device can read the strength of signal- lqi: Link Quality Indication, rssi: Received Signal Strength Indication +* **Presence Sensor** - device tells presence with enum - {present, not present} +* **Sensor** - device has attributes +* **Battery** - defines device uses a battery +* **Health Check** - indicates ability to get device health notifications + + +## Device Health + +Arrival Sensor ZigBee is an untracked device. Disconnects when Hub goes OFFLINE. + + +## Battery + +Uses 1 CR2032 Battery + +* [Changing the Battery](https://support.smartthings.com/hc/en-us/articles/200907400-How-to-change-the-battery-in-the-SmartSense-Presence-Sensor-and-Samsung-SmartThings-Arrival-Sensor) + + +## Troubleshooting + +If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the arrival sensor is out of range. +Pairing needs to be tried again by placing the sensor closer to the hub. + +* [Samsung SmartThings Arrival Sensor Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/205382134-Samsung-SmartThings-Arrival-Sensor-2015-model-) + +If the arrival sensor doesn't update its status, here are a few things you can try to debug. + +* [Troubleshooting: Samsung SmartThings Arrival Sensor won't update its status](https://support.smartthings.com/hc/en-us/articles/200846514-Troubleshooting-Samsung-SmartThings-Arrival-Sensor-won-t-update-its-status) \ No newline at end of file diff --git a/devicetypes/smartthings/arrival-sensor.src/arrival-sensor.groovy b/devicetypes/smartthings/arrival-sensor.src/arrival-sensor.groovy index 4fbd53d..40a8475 100644 --- a/devicetypes/smartthings/arrival-sensor.src/arrival-sensor.groovy +++ b/devicetypes/smartthings/arrival-sensor.src/arrival-sensor.groovy @@ -1,3 +1,5 @@ +import groovy.json.JsonOutput + /** * Copyright 2015 SmartThings * @@ -19,6 +21,7 @@ metadata { capability "Presence Sensor" capability "Sensor" capability "Battery" + capability "Health Check" fingerprint profileId: "FC01", deviceId: "019A" fingerprint profileId: "FC01", deviceId: "0131", inClusters: "0000,0003", outClusters: "0003" @@ -111,6 +114,11 @@ def beep() { ] } +def installed() { + // Arrival sensors only goes OFFLINE when Hub is off + sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "zigbee", scheme:"untracked"]), displayed: false) +} + def parse(String description) { def results if (isBatteryMessage(description)) { From 5e07494dff69ea7e31029134840f3ff4bfb2bd54 Mon Sep 17 00:00:00 2001 From: jackchi Date: Sat, 22 Apr 2017 04:28:50 +0900 Subject: [PATCH 3/7] [CHF-602] Health Check Arrival Sensor HA --- .../arrival-sensor-ha.src/.st-ignore | 2 + .../arrival-sensor-ha.src/README.md | 50 +++++++++++++++++++ .../arrival-sensor-ha.groovy | 8 +++ 3 files changed, 60 insertions(+) create mode 100644 devicetypes/smartthings/arrival-sensor-ha.src/.st-ignore create mode 100644 devicetypes/smartthings/arrival-sensor-ha.src/README.md diff --git a/devicetypes/smartthings/arrival-sensor-ha.src/.st-ignore b/devicetypes/smartthings/arrival-sensor-ha.src/.st-ignore new file mode 100644 index 0000000..f78b46e --- /dev/null +++ b/devicetypes/smartthings/arrival-sensor-ha.src/.st-ignore @@ -0,0 +1,2 @@ +.st-ignore +README.md diff --git a/devicetypes/smartthings/arrival-sensor-ha.src/README.md b/devicetypes/smartthings/arrival-sensor-ha.src/README.md new file mode 100644 index 0000000..41cbdbe --- /dev/null +++ b/devicetypes/smartthings/arrival-sensor-ha.src/README.md @@ -0,0 +1,50 @@ +# Arrival Sensor HA (2016+ Model) + +Cloud Execution + +Works with: + +* [Samsung SmartThings Arrival Sensor](https://support.smartthings.com/hc/en-us/articles/212417083-Samsung-SmartThings-Arrival-Sensor) + +## Table of contents + +* [Capabilities](#capabilities) +* [Health](#device-health) +* [Battery](#battery) +* [Troubleshooting](#troubleshooting) + + +## Capabilities + +* **Tone** - beep command to allow an audible tone +* **Actuator** - device has commands +* **Presence Sensor** - device tells presence with enum - {present, not present} +* **Sensor** - device has attributes +* **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 + +Arrival Sensor ZigBee is an untracked device. Sends broadcast of battery level every 20 seconds. +Disconnects when Hub goes OFFLINE. + + +## Battery + +Uses 1 CR2032 Battery + +* [Changing the Battery](https://support.smartthings.com/hc/en-us/articles/200907400-How-to-change-the-battery-in-the-SmartSense-Presence-Sensor-and-Samsung-SmartThings-Arrival-Sensor) + + +## Troubleshooting + +If the device doesn't pair when trying from the SmartThings mobile app, it is possible that the arrival sensor is out of range. +Pairing needs to be tried again by placing the sensor closer to the hub. + +* [Samsung SmartThings Arrival Sensor Troubleshooting Tips](https://support.smartthings.com/hc/en-us/articles/205382134-Samsung-SmartThings-Arrival-Sensor-2015-model-) + +If the arrival sensor doesn't update its status, here are a few things you can try to debug. + +* [Troubleshooting: Samsung SmartThings Arrival Sensor won't update its status](https://support.smartthings.com/hc/en-us/articles/200846514-Troubleshooting-Samsung-SmartThings-Arrival-Sensor-won-t-update-its-status) \ No newline at end of file diff --git a/devicetypes/smartthings/arrival-sensor-ha.src/arrival-sensor-ha.groovy b/devicetypes/smartthings/arrival-sensor-ha.src/arrival-sensor-ha.groovy index c434d3d..4099b2a 100644 --- a/devicetypes/smartthings/arrival-sensor-ha.src/arrival-sensor-ha.groovy +++ b/devicetypes/smartthings/arrival-sensor-ha.src/arrival-sensor-ha.groovy @@ -1,3 +1,5 @@ +import groovy.json.JsonOutput + /** * Copyright 2017 SmartThings * @@ -19,6 +21,7 @@ metadata { capability "Sensor" capability "Battery" capability "Configuration" + capability "Health Check" fingerprint inClusters: "0000,0001,0003,000F,0020", outClusters: "0003,0019", manufacturer: "SmartThings", model: "tagv4", deviceJoinName: "Arrival Sensor" @@ -58,6 +61,11 @@ def updated() { startTimer() } +def installed() { + // Arrival sensors only goes OFFLINE when Hub is off + sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "zigbee", scheme:"untracked"]), displayed: false) +} + def configure() { def cmds = zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0020) + zigbee.batteryConfig(20, 20, 0x01) log.debug "configure -- cmds: ${cmds}" From c164b201caa3f602d16d017d9cc7322bb8fe643f Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Fri, 21 Apr 2017 17:16:12 -0700 Subject: [PATCH 4/7] ICP-731 wrong icon for dimmer --- devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy | 2 +- .../zwave-metering-dimmer.src/zwave-metering-dimmer.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy b/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy index 7c658c1..74ce052 100644 --- a/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy +++ b/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy @@ -12,7 +12,7 @@ * */ metadata { - definition (name: "Dimmer Switch", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { + definition (name: "Dimmer Switch", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Switch Level" capability "Actuator" capability "Indicator" 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 05a2737..401be0b 100644 --- a/devicetypes/smartthings/zwave-metering-dimmer.src/zwave-metering-dimmer.groovy +++ b/devicetypes/smartthings/zwave-metering-dimmer.src/zwave-metering-dimmer.groovy @@ -16,7 +16,7 @@ * */ metadata { - definition (name: "Z-Wave Metering Dimmer", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { + definition (name: "Z-Wave Metering Dimmer", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Switch" capability "Polling" capability "Power Meter" From c864fc521e648f07cb9a9edda8d95f3735142525 Mon Sep 17 00:00:00 2001 From: Donald Kirker Date: Wed, 19 Apr 2017 19:48:48 -0700 Subject: [PATCH 5/7] DVCSMP-2585 Fix NullPointerException when pairing because color is unset Also tweak default config values in config value range checking (affects initial pairing of device) --- devicetypes/drzwave/ezmultipli.src/README.md | 33 +++++++++---------- .../drzwave/ezmultipli.src/ezmultipli.groovy | 16 ++++----- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/devicetypes/drzwave/ezmultipli.src/README.md b/devicetypes/drzwave/ezmultipli.src/README.md index f7fc0da..fa28c7c 100644 --- a/devicetypes/drzwave/ezmultipli.src/README.md +++ b/devicetypes/drzwave/ezmultipli.src/README.md @@ -1,33 +1,32 @@ # Express Controls EZMultiPli -Cloud Execution - Works with: * [Express Controls EZMultiPli](https://www.smartthings.com/works-with-smartthings/) ## Table of contents -* [Release Notes](#releasenotes) +* [Release Notes](#release-notes) * [Capabilities](#capabilities) * [Troubleshooting](#troubleshooting) ## Release Notes -* 2017-04-10 - DrZwave (with help from Donald Kirker) - changed fingerprint to the new format, lowered the OnTime and other parameters to be "more in line with ST user expectations", get the luminance in LUX so it reports in lux all the time. -* 2016-10-06 - erocm1231 - Added "updated" method to run when configuration options are changed. Depending on model of unit, luminance is being reported as a relative percentace or as a lux value. Added the option to configure this in the handler. -* 2016-01-28 - erocm1231 - Changed the configuration method to use scaledConfiguration so that it properly formatted negative numbers. Also, added configurationGet and a configurationReport method so that config values can be verified. -* 2015-12-04 - erocm1231 - added range value to preferences as suggested by @Dela-Rick. -* 2015-11-26 - erocm1231 - Fixed null condition error when adding as a new device. -* 2015-11-24 - erocm1231 - Added refresh command. Made a few changes to how the handler maps colors to the LEDs. Fixed the device not having its on/off status updated when colors are changed. -* 2015-11-23 - erocm1231 - Changed the look to match SmartThings v2 devices. -* 2015-11-21 - erocm1231 - Made code much more efficient. Also made it compatible when setColor is passed a hex value. Mapping of special colors: Soft White - Default - Yellow, White - Concentrate - White, Daylight - Energize - Teal, Warm White - Relax - Yellow -* 2015-11-19 - erocm1231 - Fixed a couple incorrect colors, changed setColor to be more compatible with other apps -* 2015-11-18 - erocm1231 - Added to setColor for compatibility with Smart Lighting -* v0.1.0 - DrZWave - chose better icons, Got color LED to work - first fully functional version -* v0.0.9 - jrs - got the temp and luminance to work. Motion works. Debugging the color wheel. -* v0.0.8 - DrZWave 2/25/2015 - change the color control to be tiles since there are only 8 colors. -* v0.0.7 - jrs - 02/23/2015 - Jim Sulin +* **2017-04-19** - _dkirker_ - Update default config values in config value range check functions, use lux if lum option is null, fix NullPointerException on initial pairing when color data has not been set (and set the default color data!) +* **2017-04-10** - _DrZwave_ (with help from Donald Kirker) - changed fingerprint to the new format, lowered the OnTime and other parameters to be "more in line with ST user expectations", get the luminance in LUX so it reports in lux all the time. +* **2016-10-06** - _erocm1231_ - Added "updated" method to run when configuration options are changed. Depending on model of unit, luminance is being reported as a relative percentace or as a lux value. Added the option to configure this in the handler. +* **2016-01-28** - _erocm1231_ - Changed the configuration method to use scaledConfiguration so that it properly formatted negative numbers. Also, added configurationGet and a configurationReport method so that config values can be verified. +* **2015-12-04** - _erocm1231_ - added range value to preferences as suggested by @Dela-Rick. +* **2015-11-26** - _erocm1231_ - Fixed null condition error when adding as a new device. +* **2015-11-24** - _erocm1231_ - Added refresh command. Made a few changes to how the handler maps colors to the LEDs. Fixed the device not having its on/off status updated when colors are changed. +* **2015-11-23** - _erocm1231_ - Changed the look to match SmartThings v2 devices. +* **2015-11-21** - _erocm1231_ - Made code much more efficient. Also made it compatible when setColor is passed a hex value. Mapping of special colors: Soft White - Default - Yellow, White - Concentrate - White, Daylight - Energize - Teal, Warm White - Relax - Yellow +* **2015-11-19** - _erocm1231_ - Fixed a couple incorrect colors, changed setColor to be more compatible with other apps +* **2015-11-18** - _erocm1231_ - Added to setColor for compatibility with Smart Lighting +* **v0.1.0** - _DrZWave_ - chose better icons, Got color LED to work - first fully functional version +* **v0.0.9** - _jrs_ - got the temp and luminance to work. Motion works. Debugging the color wheel. +* **v0.0.8** - _DrZWave_ 2/25/2015 - change the color control to be tiles since there are only 8 colors. +* **v0.0.7** - _jrs_ - 02/23/2015 - Jim Sulin ## Capabilities diff --git a/devicetypes/drzwave/ezmultipli.src/ezmultipli.groovy b/devicetypes/drzwave/ezmultipli.src/ezmultipli.groovy index cd034cf..879580a 100644 --- a/devicetypes/drzwave/ezmultipli.src/ezmultipli.groovy +++ b/devicetypes/drzwave/ezmultipli.src/ezmultipli.groovy @@ -110,7 +110,6 @@ metadata { } // end metadata - // Parse incoming device messages from device to generate events def parse(String description){ //log.debug "==> New Zwave Event: ${description}" @@ -124,7 +123,7 @@ def parse(String description){ def statusTextmsg = "" if (device.currentState('temperature') != null && device.currentState('illuminance') != null) { - statusTextmsg = "${device.currentState('temperature').value} ° - ${device.currentState('illuminance').value} ${(lum == "" || lum == null || lum == 1) ? "%" : "LUX"}" + statusTextmsg = "${device.currentState('temperature').value} ° - ${device.currentState('illuminance').value} ${(lum == 1) ? "%" : "LUX"}" sendEvent("name":"statusText", "value":statusTextmsg, displayed:false) } if (result != [null] && result != []) log.debug "Parse returned ${result}" @@ -147,7 +146,7 @@ def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv5.SensorMultilevelR break; case 0x03 : // SENSOR_TYPE_LUMINANCE_VERSION_1 map.value = cmd.scaledSensorValue.toInteger().toString() - if(lum == "" || lum == null || lum == 1) map.unit = "%" + if(lum == 1) map.unit = "%" else map.unit = "lux" map.name = "illuminance" log.debug "Luminance report" @@ -182,7 +181,8 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm } def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd) { - if (cmd.value == 0 && device.latestState("color").value != "#ffffff") { + // The EZMultiPli sets the color back to #ffffff on "off" or at init, so update the ST device to reflect this. + if (device.latestState("color") == null || (cmd.value == 0 && device.latestState("color").value != "#ffffff")) { sendEvent(name: "color", value: "#ffffff", displayed: true) } [name: "switch", value: cmd.value ? "on" : "off", type: "digital"] @@ -275,12 +275,12 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) { // ensure we are passing acceptable param values for LiteMin & TempMin configs def checkLiteTempInput(value) { if (value == null) { - value=60 + value=6 } def liteTempVal = value.toInteger() switch (liteTempVal) { case { it < 0 }: - return 60 // bad value, set to default + return 6 // bad value, set to default break case { it > 127 }: return 127 // bad value, greater then MAX, set to MAX @@ -293,12 +293,12 @@ def checkLiteTempInput(value) { // ensure we are passing acceptable param value for OnTime config def checkOnTimeInput(value) { if (value == null) { - value=10 + value=2 } def onTimeVal = value.toInteger() switch (onTimeVal) { case { it < 0 }: - return 10 // bad value set to default + return 2 // bad value set to default break case { it > 127 }: return 127 // bad value, greater then MAX, set to MAX From 6a76a8ee39085089d273086477e0ba91090ae286 Mon Sep 17 00:00:00 2001 From: Donald Kirker Date: Mon, 24 Apr 2017 11:07:51 -0700 Subject: [PATCH 6/7] DVCSMP-2598 Fix start_time and end_time date range Add descriptive error for Wattvision API errors --- .../wattvision-manager.groovy | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/smartapps/smartthings/wattvision-manager.src/wattvision-manager.groovy b/smartapps/smartthings/wattvision-manager.src/wattvision-manager.groovy index ad81049..fbb8034 100644 --- a/smartapps/smartthings/wattvision-manager.src/wattvision-manager.groovy +++ b/smartapps/smartthings/wattvision-manager.src/wattvision-manager.groovy @@ -136,10 +136,20 @@ def getDataForChild(child, startDate, endDate) { def wattvisionURL = wattvisionURL(child.deviceNetworkId, startDate, endDate) if (wattvisionURL) { - httpGet(uri: wattvisionURL) { response -> - def json = new org.json.JSONObject(response.data.toString()) - child.addWattvisionData(json) - return "success" + try { + httpGet(uri: wattvisionURL) { response -> + def json = new org.json.JSONObject(response.data.toString()) + child.addWattvisionData(json) + return "success" + } + } catch (groovyx.net.http.HttpResponseException httpE) { + log.error "Wattvision getDataForChild HttpResponseException: ${httpE} -> ${httpE.response.data}" + //log.debug "wattvisionURL = ${wattvisionURL}" + return "fail" + } catch (e) { + log.error "Wattvision getDataForChild General Exception: ${e}" + //log.debug "wattvisionURL = ${wattvisionURL}" + return "fail" } } } @@ -164,9 +174,14 @@ def wattvisionURL(senorId, startDate, endDate) { if (diff > 259200000) { // 3 days in milliseconds // Wattvision only allows pulling 3 hours of data at a time startDate = new Date(hours: endDate.hours - 3) + } else if (diff < 10000) { // 10 seconds in milliseconds + // Wattvision throws errors when the difference between start_time and end_time is 5 seconds or less + // So we are going to make sure that we have a few more seconds of breathing room + use (groovy.time.TimeCategory) { + startDate = endDate - 10.seconds + } } - def params = [ "sensor_id" : senorId, "api_id" : wattvisionApiAccess.id, @@ -480,4 +495,3 @@ def connectionSuccessful(deviceName, iconSrc) { render contentType: 'text/html', data: html } - From 7820b39b2b49e92be0182296fa5ff142cf4d49b6 Mon Sep 17 00:00:00 2001 From: Donald Kirker Date: Tue, 25 Apr 2017 03:18:54 -0700 Subject: [PATCH 7/7] DVCSMP-2579 Move Centralite Door/Window sensor from multi-sensor DTH to open-closed-sensor DTH. --- .../smartsense-multi-sensor.src/smartsense-multi-sensor.groovy | 1 - .../smartsense-open-closed-sensor.groovy | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy index 62a7fc3..8229414 100644 --- a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy +++ b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy @@ -33,7 +33,6 @@ metadata { fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05,FC02", outClusters: "0019", manufacturer: "CentraLite", model: "3320" fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05,FC02", outClusters: "0019", manufacturer: "CentraLite", model: "3321" fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05,FC02", outClusters: "0019", manufacturer: "CentraLite", model: "3321-S", deviceJoinName: "Multipurpose Sensor" - fingerprint inClusters: "0000,0001,0003,0020,0402,0500,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3323-G", deviceJoinName: "Centralite Micro Door Sensor" fingerprint inClusters: "0000,0001,0003,000F,0020,0402,0500,FC02", outClusters: "0019", manufacturer: "SmartThings", model: "multiv4", deviceJoinName: "Multipurpose Sensor" attribute "status", "string" diff --git a/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy b/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy index fc08a0a..45ea1c0 100644 --- a/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy +++ b/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy @@ -31,6 +31,7 @@ metadata { fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3300-S" fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3300" fingerprint inClusters: "0000,0001,0003,0020,0402,0500,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3320-L", deviceJoinName: "Iris Contact Sensor" + fingerprint inClusters: "0000,0001,0003,0020,0402,0500,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3323-G", deviceJoinName: "Centralite Micro Door Sensor" } simulator {