Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netatmo cameras no longer working #15047

Closed
sirdir1972 opened this issue Jun 19, 2018 · 21 comments

Comments

Projects
None yet
7 participants
@sirdir1972
Copy link

commented Jun 19, 2018

Home Assistant release with the issue:
0.71.0

Last working Home Assistant release (if known):
unknown

Operating environment (Hass.io/Docker/Windows/etc.):
ubuntu, native 16.04.4
Component/platform:
https://www.home-assistant.io/components/camera.netatmo/

Description of problem:
I'm not sure whether it coincides with an update home homeassistant or something else, but for a while, my netatmo presence camera doesn't show up in netatmo anymore. Welcome was still OK for a while, not it's gone, too.
Relevant part seems to be:

Jun 19 03:29:48 cs hass[3201]: 2018-06-19 03:29:48 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform netatmo
Jun 19 03:29:48 cs hass[3201]: Traceback (most recent call last):
Jun 19 03:29:48 cs hass[3201]:   File "/usr/local/lib/python3.6/dist-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
Jun 19 03:29:48 cs hass[3201]:     SLOW_SETUP_MAX_WAIT, loop=hass.loop)
Jun 19 03:29:48 cs hass[3201]:   File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
Jun 19 03:29:48 cs hass[3201]:     return fut.result()
Jun 19 03:29:48 cs hass[3201]:   File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
Jun 19 03:29:48 cs hass[3201]:     result = self.fn(*self.args, **self.kwargs)
Jun 19 03:29:48 cs hass[3201]:   File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/camera/netatmo.py", line 41, in setup_platform
Jun 19 03:29:48 cs hass[3201]:     for camera_name in data.get_camera_names():
Jun 19 03:29:48 cs hass[3201]:   File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/netatmo.py", line 84, in get_camera_names
Jun 19 03:29:48 cs hass[3201]:     self.update()
Jun 19 03:29:48 cs hass[3201]:   File "/usr/local/lib/python3.6/dist-packages/homeassistant/util/__init__.py", line 319, in wrapper
Jun 19 03:29:48 cs hass[3201]:     result = method(*args, **kwargs)
Jun 19 03:29:48 cs hass[3201]:   File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/netatmo.py", line 115, in update
Jun 19 03:29:48 cs hass[3201]:     self.camera_data = lnetatmo.CameraData(self.auth, size=100)
Jun 19 03:29:48 cs hass[3201]:   File "/home/pkormann/.homeassistant/deps/lib/python3.6/site-packages/smart_home/Camera.py", line 50, in __init__
Jun 19 03:29:48 cs hass[3201]:     for e in self.rawData['homes'][i]['events']:
Jun 19 03:29:48 cs hass[3201]: KeyError: 'events'
Jun 19 03:29:48 cs hass[3201]: 2018-06-19 03:29:48 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=camera, service=enable_motion_detection>
Jun 19 03:29:48 cs hass[3201]: 2018-06-19 03:29:48 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=camera, service=disable_motion_detection>
Jun 19 03:29:48 cs hass[3201]: 2018-06-19 03:29:48 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=camera, service=snapshot>
Jun 19 03:29:48 cs hass[3201]: 2018-06-19 03:29:48 INFO (MainThread) [homeassistant.setup] Setup of domain camera took 1.3 seconds.
Jun 19 03:29:48 cs hass[3201]: 2018-06-19 03:29:48 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=camera>
Jun 19 03:29:48 cs hass[3201]: 2018-06-19 03:29:48 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform netatmo
Jun 19 03:29:48 cs hass[3201]: Traceback (most recent call last):
Jun 19 03:29:48 cs hass[3201]:   File "/usr/local/lib/python3.6/dist-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
Jun 19 03:29:48 cs hass[3201]:     SLOW_SETUP_MAX_WAIT, loop=hass.loop)
Jun 19 03:29:48 cs hass[3201]:   File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
Jun 19 03:29:48 cs hass[3201]:     return fut.result()
Jun 19 03:29:48 cs hass[3201]:   File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
Jun 19 03:29:48 cs hass[3201]:     result = self.fn(*self.args, **self.kwargs)
Jun 19 03:29:48 cs hass[3201]:   File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/binary_sensor/netatmo.py", line 74, in setup_platform
Jun 19 03:29:48 cs hass[3201]:     if not data.get_camera_names():
Jun 19 03:29:48 cs hass[3201]:   File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/netatmo.py", line 84, in get_camera_names
Jun 19 03:29:48 cs hass[3201]:     self.update()
Jun 19 03:29:48 cs hass[3201]:   File "/usr/local/lib/python3.6/dist-packages/homeassistant/util/__init__.py", line 319, in wrapper
Jun 19 03:29:48 cs hass[3201]:     result = method(*args, **kwargs)
Jun 19 03:29:48 cs hass[3201]:   File "/usr/local/lib/python3.6/dist-packages/homeassistant/components/netatmo.py", line 115, in update
Jun 19 03:29:48 cs hass[3201]:     self.camera_data = lnetatmo.CameraData(self.auth, size=100)
Jun 19 03:29:48 cs hass[3201]:   File "/home/pkormann/.homeassistant/deps/lib/python3.6/site-packages/smart_home/Camera.py", line 50, in __init__
Jun 19 03:29:48 cs hass[3201]:     for e in self.rawData['homes'][i]['events']:
Jun 19 03:29:48 cs hass[3201]: KeyError: 'events'

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

camera:
  platform: netatmo

binary_sensor:
  platform: netatmo
  cameras:
   - Einfahrt
   - Welcome Eingang
  presence_sensors:
  - Outdoor motion
  - Outdoor human
  - Outdoor animal
  - Outdoor vehicle  

