Nest won't confirm/install on HassIO .63

I’m running the latest version of Hass.IO (.63). I did everything according to the Nest instructions for setup (developer account, adding the authorization code upon startup), but it doesn’t seem to verify. I keep getting errors, including below. I have deleted the nest.conf and restarted Hassio (RPI3), entered a new authorization code, but I’m still running into the same errors. I’m not blocking any outbound ports on my Netgear R6400 router. Any idea what I’m missing. I’m not running pihole either.

Errors below:

Error while setting up platform nest
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 84, in async_setup
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/binary_sensor/nest.py", line 76, in setup_platform
    for variable in conditions
  File "/usr/lib/python3.6/site-packages/homeassistant/components/binary_sensor/nest.py", line 77, in <listcomp>
    if variable in BINARY_TYPES]
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/nest.py", line 100, in __init__
    self._location = self.device.where
  File "/usr/lib/python3.6/site-packages/nest/nest.py", line 234, in where
    return self.structure.wheres[self.where_id]['name']
KeyError: 'Xdtx404MtuFuPb12Y2zJebc05AUXIlkMuzJ_0efwI2WMtEgGNenv6A'

also this error:

Error while setting up platform nest
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 84, in async_setup
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/binary_sensor/nest.py", line 76, in setup_platform
    for variable in conditions
  File "/usr/lib/python3.6/site-packages/homeassistant/components/binary_sensor/nest.py", line 77, in <listcomp>
    if variable in BINARY_TYPES]
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/nest.py", line 100, in __init__
    self._location = self.device.where
  File "/usr/lib/python3.6/site-packages/nest/nest.py", line 234, in where
    return self.structure.wheres[self.where_id]['name']
KeyError: 'Xdtx404MtuFuPb12Y2zJebc05AUXIlkMuzJ_0efwI2WMtEgGNenv6A'

Got the same Error,i think it cant update…the whole HA is messed up.I can tonncet to HA Cloud
cant even update via putty

I hit the same issue with my home assistant update using the latest 0.63.3 release. I tracked it back to an upstream API bug with the nest API (see https://nestdevelopers.io/t/missing-where-name-from-some-devices/1202 for details).

I’ve filled an issue with python-nest (https://github.com/jkoelker/python-nest/issues/127) to work around the bug as I doubt Nest will provide a quick fix. I’ve posted a PR to address the python-nest issue (link in next comment because as a new user I can only include 2 links in a single comment).

Once the fix is merged and a release of python-nest is done containing the fix I plan to file a bug and PR with home assistant to update to the latest python-nest to address this.

In the meantime you can try going through the “wheres” assigned to your nest devices and changing the “wheres” to ones that are visible in the API.

I can provide some example code to help you find the devices that need to have a where changed.

1 Like

And now the link to the PR to address the issue in python-nest.

https://github.com/jkoelker/python-nest/pull/128

python-nest 3.7.0 has been released with a work around for this. I’ve submitted an issue and PR to home assistant to bump python-nest to latest.

Issue: https://github.com/home-assistant/home-assistant/issues/12589
PR: https://github.com/home-assistant/home-assistant/pull/12590

That’s so helpful (and such a great example of the amazing community that we have). Do you mind providing some example code in the meantime?

I put together a sample python program that should dump out the devices in your account that are missing where_names.

The code is available at https://www.liquidreality.org/files/nest/find-missing-where.tar.gz

It requires a working python and virtualenv. Once you download it and uncompress it cd into the find-missing-where directory. You then need to create a conf.yaml file that has your product_id and product_secret in it (product_id = client_id and product_secret = client_secret from your home assistant config fill).

Once you create the conf.yaml just run ./run-test. This will create a virtualenv to run the code in and execute the script. The first time you run it the script will provide a URL to go to get to get a in and enter it into the script (similar to the first time you added nest integration to home assistance). It will then go through and find all devices associated with your nest account that don’t have a valid where_name.

Please let me know if you have any questions or problems.

The update to use the lates python-nest was merged for home assistant yesterday. The next release of home assistant should ship this fix.

That’s great. Thanks so much for the good work!

Solved! Confirmed it’s working in the .66 beta. Good work, @cfb !

I started facing this issue this morning. I have Nest Thermostats and Nest Hello. I was trying to debug the issue with the hello and I updated the permissions. Since then Hassio is showing me “Invalid Config” issue. I recreated the OAuth client in Nest and copied the new credentials in the configuration but I still get the same issue.

Below is the error from the logs:-
Log Details (ERROR)
Tue Jun 12 2018 16:11:35 GMT-0400 (Eastern Daylight Time)

Error during setup of component nest
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/setup.py”, line 143, in _async_setup_component
hass, processed_config)
File “/usr/lib/python3.6/site-packages/homeassistant/components/nest.py”, line 204, in async_setup
await async_setup_nest(hass, nest, config)
File “/usr/lib/python3.6/site-packages/homeassistant/components/nest.py”, line 139, in async_setup_nest
hass.data[DATA_NEST] = NestDevice(hass, conf, nest)
File “/usr/lib/python3.6/site-packages/homeassistant/components/nest.py”, line 218, in init
self.local_structure = [s.name for s in nest.structures]
File “/usr/lib/python3.6/site-packages/nest/nest.py”, line 1832, in structures
for stid in self._status[STRUCTURES]]
File “/usr/lib/python3.6/site-packages/nest/nest.py”, line 1781, in _status
self._open_data_stream("/")
File “/usr/lib/python3.6/site-packages/nest/nest.py”, line 1667, in _open_data_stream
raise AuthorizationError(response)
nest.nest.AuthorizationError: Authorization Failed

I am running Home Assistant 0.71.0

@keyurbhatnagar No, your problem is different. Please delete your nest.conf from your ~/.homeassistant folder, which cached an access token base on your old oauth id and permission.

1 Like

@awarecan Thanks, that worked.