New Ecobee errors after upgrade to 0.40.1

After upgrading to the latest 0.40.1 release, which per the release notes included a new Ecobee update (pyecobee 0.0.7), I’m logging the following errors:

17-03-16 08:51:14 WARNING (Thread-3) [pyecobee] Error connecting to Ecobee while attempting to get thermostat data.  Refreshing tokens and trying again.
17-03-16 09:52:12 WARNING (Thread-8) [pyecobee] Error connecting to Ecobee while attempting to get thermostat data.  Refreshing tokens and trying again.
17-03-16 10:53:10 WARNING (Thread-8) [pyecobee] Error connecting to Ecobee while attempting to get thermostat data.  Refreshing tokens and trying again.

Haven’t changed anything in my config. Any ideas where I should go from here?

I just upgraded but not seeing those errors in my logs for the ecobee.

Have you tried shutting down HA and then rebooting the host?

I did that in the course of doing the upgrade, but I’ll give it another shot just to be sure.

pi@raspberrypi:~ $ sudo service home-assistant stop
pi@raspberrypi:~ $ sudo reboot

Nothing Ecobee-related in the log output immediately after reboot:

`17-03-16 11:16:43 WARNING (MainThread) [homeassistant.helpers.condition] Error during and-condition: unsupported operand type(s) for +: 'NoneType' and 'datetime.timedelta'`

Will report back after an hour or two, since it seems that the errors were previously showing up once an hour.

I’ll keep an eye out and if I see anything on my end I’ll report back here.

It’s been a couple of hours and so far no new Ecobee errors after stopping HA and rebooting. I’ll continue to monitor for a while longer before chalking it up to a one-time glitch resulting from the act of upgrading to 0.40.1

1 Like

Still nothing from ecobee on my end.

I’m seeing the same issue whenever climate.set_hold_mode is called up. I’ve been able to reproduce it a few times after a number of restarts. Same error in the logs.

WARNING (Thread-9) [pyecobee] Error connecting to Ecobee while attempting to set climate hold.  Refreshing tokens...
WARNING (Thread-7) [pyecobee] Error connecting to Ecobee while attempting to get thermostat data.  Refreshing tokens and trying again

Using climate.set_away_mode does not cause the same error, however it doesn’t keep it in an indefinite hold like it once did, but that’s another matter.

That might have been caused by using a lower case none for hold_mode

- service: climate.set_hold_mode
  data:
    entity_id: climate.main_floor
    hold_mode: none

Changed it and haven’t seen the error since, will monitor:

- service: climate.set_hold_mode
  data:
    entity_id: climate.main_floor
    hold_mode: None
1 Like

OK, HA ran all night with no logged errors (of any kind, not just Ecobee)! This is, I think, a first for me. I’m ready to declare the Ecobee errors a one-time transition anomaly. Thanks for the reminder to stop and reboot one more time after upgrading.

Well, I wish I could say this was resolved, but the problem reappeared after I made an unrelated change to a customization and restarted HA. So I tried the same trick as before, stopping HA and rebooting the r-pi, but no joy. I’m still getting the same error as before:
17-03-18 12:47:20 WARNING (Thread-6) [pyecobee] Error connecting to Ecobee while attempting to get thermostat data. Refreshing tokens and trying again.

OK, I’ve done some more research on this. The only change in 0.40.1 was the addition of some code to delete vacation mode, and to use the logger to log. I think the logger change is what’s causing me to be able to see the errors, but I suspect the errors have been there all along prior to 0.40.1.

What’s interesting is that Ecobee seems to work just fine, despite the error.

Next step is to insert some debugging code and see what’s happening when the error is triggered…

Well, here’s what I’ve found. I’m documenting it in case someone else comes across this thread in the future.

Ecobee updates roughly every three minutes. On my system, it usually updates successfully. However, every 20th update attempt fails initially, then succeeds when tried again immediately after refreshing tokens. Since 20 x 3 minutes = 1 hour, it suggests that perhaps something is expiring hourly, causing the update to fail prior to the tokens being refreshed.

At this point, I’m concluding that the warnings aren’t indicating anything amiss with my system or configuration. Indeed, it appears that the code has been written to expect this condition and to recover from it gracefully. I’m now looking in to making a local code change to suppress the warning message unless the update fails immediately subsequent to the token refresh. If that works out, I’ll offer it as a pull request sometime in the future.

1 Like

Just investigating this on my own setup and agree, based on time stamps once an hour it fails.

2017-05-16 00:03:04 WARNING (Thread-12) [pyecobee] Error connecting to Ecobee while attempting to get thermostat data.  Refreshing tokens and trying again.
2017-05-16 00:59:00 ERROR (Thread-5) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: keep_alive_call() takes 0 positional arguments but 1 was given
2017-05-16 01:03:59 WARNING (Thread-1) [pyecobee] Error connecting to Ecobee while attempting to get thermostat data.  Refreshing tokens and trying again.
2017-05-16 01:59:14 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
TypeError: keep_alive_call() takes 0 positional arguments but 1 was given
2017-05-16 02:04:53 WARNING (Thread-7) [pyecobee] Error connecting to Ecobee while attempting to get thermostat data.  Refreshing tokens and trying again.
2017-05-16 02:59:01 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved

Getting the same error about refreshing tokens.

It looks like the token expires every hour:
https://www.ecobee.com/home/developer/api/documentation/v1/auth/token-refresh.shtml

Having the same problem any fixes yet?