Ecobee 3 Remote Sensors into ST

Hello @jdolan01

Here is my statement about this issue. I’m repeating what I’ve said before in this thread.

My ecobee Init is a smartapp that polls the My ecobee device(s) on a regular basis to ensure that the refresh token is renewed on a regular basis. Ecobee requires (contrary to some other cloud providers) to refresh its authorization token every 59 minutes for greater security. The code that I’ve developed is an interface between ST and ecobee, so there are some dependencies on both platforms.

The algorithm within MyEcobeeInit and MyEcobee device has been coded to renew automatically the token every 55 minutes or so. If it fails to renew the token, then the connection with ecobee will be lost.

As you can see, the algorithm will work the same after 1 hour or several days. So, if the smartapp works for more than 1 hour, it should work for days even months without issues provided that there are no other external factors (ex. connection issues between ST and ecobee or with your physical thermostat).

You can infer that there are 3 potential “points of failure”:

(1) It could be an issue on the ecobee side: there could be a temporary network issue or an issue with the ecobee servers.

For the past months, it has happened more frequently.

See this thread at the ecobee forum:

http://developer.ecobee.com/api/topics/ecobee-servers-outage

Ecobee just recently admitted that there were some issues on their side also. I’ve asked for a status page so that everbody would be aware of any outages on their side (similar to ST’s status page).

(2) It could due to a (temporary) bad internet connection on your side. Ecobee thermostats connect thru wifi, so if the physical thermostat is not connected for a while, then you may not have control over the thermostat during that timeframe.

(3) It could also be an issue on the ST side. We’ve all experienced issues with ST scheduling. If the smartapp is not rescheduled every 20 minutes, and you don’t manually poll the thermostat thru ST, then the “refresh token” will not be obtained, and the authorization token will be lost.

In the logs, if one of these 3 potential points of failure happens, there will be an error msg such as

refresh_tokens> Authentication error, ecobee site cannot be reached

or some unauthorized exceptions

These points of failure are not easy to investigate.
I had myself a similar issue in the past month (2 or 3 times) after months of continual operation.

For the point of failure no 3, in the IDE, you can check if the smartapp is rescheduled to run every 20 minutes by clicking on

https://graph.api.smartthings.com/location/list

And, then click on “smartapps” at the right for your location.

Then scroll down to My Ecobee Init, and click on it. You should see something like this:

If you don’t see any waiting “takeAction” job with a future timestamp then it means that the job has not been rescheduled correctly.

You can also do the same for the ecobee3RemoteSensorInit smartapp, if your sensors are not updating within SmartThings, it could also be a connection issue (as stated above) or a ST scheduling issue.

See this other ST threads about this common issue with the scheduler:

HOW TO FIX THE UNAUTHORIZED ISSUES:

To fix these issues, you have to reschedule My ecobee Init and re-authorize ST with ecobee by executing
My Ecobee Init again.

The same thing for the ecobee3’s remote sensors, if you have an issue, please re-execute ecobee3RemoteSensorInit.

Sadly, I’ve tried to implement many workarounds in my code, but the real issue is rooted in the ST platform and/or on the ecobee side. My code is just an interface between the 2, and if one platform fails, my code will not be able to recover in all situations.

At my home, the scheduler has been running fine for about a week now, so hopefully, if you reschedule My Ecobee Init, it should be fine for weeks or (and hopefully) months of operation.

P.S. If you have a large installation of ecobee3 thermostats (more than 3 and many remote sensors), I’d recommend to create many instances of My Ecobee Init and split the thermostats amongst the My Ecobee Init instances as the ST platform reaches sometimes a max execution time constraint.