From e985f38cf4f12f39d2c8fe762b49e4a1265e97e7 Mon Sep 17 00:00:00 2001 From: marstorp Date: Wed, 29 Mar 2017 17:45:01 -0700 Subject: [PATCH 1/7] ICP-493 Thermostat Capabilities Payload Issues thermostatFanMode reports "fanAuto", but "fanAuto" is not listed in the supported modes Changing capability attributes to follow specified values. Also adding icons/removing configure tile to realigning with other thermostats, adding poll of device data in configure() to allow for faster initialization of device data. --- .../zwave-thermostat.groovy | 73 +++++++++++-------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy b/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy index 8d9f117..69c6c20 100644 --- a/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy +++ b/devicetypes/smartthings/zwave-thermostat.src/zwave-thermostat.groovy @@ -42,9 +42,9 @@ metadata { status "auto" : "command: 4003, payload: 03" status "emergencyHeat" : "command: 4003, payload: 04" - status "fanAuto" : "command: 4403, payload: 00" - status "fanOn" : "command: 4403, payload: 01" - status "fanCirculate" : "command: 4403, payload: 06" + status "auto" : "command: 4403, payload: 00" // "fanAuto" + status "on" : "command: 4403, payload: 01" // "fanOn" + status "circulate" : "command: 4403, payload: 06" // "fanCirculate status "heat 60" : "command: 4303, payload: 01 09 3C" status "heat 68" : "command: 4303, payload: 01 09 44" @@ -74,8 +74,9 @@ metadata { } tiles { - valueTile("temperature", "device.temperature", width: 2, height: 2) { - state("temperature", label:'${currentValue}°', + // Using standardTile instead of valueTile as it renders the icon better + standardTile("temperature", "device.temperature", width: 2, height: 2) { + state("temperature", label:'${currentValue}°', icon: "st.thermostat.ac.air-conditioning", backgroundColors:[ [value: 31, color: "#153591"], [value: 44, color: "#1e9cbb"], @@ -88,19 +89,20 @@ metadata { ) } standardTile("mode", "device.thermostatMode", inactiveLabel: false, decoration: "flat") { - state "off", label:'${name}', action:"switchMode", nextState:"to_heat" - state "heat", label:'${name}', action:"switchMode", nextState:"to_cool" - state "cool", label:'${name}', action:"switchMode", nextState:"..." - state "auto", label:'${name}', action:"switchMode", nextState:"..." - state "emergency heat", label:'${name}', action:"switchMode", nextState:"..." - state "to_heat", label: "heat", action:"switchMode", nextState:"to_cool" - state "to_cool", label: "cool", action:"switchMode", nextState:"..." + state "off", action:"switchMode", nextState:"to_heat", icon: "st.thermostat.heating-cooling-off" + state "heat", action:"switchMode", nextState:"to_cool", icon: "st.thermostat.heat" + state "cool", action:"switchMode", nextState:"...", icon: "st.thermostat.cool" + state "auto", action:"switchMode", nextState:"...", icon: "st.thermostat.auto" + state "emergency heat", action:"switchMode", nextState:"...", icon: "st.thermostat.emergency-heat" + state "to_heat", action:"switchMode", nextState:"to_cool", icon: "st.thermostat.heat" + state "to_cool", action:"switchMode", nextState:"...", icon: "st.thermostat.cool" state "...", label: "...", action:"off", nextState:"off" } standardTile("fanMode", "device.thermostatFanMode", inactiveLabel: false, decoration: "flat") { - state "fanAuto", label:'${name}', action:"switchFanMode" - state "fanOn", label:'${name}', action:"switchFanMode" - state "fanCirculate", label:'${name}', action:"switchFanMode" + state "auto", action:"switchFanMode", nextState:"...", icon: "st.thermostat.fan-auto" // "fanAuto" + state "on", action:"switchFanMode", nextState:"...", icon: "st.thermostat.fan-on" // "fanOn" + state "circulate", action:"switchFanMode", nextState:"...", icon: "st.thermostat.fan-circulate" // "fanCirculate" + state "...", label: "...", nextState:"..." } controlTile("heatSliderControl", "device.heatingSetpoint", "slider", height: 1, width: 2, inactiveLabel: false) { state "setHeatingSetpoint", action:"quickSetHeat", backgroundColor:"#d04e00" @@ -117,11 +119,8 @@ metadata { standardTile("refresh", "device.thermostatMode", inactiveLabel: false, decoration: "flat") { state "default", action:"polling.poll", icon:"st.secondary.refresh" } - standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat") { - state "configure", label:'', action:"configuration.configure", icon:"st.secondary.configure" - } main "temperature" - details(["temperature", "mode", "fanMode", "heatSliderControl", "heatingSetpoint", "coolSliderControl", "coolingSetpoint", "refresh", "configure"]) + details(["temperature", "mode", "fanMode", "heatSliderControl", "heatingSetpoint", "coolSliderControl", "coolingSetpoint", "refresh"]) } } @@ -286,13 +285,13 @@ def zwaveEvent(physicalgraph.zwave.commands.thermostatfanmodev3.ThermostatFanMod def map = [:] switch (cmd.fanMode) { case physicalgraph.zwave.commands.thermostatfanmodev3.ThermostatFanModeReport.FAN_MODE_AUTO_LOW: - map.value = "fanAuto" + map.value = "auto" // "fanAuto" break case physicalgraph.zwave.commands.thermostatfanmodev3.ThermostatFanModeReport.FAN_MODE_LOW: - map.value = "fanOn" + map.value = "on" // "fanOn" break case physicalgraph.zwave.commands.thermostatfanmodev3.ThermostatFanModeReport.FAN_MODE_CIRCULATION: - map.value = "fanCirculate" + map.value = "circulate" // "fanCirculate" break } map.name = "thermostatFanMode" @@ -309,15 +308,19 @@ def zwaveEvent(physicalgraph.zwave.commands.thermostatmodev2.ThermostatModeSuppo if(cmd.auto) { supportedModes += "auto " } state.supportedModes = supportedModes + // No events to be generated, return empty map + return [:] } def zwaveEvent(physicalgraph.zwave.commands.thermostatfanmodev3.ThermostatFanModeSupportedReport cmd) { def supportedFanModes = "" - if(cmd.auto) { supportedFanModes += "fanAuto " } - if(cmd.low) { supportedFanModes += "fanOn " } - if(cmd.circulation) { supportedFanModes += "fanCirculate " } + if(cmd.auto) { supportedFanModes += "auto " } // "fanAuto " + if(cmd.low) { supportedFanModes += "on " } // "fanOn" + if(cmd.circulation) { supportedFanModes += "circulate " } // "fanCirculate" state.supportedFanModes = supportedFanModes + // No events to be generated, return empty map + return [:] } def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd) { @@ -412,7 +415,13 @@ def configure() { delayBetween([ zwave.thermostatModeV2.thermostatModeSupportedGet().format(), zwave.thermostatFanModeV3.thermostatFanModeSupportedGet().format(), - zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:[zwaveHubNodeId]).format() + zwave.associationV1.associationSet(groupingIdentifier:1, nodeId:[zwaveHubNodeId]).format(), + zwave.sensorMultilevelV3.sensorMultilevelGet().format(), // current temperature + zwave.thermostatSetpointV1.thermostatSetpointGet(setpointType: 1).format(), + zwave.thermostatSetpointV1.thermostatSetpointGet(setpointType: 2).format(), + zwave.thermostatModeV2.thermostatModeGet().format(), + zwave.thermostatFanModeV3.thermostatFanModeGet().format(), + zwave.thermostatOperatingStateV1.thermostatOperatingStateGet().format() ], 2300) } @@ -453,11 +462,11 @@ def switchToMode(nextMode) { def switchFanMode() { def currentMode = device.currentState("thermostatFanMode")?.value def lastTriedMode = state.lastTriedFanMode ?: currentMode ?: "off" - def supportedModes = getDataByName("supportedFanModes") ?: "fanAuto fanOn" - def modeOrder = ["fanAuto", "fanCirculate", "fanOn"] + def supportedModes = getDataByName("supportedFanModes") ?: "auto on" // "fanAuto fanOn" + def modeOrder = ["auto", "circulate", "on"] // "fanAuto", "fanCirculate", "fanOn" def next = { modeOrder[modeOrder.indexOf(it) + 1] ?: modeOrder[0] } def nextMode = next(lastTriedMode) - while (!supportedModes?.contains(nextMode) && nextMode != "fanAuto") { + while (!supportedModes?.contains(nextMode) && nextMode != "auto") { // "fanAuto" nextMode = next(nextMode) } switchToFanMode(nextMode) @@ -468,11 +477,11 @@ def switchToFanMode(nextMode) { if(supportedFanModes && !supportedFanModes.contains(nextMode)) log.warn "thermostat mode '$nextMode' is not supported" def returnCommand - if (nextMode == "fanAuto") { + if (nextMode == "auto") { // "fanAuto" returnCommand = fanAuto() - } else if (nextMode == "fanOn") { + } else if (nextMode == "on") { // "fanOn" returnCommand = fanOn() - } else if (nextMode == "fanCirculate") { + } else if (nextMode == "circulate") { // "fanCirculate" returnCommand = fanCirculate() } else { log.debug("no fan mode '$nextMode'") From 0c8de4402b0f9abc07b07fb0ea42e833ec9898a9 Mon Sep 17 00:00:00 2001 From: juano2310 Date: Thu, 30 Mar 2017 13:59:47 -0400 Subject: [PATCH 2/7] HOTFIX - ICP-381 CP-381 - OCF device type Remove space DVCSMP-2523 Revert DVCSMP-2523 spaces --- devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy | 2 +- .../smartthings/wemo-light-switch.src/wemo-light-switch.groovy | 2 +- devicetypes/smartthings/wemo-switch.src/wemo-switch.groovy | 2 +- devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy | 2 +- .../zwave-dimmer-switch-generic.groovy | 2 +- .../zwave-switch-generic.src/zwave-switch-generic.groovy | 2 +- .../zwave-switch-secure.src/zwave-switch-secure.groovy | 2 +- devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy b/devicetypes/smartthings/dimmer-switch.src/dimmer-switch.groovy index ef0fddd..892baf1 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") { + definition (name: "Dimmer Switch", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { capability "Switch Level" capability "Actuator" capability "Indicator" diff --git a/devicetypes/smartthings/wemo-light-switch.src/wemo-light-switch.groovy b/devicetypes/smartthings/wemo-light-switch.src/wemo-light-switch.groovy index b90a577..b5a4881 100644 --- a/devicetypes/smartthings/wemo-light-switch.src/wemo-light-switch.groovy +++ b/devicetypes/smartthings/wemo-light-switch.src/wemo-light-switch.groovy @@ -18,7 +18,7 @@ metadata { - definition (name: "Wemo Light Switch", namespace: "smartthings", author: "SmartThings") { + definition (name: "Wemo Light Switch", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { capability "Actuator" capability "Switch" capability "Polling" diff --git a/devicetypes/smartthings/wemo-switch.src/wemo-switch.groovy b/devicetypes/smartthings/wemo-switch.src/wemo-switch.groovy index fcda9ec..27c735e 100644 --- a/devicetypes/smartthings/wemo-switch.src/wemo-switch.groovy +++ b/devicetypes/smartthings/wemo-switch.src/wemo-switch.groovy @@ -16,7 +16,7 @@ * Date: 2015-10-11 */ metadata { - definition (name: "Wemo Switch", namespace: "smartthings", author: "SmartThings") { + definition (name: "Wemo Switch", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.smartplug") { capability "Actuator" capability "Switch" capability "Polling" diff --git a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy index 55b22f2..68878df 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") { + definition (name: "ZigBee Dimmer", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { 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 7c9c575..bb94d36 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") { + definition (name: "Z-Wave Dimmer Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { capability "Switch Level" capability "Actuator" capability "Health Check" 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 ced18ce..e2f65d4 100644 --- a/devicetypes/smartthings/zwave-switch-generic.src/zwave-switch-generic.groovy +++ b/devicetypes/smartthings/zwave-switch-generic.src/zwave-switch-generic.groovy @@ -12,7 +12,7 @@ * */ metadata { - definition (name: "Z-Wave Switch Generic", namespace: "smartthings", author: "SmartThings") { + definition (name: "Z-Wave Switch Generic", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { capability "Actuator" capability "Health Check" capability "Switch" diff --git a/devicetypes/smartthings/zwave-switch-secure.src/zwave-switch-secure.groovy b/devicetypes/smartthings/zwave-switch-secure.src/zwave-switch-secure.groovy index a5a1dc1..c81d931 100644 --- a/devicetypes/smartthings/zwave-switch-secure.src/zwave-switch-secure.groovy +++ b/devicetypes/smartthings/zwave-switch-secure.src/zwave-switch-secure.groovy @@ -12,7 +12,7 @@ * */ metadata { - definition (name: "Z-Wave Switch Secure", namespace: "smartthings", author: "SmartThings") { + definition (name: "Z-Wave Switch Secure", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { capability "Switch" capability "Refresh" capability "Polling" diff --git a/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy b/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy index b7c7106..151a116 100644 --- a/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy +++ b/devicetypes/smartthings/zwave-switch.src/zwave-switch.groovy @@ -12,7 +12,7 @@ * */ metadata { - definition (name: "Z-Wave Switch", namespace: "smartthings", author: "SmartThings") { + definition (name: "Z-Wave Switch", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") { capability "Actuator" capability "Indicator" capability "Switch" From bdcaf175f0af833eb4b1f1f7a612d190472825a0 Mon Sep 17 00:00:00 2001 From: Bob Florian Date: Fri, 31 Mar 2017 14:47:10 -0700 Subject: [PATCH 3/7] Check for null device and send refresh() from configure() --- .../zooz-power-strip.groovy | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/devicetypes/smartthings/zooz-power-strip.src/zooz-power-strip.groovy b/devicetypes/smartthings/zooz-power-strip.src/zooz-power-strip.groovy index a6ee0ea..5647939 100644 --- a/devicetypes/smartthings/zooz-power-strip.src/zooz-power-strip.groovy +++ b/devicetypes/smartthings/zooz-power-strip.src/zooz-power-strip.groovy @@ -25,6 +25,7 @@ metadata { capability "Refresh" capability "Actuator" capability "Sensor" + capability "Configuration" fingerprint manufacturer: "015D", prod: "0651", model: "F51C", deviceJoinName: "Zooz ZEN 20 Power Strip" } @@ -65,6 +66,10 @@ def updated() { } } +def configure() { + refresh() +} + ////////////////////// // Event Generation // @@ -107,15 +112,17 @@ def zwaveBinaryEvent(cmd, endpoint) { def result = [] def children = childDevices def childDevice = children.find{it.deviceNetworkId.endsWith("$endpoint")} - childDevice.sendEvent(name: "switch", value: cmd.value ? "on" : "off") + if (childDevice) { + childDevice.sendEvent(name: "switch", value: cmd.value ? "on" : "off") - if (cmd.value) { - // One on and the strip is on - result << createEvent(name: "switch", value: "on") - } else { - // All off and the strip is off - if (! children.any { it.currentValue("switch") == "on" }) { - result << createEvent(name: "switch", value: "off") + if (cmd.value) { + // One on and the strip is on + result << createEvent(name: "switch", value: "on") + } else { + // All off and the strip is off + if (!children.any { it.currentValue("switch") == "on" }) { + result << createEvent(name: "switch", value: "off") + } } } result From d51ec9e518e1c8da01ddd1618f8920bb83614364 Mon Sep 17 00:00:00 2001 From: jackchi Date: Mon, 3 Apr 2017 16:47:15 -0700 Subject: [PATCH 4/7] [CHF-571] [CHF-568] Revert untested Health Check on Keen Home & EcoNet Vents --- .../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 78ab8b7..ee9e703 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 f441beb..344f1b5 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 a297e79b0e9e7cf0268451fb93d99204360d882b Mon Sep 17 00:00:00 2001 From: jackchi Date: Tue, 4 Apr 2017 10:23:04 -0700 Subject: [PATCH 5/7] Revert "Added health-check for Logitech Harmony Hub" This reverts commit cbd15ae9ccfae79e25e70b14b2918542379ed3de. --- .../logitech-harmony-hub-c2c.groovy | 15 --------------- .../logitech-harmony-connect.groovy | 4 ---- 2 files changed, 19 deletions(-) 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..8395f80 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,7 +7,6 @@ metadata { definition (name: "Logitech Harmony Hub C2C", namespace: "smartthings", author: "SmartThings") { capability "Media Controller" capability "Refresh" - capability "Health Check" command "activityoff" command "alloff" @@ -39,16 +38,6 @@ 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") @@ -69,10 +58,6 @@ 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 72763ef..43c55fa 100644 --- a/smartapps/smartthings/logitech-harmony-connect.src/logitech-harmony-connect.groovy +++ b/smartapps/smartthings/logitech-harmony-connect.src/logitech-harmony-connect.groovy @@ -511,10 +511,6 @@ 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 2fd8cf14162807d30ddda173e6e17c308f230b8f Mon Sep 17 00:00:00 2001 From: Vinay Rao Date: Tue, 4 Apr 2017 14:38:11 -0700 Subject: [PATCH 6/7] 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 7/7] 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") }