Skip to content

Commit e4e4925

Browse files
authored
ICP-3846 Ecobee Sensor's temperature is missing "units" (SmartThingsCommunity#2862)
Adding unit to temperature event and changing invalid value "--" for "unknown" to 0 as temperature is of type NUMBER.
1 parent 5b06029 commit e4e4925

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

smartapps/smartthings/ecobee-connect.src/ecobee-connect.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,8 @@ def updateSensorData() {
508508
it.capability.each {
509509
if (it.type == "temperature") {
510510
if (it.value == "unknown") {
511-
temperature = "--"
511+
// setting to 0 as "--" is not a valid number depite 0 being a valid value
512+
temperature = 0
512513
} else {
513514
if (location.temperatureScale == "F") {
514515
temperature = Math.round(it.value.toDouble() / 10)
@@ -528,7 +529,7 @@ def updateSensorData() {
528529
def dni = "ecobee_sensor-"+ it?.id + "-" + it?.code
529530
def d = getChildDevice(dni)
530531
if(d) {
531-
d.sendEvent(name:"temperature", value: temperature)
532+
d.sendEvent(name:"temperature", value: temperature, unit: location.temperatureScale)
532533
d.sendEvent(name:"motion", value: occupancy)
533534
}
534535
}

0 commit comments

Comments
 (0)