Cannot re-add Ecobee integration; error: Waiting on integrations to complete setup: ecobee

Out of the blue last night I started having errors in my log: ecobee tokens invalid; re-authentication required. This has happened to me before when restarting HA, but not out of the blue. As I have done in the past, I deleted the Ecobee integration so that I could add it again in order to reauthorize. However, I now cannot get the integration to complete. I enter my API key, I go to the Ecobee portal and authorize with the pin code that HA has given me, I receive a success notification from Ecobee, but when I go back to HA and click Submit, I just get a spinning wheel and it hangs. I have to click the X to get out, and I end up with an entry on the Integrations page for Ecobee that has no devices or entities.

I have tried restarting HA, deleting the integration and re-adding it multiple times, it is always fails in the same way. A restart of HA after deleting the integration produces the following:

2020-12-13 16:38:23 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-12-13 16:38:23 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for weatherbit which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-12-13 16:39:01 WARNING (MainThread) [homeassistant.components.hue] ('Please check for software updates of the bridge in the Philips Hue App.', 'Signify Hue', 'hue_hub_firmware')
2020-12-13 16:39:24 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ecobee
2020-12-13 16:40:24 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ecobee
2020-12-13 16:41:24 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ecobee
2020-12-13 16:42:24 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ecobee
2020-12-13 16:43:24 WARNING (MainThread) [homeassistant.bootstrap] Setup timed out for stage 2 - moving forward
2020-12-13 16:43:24 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyecobee/__init__.py", line 564, in _request
response.raise_for_status()
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.ecobee.com/token?grant_type=refresh_token&refresh_token=s9uGANEMMtVSEZIIMHjjZ9e&client_id=TRP9 [*I have deleted part of this just in case*]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 130, in async_init
result = await self._async_handle_step(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 213, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/ecobee/config_flow.py", line 107, in async_step_import
if await self.hass.async_add_executor_job(ecobee.refresh_tokens):
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/pyecobee/__init__.py", line 159, in refresh_tokens
response = self._request(
File "/usr/local/lib/python3.8/site-packages/pyecobee/__init__.py", line 578, in _request
raise InvalidTokenError(
pyecobee.errors.InvalidTokenError: ecobee tokens invalid; re-authentication required
2020-12-13 16:43:24 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ecobee
2020-12-13 16:44:24 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ecobee
2020-12-13 16:45:24 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ecobee
2020-12-13 16:46:24 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ecobee
2020-12-13 16:47:24 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ecobee
2020-12-13 16:48:24 WARNING (MainThread) [homeassistant.bootstrap] Setup timed out for bootstrap - moving forward
2020-12-13 16:48:24 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ecobee
2020-12-13 16:49:24 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ecobee

Every minute I continue get the error Waiting on integrations to complete setup: ecobee. The integration has been deleted, so it shouldn’t be waiting for anything. It takes 10 minutes for HA to complete a restart because it is waiting for the integration. This means my z-wave network doesn’t start during this time, among other things. I am running Home Assistant 0.118.5 (HassOS 4.17) in a Proxmox VM on a NUC.

Any help on how I can get past this and get my Ecobee integration back would be very much appreciated.

I have lost my integration also tonight

Same here and there is no even HA web UI reachable for me. Yet to figure out how to disable this integration meanwhile through client (in one of the docker containers on poor RPi :wink: )

Mine broke earlier and I also got the same error. I received an email from ecobee in mid-November saying the access token and PIN formats would be changing on Dec 1st. The changes must have taken a few days to roll out. Maybe the integration needs updating?

EDIT:
I got mine working again (I’m on v0.118.5). :slightly_smiling_face:

I deleted the integration from HA and then restarted. I went to ecobee’s website and removed the app from the “My Apps” section.

I re-created the app on ecobee’s website (using the steps from the ecobee integration page on creating the app, I kept the same app name I had before), then re-added the integration back into HA. I could control my ecobee3 Lite like before, even after another HA/system restart.

I tried this and it doesn’t work for me. I have the same errors and the same spinning circle of death when I try to re-add the integration. Were you getting this error

Waiting on integrations to complete setup: ecobee

or just the authentication error? I have tried multiple times, rebooted HA, rebooted the host, I can’t get rid of the first error. It’s like it is stuck somewhere…

Edited to add: I finally figured it out. I had a file in my yaml with the Ecobee API key in it, from back when things were set up manually. Although that has never caused a problem in the past, deleting it and restarting HA stopped the “waiting on integrations to complete setup” error. I tried adding the Ecobee integration, and this time it worked. :slight_smile:

1 Like

I too have this problem - exact problem. But, I removed the yaml API code and still having this issue.

Did you try deleting the app on the ecobee site? I deleted that, deleted the integration, restarted, and without the “waiting” error, re-added the integration.

Absolutely. I tried everything. I cleaned house. Removed the integration, removed any YAML, etc. On ecobee’s site I removed the app, removed the developer api, etc. The reloaded HA, then rebooted the host. Started from scratch… except for one thing. When I added the ecobee integration, the API key was pre-filled with an old API string. I changed it to a new one after creating a new integration on ecobee, adding the app to get a PIN. Clicked submit, same old same old. What concerns me is where the API key is stored in HA. Even though I deleted the integration, something still lingers and I can’t figure out why or where.

The prefilling of the API key was happening to me too until I removed the YAML entry that gave my API key via my secrets.yaml file:

ecobee:
  api_key: !secret ecobee_api_key

I also removed the API key from the secrets.yaml file. I restarted HA, and then there was no pre-filled API key when I next tried to add the integration.

Removing the YAML code from the configuration.yaml & secrets was also done. But, the API key kept reappearing.

I feel for you, it’s so frustrating. I spent hours working on this until I finally got it working. You could try asking on Discord…I tried that, and didn’t get any responses, but you might have more luck. I think it depends on who is around when a question is asked…

whuuut? I just checked that HA had no ecobee integration, no yaml code, HA reloaded and set up a new app under ‘developer’. It’s a real pain the way ecobee keeps saying I already have that application just because I use “HA” somewhere in the app name. So I just typed in a bunch of junk characters and got a new API token. I popped it into HA and got a new PIN. Popped that into ecobee “Applications”, went back to HA and clicked on Submit and for the first time – it worked. Damn!

Glad you finally got it working!

I had the same issue when redoing my integration and trying to create a new app on the ecobee site. I’m pretty sure those app names have to be unique across the entire platform, not just to your account. Which is why I couldn’t use HA, HASS, Home Assistant, nothing. I also just mashed on my keyboard and it finally let me save it.

Noticed this problem days ago, at which time I deleted the Ecobee integration. Waited until tonight to re-new/refresh on the Ecobee site. Re-added the Ecobee integration, entered the code, everything came up peachy-keen. I’m guessing I just got VERY lucky.

I guess it’s time for a feature which reports when an integration is broken. I only just realized this was broken as I usually use the ecobee app to manage the settings.