core: Netatmo integration stopped working in 108.9

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.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (13 by maintainers)

Most upvoted comments

@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.

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