SANdood / Ecobee-Suite

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

Bug fixes and support for legacy Ecobee Smart thermostats with remote sensors. #1

Closed TheBlueBass closed 6 years ago

TheBlueBass commented 6 years ago

Great work on the Ecobee-Suite SmartThings app! I'd like to offer a couple of enhancements for your consideration.

Background: I have 2 early-model Ecobee Smart thermostats with Remote Sensor Modules measuring several other locations. I found that the existing code enumerated the thermostats and the remote sensors correctly, but failed to present them on the SmartThings app for two reasons: 1) The assignment of the sensorMap key value did not account for making the sensor unique to a particular thermostat. The effect was that only the last-enumerated thermostat would have its sensors available in the sensorMap array. I fixed this by including the tid of the thermostat, separated with a '.' from the sensor id so that it didn't break downstream parsing based on splitting the string on the '-' character. 2) The code did not handle the type "monitor_sensor" which is used by the Ecobee Smart RSM sensors. This was easy to fix by including a new handler patterned on the "ecobee3_remote_sensor". I also handle the case of the sensor name being blank, which indicates that the sensor is not configured on the thermostat.

If you're happy with the changes, please consider them as a contribution to the main fork.

TheBlueBass commented 6 years ago

I think your suggestion is a reasonable approach. As best I can tell, the older "monitor_sensor" sensors don't have a unique name, so adding the TID made sense for them. I don't have any of the newer model thermostats to compare against, so if they already enforce uniqueness across sensors and thermostats, then there's no reason to add the TID for those. And I agree, not breaking an existing installation is very much preferred. :)

I'll be happy to test out your suggestion if you'd like.

SANdood commented 6 years ago

Made modifications based on your pull request, but I also took the opportunity to clean things up a little bit around the changes, so I didn't actually do the pull. Pretty sure my edits capture your contribution; let me know if not.

Closing this request as "completed"