Netatmo "Error while setting up platform netatmo" KeyError: 'events'

this is my first post usually reading the various topics and guides I have always managed to solve my problems but this just can not fix it. I’m 2 months I can not make it work the netatmo welcom.
In the old 0.6x version everything went perfectly

Platform Hass.io v 0.73.1

My configuration.yaml

netatmo:
  api_key: my api_key
  secret_key: my secret_key
  username: my username
  password: my password

I See my sensor for meteo station but the camera don’t work.

I have this log for the error:

Error while setting up platform netatmo

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    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/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/netatmo.py", line 73, in setup_platform
    if not data.get_camera_names():
  File "/usr/lib/python3.6/site-packages/homeassistant/components/netatmo.py", line 82, in get_camera_names
    self.update()
  File "/usr/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 318, in wrapper
    result = method(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/netatmo.py", line 113, in update
    self.camera_data = pyatmo.CameraData(self.auth, size=100)
  File "/usr/lib/python3.6/site-packages/smart_home/Camera.py", line 50, in __init__
    for e in self.rawData['homes'][i]['events']:
KeyError: 'events'

thanks in advance to those who want to help me.

Not support for me?

The error is coming from a different component, not the component config you listed. EDIT: To clarify, the error is coming from the binary_sensor netatmo component, not the netatmo authentication component.

So I have 2 questions. Did you configure any sensors for netatmo?

If not, what devices do you own?

thanks for the reply @petro

So I have 2 questions. Did you configure any sensors for netatmo?

no I added only this in the file configuration.yaml for all my netatmo component

netatmo:
  api_key: my api_key
  secret_key: my secret_key
  username: my username
  password: my password

If not, what devices do you own?

I own the weather station that includes the internal and external sensor, then I also own the camera netatmo welcome which is what I can no longer see as in previous versions of home assistant even if I have the same configuration as before.

what advice can you give me to solve the problem? I enclose the two error messages:

First error:

Error while setting up platform netatmo

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    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/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/netatmo.py", line 73, in setup_platform
    if not data.get_camera_names():
  File "/usr/lib/python3.6/site-packages/homeassistant/components/netatmo.py", line 82, in get_camera_names
    self.update()
  File "/usr/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 318, in wrapper
    result = method(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/netatmo.py", line 113, in update
    self.camera_data = pyatmo.CameraData(self.auth, size=100)
  File "/usr/lib/python3.6/site-packages/smart_home/Camera.py", line 50, in __init__
    for e in self.rawData['homes'][i]['events']:
KeyError: 'events'

Second error:

Error while setting up platform netatmo

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    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/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/camera/netatmo.py", line 40, in setup_platform
    for camera_name in data.get_camera_names():
  File "/usr/lib/python3.6/site-packages/homeassistant/components/netatmo.py", line 82, in get_camera_names
    self.update()
  File "/usr/lib/python3.6/site-packages/homeassistant/util/__init__.py", line 318, in wrapper
    result = method(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/netatmo.py", line 113, in update
    self.camera_data = pyatmo.CameraData(self.auth, size=100)
  File "/usr/lib/python3.6/site-packages/smart_home/Camera.py", line 50, in __init__
    for e in self.rawData['homes'][i]['events']:
KeyError: 'events'

You Can try this

thanks for reply @gieljnssns I was trying to edit the Camera.py file but I do not find it in Hass.io suggestions?

I’m sorry, I don’t know how to do this with Hassio.
When I’m sure it’s the wright fix I will make a PR to the netatmo-api.

I tried your fix in another installation of home assistant in raspbian scratch and it works perfectly.now I wonder: this fix will be released in the next versions of hassio? I have seen many users have this problem. I prefer to use Hassi instead of home assistant with raspbian scratch

[quote=“gieljnssns, post:7, topic:59173, full:true”]
I’m sorry, I don’t know how to do this with Hassio.
When I’m sure it’s the wright fix I will make a PR to the netatmo-api.
[/quote] @gieljnssns I tried the fix and it works perfectly in more 'installments of home assistant and from what I read also other users have solved with this fix, can you make a request to push?

https://github.com/jabesq/netatmo-api-python/pull/13

Great Job Thanks!