Nest Component - KeyError: 'structures'

Hello

I’m running hassbian 0.71.0 with python 3.6. I’ve tried various combinations of deleting the the nest.conf file, recreating the nest developer keys, moving the nest entry around in the configuration file. I’ve tested the correct port is on and just dont seem to be getting anywhere. I’ve tried with and without the structures argument. Can anyone tell me what i’m doing wrong? Cheers.

Error during setup of component nest
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 143, in _async_setup_component
    hass, processed_config)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/nest.py", line 204, in async_setup
    await async_setup_nest(hass, nest, config)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/nest.py", line 139, in async_setup_nest
    hass.data[DATA_NEST] = NestDevice(hass, conf, nest)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/nest.py", line 218, in __init__
    self.local_structure = [s.name for s in nest.structures]
  File "/srv/homeassistant/lib/python3.6/site-packages/nest/nest.py", line 1832, in structures
    for stid in self._status[STRUCTURES]]
KeyError: 'structures'

all you should need is this if you only have 1 house:

nest:
  client_id: CLIENT_ID
  client_secret: CLIENT_SECRET

is that setup with the correct ID and secret?

Yes I have. I’ve recreated then as well in the nest developer console as well.

That’s all you need to configure it. You shouldn’t get the key error if you don’t provide the ‘structures’ section. Are you getting any other errors prior to this error?

I’ve just recreated the client id and client secret. It authenticates correctly as the number of users increments in the developer console. I dont have any reference to structures in the configuration file but sill get the same error. No other errors either.

It may be a bug in the component. It looks like everything is set up for you correctly. It’s not getting a proper response from you nest. So it could be a network issue. Also, are you sure your nest is supported?

How can i check if its supported?

Please try to upgrade to 0.72. If you are still experiencing problem, try upgrade to python-nest 4.0.3 or wait until HA 0.73 released. I have added some guarding code Also, there is a pending PR to resolve some problem related with insufficient permission setting in your client_id.

To upgrade to python-nest 4.0.3 base on HA 0.72, change homeassistant/components/nest/__init__.py to REQUIREMENTS = ['python-nest==4.0.3']

After you upgrade to python-nest 4.0.3, enable log likes following example, then post your logs here.

# configuration.yaml
logger:
  default: warning
  logs:
    homeassistant.components.nest: debug
    nest: debug
    sseclient: debug

I bet you missed Structure read/write permission under Other Permissions category.

1 Like