From e7e6ea7d5631d986cf1d0805a0e06e2f15b62456 Mon Sep 17 00:00:00 2001 From: Yaima Valdivia Date: Wed, 2 Mar 2016 14:20:44 -0800 Subject: [PATCH] Including unknown temperature values as part of the response for sensors https://smartthings.atlassian.net/browse/DVCSMP-1511 --- .../ecobee-sensor.src/ecobee-sensor.groovy | 2 +- .../ecobee-connect.src/ecobee-connect.groovy | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/devicetypes/smartthings/ecobee-sensor.src/ecobee-sensor.groovy b/devicetypes/smartthings/ecobee-sensor.src/ecobee-sensor.groovy index f2583bf..6110a27 100644 --- a/devicetypes/smartthings/ecobee-sensor.src/ecobee-sensor.groovy +++ b/devicetypes/smartthings/ecobee-sensor.src/ecobee-sensor.groovy @@ -48,8 +48,8 @@ metadata { } standardTile("motion", "device.motion") { - state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0") state("inactive", label:'no motion', icon:"st.motion.motion.inactive", backgroundColor:"#ffffff") + state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#53a7c0") } standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") { diff --git a/smartapps/smartthings/ecobee-connect.src/ecobee-connect.groovy b/smartapps/smartthings/ecobee-connect.src/ecobee-connect.groovy index ea32f56..d66e7c0 100644 --- a/smartapps/smartthings/ecobee-connect.src/ecobee-connect.groovy +++ b/smartapps/smartthings/ecobee-connect.src/ecobee-connect.groovy @@ -545,10 +545,15 @@ def updateSensorData() { def occupancy = "" it.capability.each { if (it.type == "temperature") { - if (location.temperatureScale == "F") { - temperature = Math.round(it.value.toDouble() / 10) + if (it.value == "unknown") { + temperature = "--" } else { - temperature = convertFtoC(it.value.toDouble() / 10) + if (location.temperatureScale == "F") { + temperature = Math.round(it.value.toDouble() / 10) + } else { + temperature = convertFtoC(it.value.toDouble() / 10) + } + } } else if (it.type == "occupancy") {