SANdood / Ecobee-Suite

Ecobee Suite is for integrating Ecobee thermostats & sensors with the Hubitat home automation platform
108 stars 152 forks source link

Hubitat Thermostat template - sending incorrect data - work around... #39

Closed xninjax closed 4 years ago

xninjax commented 4 years ago

https://github.com/SANdood/Ecobee-Suite/blob/09f9cab7048086e8aad2c58c85059c1f934a9d29/devicetypes/sandood/ecobee-suite-thermostat.src/ecobee-suite-thermostat.groovy#L2939

Found that the Hubitat Thermostat tile is sending

setThermostatFanMode( on)

Note the 'space' character in front of 'on' ---> causing a failure to set the ecobee fan modes and throwing an error.

Starting at L2939, you have a work-around for other misbehaving calls to setThermostatFanMode(). I have tested on my Hubitat by adding an additional || condition to look for the " on" string. It fixes the badly behaving call...

if (value == "fanOn" || value == "on" || value == " on") { value = "on" }

I suggest adding this condition (with the leading space character) as part of each 'if' statement L2939-L2942...

SANdood commented 4 years ago

Thanks. I'm going to fix it in a different manner to cover both fanMode and thermostatMode, just in case this occurs elsewhere. I'm just going to insert value = value.trim() before the checks at L2939, and in a similar location in setThermostatMode() up above it.

I expect to post later today - after my chores :)

SANdood commented 4 years ago

Fixed in 1.8.16, but in a different manner (as noted above).