Core: Netatmo integration stopped working in 108.9

Created on 29 Apr 2020  路  17Comments  路  Source: home-assistant/core

The problem


Netatmo integration stopped working in 108.9
After upgrading from 108.5 to 108.9 the Netatmo sensors where marked as unavailable. As suggested on the forum I removed the integration, restarted and added the integration again.
The integration added ok, but it can not find any sensors.

Environment

arch | x86_64
-- | --
dev | false
docker | true
hassio | true
os_name | Linux
os_version | 4.15.0-91-generic
python_version | 3.7.7
timezone | Europe/Stockholm
version | 0.108.9
virtualenv | false

  • Home Assistant Core release with the issue:
    108.9
  • Last working Home Assistant Core release (if known):
    108.5
  • Operating environment (Home Assistant/Supervised/Docker/venv):
    Hassio on Intel NUC
  • 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: !secret netatmo_api_key
  client_secret: !secret netatmo_secret_key

Traceback/Error logs

2020-04-28 18:21:18 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 545, 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'

Additional information

I should mention that I have a Netatmo setup with two base stations.

bug netatmo

All 17 comments

netatmo documentation
netatmo source
(message by IssueLinks)

Please check again with 0.109. If this is still an issue we need to dig deeper.

Same problem also with 109.0:

2020-04-29 21:10:31 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'

Ok, I need some more data to work with. Please check this guide to gather some detailed information about your setup and what's returned by the API.

Feel free to contact me privately via Discord or the forums.

is there an update on this issue I can provide data if required?

So far, testable data has been provided and most likely the issue has been resolved.

An upstream PR is open for review. https://github.com/jabesq/netatmo-api-python/pull/109

@matthewcky2k feel free to contact me via Discord or the forum if you want/can test it with your HA instance.

Please take a look at the pre-release custom component: https://community.home-assistant.io/t/testers-wanted-netatmo-integration/203729

It contains a fix that should solve the issue.

@cgtobi Can you please point me at how to install this as opposed to the standard netatmo: in configuration.yaml The repo in this link also says it is behind.
https://community.home-assistant.io/t/testers-wanted-netatmo-integration/203729

I had netatmo working well until these recent HA version and would love to get it back

The official integration should work fine. What is your issue?

@cgtobi Since HA version 0.115.0 the netatmo integration stopped working.
The platform/integration was originally installed with username & password and had a sensor section

netatmo:
  username: mynetatmouser
  password: mynetatmopw
sensor:
  - platform: netatmo
    station: PondWeather
    modules:
     - PondOutsideClimate
     - PondIndoorClimate

Then the change no longer supports username/password so I switched to client_id & client_secret and also had to remove the sensors section as this causes the following error.

[homeassistant.components.sensor] The netatmo platform for the sensor integration does not support platform setup. Please remove it from your config.

And ever since, my sensors show as unavailable, but I see no other errors in the logs and the integration does not show anywhere in HA WebUI to do any further configuration.
[homeassistant.components.sensor] The netatmo platform for the sensor integration does not support platform setup. Please remove it from your config.

Just to clarify, I am running HA in a container.

@hipitihop Please check if the sensor name has changed.

@cgtobi Checked. All sensors under the name netatmo are unavailable.

image

Please clean up your configuration.

This is not supported anymore.

sensor:
  - platform: netatmo
    station: PondWeather
    modules:
     - PondOutsideClimate
     - PondIndoorClimate

Further, Netatmo has server issues which caused errors for lots of users.

@cgtobi sorry bad copy paste, the actual configuration.yaml entry is:

netatmo:
  client_id: myid
  client_secret: mysecret

Just to be clear, this is what I am running and my original sensors/web cards still show them as unavailable and I see no new discovered entities.

@cgtobi Let me know if there is anything you need me to test and provide any logs (tell me what and how to get). Or do you have other suggestions ? My integration is still not working.

Did you try to reload the integration or remove it and add it back after restarting HA?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kirichkov picture kirichkov  路  3Comments

sogeniusio picture sogeniusio  路  3Comments

missedtheapex picture missedtheapex  路  3Comments

Konstigt picture Konstigt  路  3Comments

Elmardus picture Elmardus  路  3Comments