netatmo:
  api_key: xxxx
  secret_key: xxxx
  username: xxxx
  password: xxxx
  discovery: no


Traceback (if applicable):


Additional information:

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Jun 19, 2018

Please complete the report with issue template requested information.

@sirdir1972

This comment has been minimized.

Copy link
Author

commented Jun 19, 2018

done

gieljnssns added a commit to gieljnssns/netatmo-api-python that referenced this issue Jun 19, 2018

@gieljnssns

This comment has been minimized.

Copy link
Contributor

commented Jun 19, 2018

You can try to replace this file
/home/pkormann/.homeassistant/deps/lib/python3.6/site-packages/smart_home/Camera.py
by this one:
https://github.com/gieljnssns/netatmo-api-python/blob/camera-fix/smart_home/Camera.py

@sirdir1972

This comment has been minimized.

Copy link
Author

commented Jun 19, 2018

Sems to work flawlessly, couldn't see any error in log and cameras are back up!

@sirdir1972

This comment has been minimized.

Copy link
Author

commented Jun 19, 2018

One thing I just noticed though, when you click on the pic instead of a 'semi life' stream you only get a blue question mark (pic not found?)

@dlawnurg

This comment has been minimized.

Copy link

commented Jun 25, 2018

I copied the file to the folder you mentioned, rebooted, but nothing changed. I still don't see the camera pictures. Maybe I do something wrong? :-(

image

@gieljnssns

This comment has been minimized.

Copy link
Contributor

commented Jun 26, 2018

@dlawnurg
Do you get any errors in the log?
Did you create this folder or did you replace an old camera.py file?

@dlawnurg

This comment has been minimized.

Copy link

commented Jun 26, 2018

Thank you @gieljnssns coming back to me. I created the folder by myself. There was no Camera.py in the the folder before.

Here is the error message I receive:

2018-06-24 22:52:46 ERROR (MainThread) [homeassistant.components.camera] 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 319, 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'
@gieljnssns

This comment has been minimized.

Copy link
Contributor

commented Jun 26, 2018

You Can try to place the camera file in
File "/usr/lib/python3.6/site-packages/smart_home/Camera.py“

@iditude

This comment has been minimized.

Copy link

commented Jul 7, 2018

Hello,

I'm facing the same issue, however I have an error message with the new file.

2018-07-07 12:17:27 ERROR (MainThread) [homeassistant.setup] Error during setup of component netatmo
Traceback (most recent call last):
  File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 146, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/components/netatmo.py", line 46, in setup
    import pyatmo
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pyatmo.py", line 17, in <module>
    from smart_home.Camera import CameraData
  File "/home/pi/homeassistant/lib/python3.5/site-packages/smart_home/Camera.py", line 7
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax

This is my config

netatmo:
  api_key: redacted
  secret_key: redacted
  username: redacted
  password: redacted
  discovery: False

camera:
  - platform: netatmo
    home: Rigaud
    cameras:
      - Salon

Thanks

@gieljnssns

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2018

@iditude
I think you did something wrong, at line 7 in my file there is no <!DOCTYPE html>

@doune

This comment has been minimized.

Copy link

commented Jul 11, 2018

I've the same issue, I've tried the proposed file but I get the following error message :

2018-07-10 16:10:02 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform netatmo
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/binary_sensor/netatmo.py", line 74, in setup_platform
    if not data.get_camera_names():
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/netatmo.py", line 84, in get_camera_names
    self.update()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/__init__.py", line 319, in wrapper
    result = method(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/netatmo.py", line 115, in update
    self.camera_data = lnetatmo.CameraData(self.auth, size=100)
  File "/srv/homeassistant/lib/python3.5/site-packages/smart_home/Camera.py", line 79, in __init__
    self.default_camera = list(self.cameras[self.default_home].values())[0]
IndexError: list index out of range
@gieljnssns

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2018

Try to restart another time…

@doune

This comment has been minimized.

Copy link

commented Jul 11, 2018

@gieljnssns

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2018

@doune I've pushed another commit, can you try the new file?

@doune

This comment has been minimized.

Copy link

commented Jul 11, 2018

it works for me. Thanks !

@Dennydd

This comment has been minimized.

Copy link

commented Jul 12, 2018

i have this error for netatmo in HassOS 1.5 x64

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'
@iditude

This comment has been minimized.

Copy link

commented Jul 14, 2018

@gieljnssns Thanks a lot. This is working well for me.

Apologies for the error earlier, I blindly downloaded your link directly with wget so didn't notice I didn't download the file but the Github page :-)

Cheers

@sirdir1972

This comment has been minimized.

Copy link
Author

commented Jul 14, 2018

@iditude hehe at first I did the same, but usually I look at the file before starting it, so I noticed the mistake.

@Dennydd

This comment has been minimized.

Copy link

commented Jul 14, 2018

@gieljnssns @sirdir1972 I tried to replace the code you suggested in the camera.py file in another installation I made of Home Assistant now everything is working perfectly thanks a lot! Will this fix for the next version of Hassio be released? people complained about this problem

@gieljnssns

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2018

jabesq pushed a commit to jabesq/netatmo-api-python that referenced this issue Jul 17, 2018

@gieljnssns gieljnssns referenced this issue Jul 18, 2018

Merged

Update pyatmo #15540

0 of 8 tasks complete

@ghost ghost added the in progress label Jul 18, 2018

@ghost ghost removed the in progress label Jul 18, 2018

@home-assistant home-assistant locked and limited conversation to collaborators Oct 26, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.