8000 Netamo is not working · Issue #35731 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Netamo is not working #35731

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

Closed
afaucogney opened this issue May 17, 2020 · 8 comments
Closed

Netamo is not working #35731

afaucogney opened this issue May 17, 2020 · 8 comments

Comments

@afaucogney
Copy link
Contributor

The problem

The Netatmo integration doesn't work after HA update. I only use the Weather Station. I was working for a long time. Early, I update to the latest version and it doesn't work anymore

Environment

  • Home Assistant Core release with the issue: Home Assistant 0.109.6
  • Last working Home Assistant Core release (if known):
  • Operating environment (Home Assistant/Supervised/Docker/venv): Home Assistant
  • Integration causing this issue: Netatmo
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/netatmo

Problem-relevant configuration.yaml

netatmo:
  client_id: YOUR_CLIENT_ID
  client_secret: YOUR_CLIENT_SECRET

Traceback/Error logs

2020-05-16 12:25:36 ERROR (MainThread) [homeassistant.components.camera] Error while setting up netatmo platform for camera
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pyatmo/auth.py", line 129, in query
    rsp = self._oauth.post(url=url, data=params, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 578, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 478, in request
    url, http_method=method, body=data, headers=headers
  File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 198, in add_token
    raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired) 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/src/homeassistant/homeassistant/components/netatmo/camera.py", line 65, in async_setup_entry
    async_add_entities(await hass.async_add_executor_job(get_entities), True)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/camera.py", line 53, in get_entities
    for camera in camera_data.get_all_cameras():
  File "/usr/src/homeassistant/homeassistant/components/netatmo/camera.py", line 237, in get_all_cameras
    self.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/camera.py", line 261, in update
    self.camera_data = pyatmo.CameraData(self.auth, size=100)
  File "/usr/local/lib/python3.7/site-packages/pyatmo/camera.py", line 30, in __init__
    resp = self.authData.post_request(url=_GETHOMEDATA_REQ, params=postParams)
  File "/usr/local/lib/python3.7/site-packages/pyatmo/auth.py", line 143, in post_request
    resp = query(url, params, timeout, 3)
  File "/usr/local/lib/python3.7/site-packages/pyatmo/auth.py", line 137, in query
    self._oauth.token = self.refresh_tokens()
  File "/usr/src/homeassistant/homeassistant/components/netatmo/api.py", line 32, in refresh_tokens
    self.session.async_ensure_token_valid(), self.hass.loop
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 435, in result
    return self.__get_result()
  File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 413, in async_ensure_token_valid
    new_token = await self.implementation.async_refresh_token(self.token)
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 78, in async_refresh_token
    new_token = await self._async_refresh_token(token)
  File "/usr/src/homeassistant/homeassistant/components/cloud/account_link.py", line 143, in _async_refresh_token
    self.hass.data[DOMAIN], self.service, token["refresh_token"]
  File "/usr/local/lib/python3.7/site-packages/hass_nabucasa/account_link.py", line 112, in async_fetch_access_token
    resp.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 946, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='https://account-link.nabucasa.com/refresh_token/netatmo

And

2020-05-16 12:31:48 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up netatmo platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 146, in async_setup_entry
    async_add_entities(await hass.async_add_executor_job(get_entities), True)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 142, in get_entities
    entities.extend(find_entities(data))
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 117, in find_entities
    all_module_infos = data.get_module_infos()
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 552, in get_module_infos
    return self.station_data.getModules()
  File "/usr/local/lib/python3.7/site-packages/pyatmo/weather_station.py", line 89, in getModules
    "module_name": m["module_name"],
KeyError: 'module_name'
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse temperature sensor sensor.netatmo_module_exterieur_temperature with state: unavailable
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse temperature sensor sensor.netatmo_module_exterieur_temperature with state: unavailable
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse temperature sensor sensor.temperature_158d000231f0a2 with state: unavailable
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse temperature sensor sensor.netatmo_module_exterieur_temperature with state: unavailable
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse humidity sensor sensor.humidity_158d000231f0a2, state: unavailable
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse temperature sensor sensor.netatmo_module_exterieur_temperature with state: unavailable
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse temperature sensor sensor.netatmo_module_exterieur_temperature with state: unavailable
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse temperature sensor sensor.netatmo_indoor_temperature with state: unavailable
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse temperature sensor sensor.netatmo_module_exterieur_temperature with state: unavailable
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse humidity sensor sensor.netatmo_indoor_humidity, state: unavailable
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse temperature sensor sensor.netatmo_module_exterieur_temperature with state: unavailable
2020-05-16 12:32:01 ERROR (MainThread) [homeassistant.components.mold_indicator.sensor] Unable to parse temperature sensor sensor.netatmo_module_exterieur_temperature with state: unavailable

Additional information

I did not had any camera (and never owned a single one)

@probot-home-assistant
Copy link

Hey there @cgtobi, mind taking a look at this issue as its been labeled with a integration (netatmo) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@cgtobi
Copy link
Contributor
cgtobi commented May 17, 2020

Quick fix, remove and re-add the integration.

@cgtobi
Copy link
Contributor
cgtobi commented May 18, 2020

The second issue KeyError: 'module_name' is fixed in the latest beta.

@cgtobi
Copy link
Contributor
cgtobi commented Jun 28, 2020

Is this fixed?

@cgtobi
Copy link
Contributor
cgtobi commented Jul 9, 2020

I'd kindly ask you to take a look at the pre-release custom component: https://community.home-assistant.io/t/testers-wanted-netatmo-integration/203729

It contains many fixes and I would be very interested if the issue persists.

@cgtobi cgtobi mentioned this issue Jul 29, 2020
20 tasks
@stale
Copy link
stale bot commented Oct 12, 2020

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 12, 2020
@cgtobi
Copy link
Contributor
cgtobi commented Oct 12, 2020

The common thing across many issues on this topic is the use of the cloud link. Apparently Netatmo is having issues with their back end which may cause timeouts. We've contacted them in the hope that this will be fixed soon.

In the meantime I have to suggest to create/use your own individual dev account over at dev.netatmo.com.

8000

@stale stale bot removed the stale label Oct 12, 2020
@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0