Error while setting up netatmo platform for sensor KeyError: 'station_name'

I’ve had this error for at least a month now, with no change after the latest HA update.

The base station has a name even though the error msg points to it being wrong or missing.

The culprit can be my outdoor module as it is broken and therefore disconnected. It has worked with just the base station in the past so I dunno…

Error while setting up netatmo platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 193, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 160, in async_setup_entry
    async_add_entities(await find_entities(data_class_name), True)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 151, in find_entities
    NetatmoSensor(data_handler, data_class_name, module, condition)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 248, in __init__
    self._device_name = module_info["station_name"]
KeyError: 'station_name'

The integration just shows the logo and name like this:

## Netatmo

### Home Assistant Cloud

with no detected devices.

System Health

|arch|x86_64|
| --- | --- |
|chassis|embedded|
|dev|false|
|docker|true|
|docker_version|19.03.11|
|hassio|true|
|host_os|HassOS 4.13|
|installation_type|Home Assistant OS|
|os_name|Linux|
|os_version|5.4.63|
|python_version|3.8.5|
|supervisor|247|
|version|0.116.2|
|virtualenv|false|

Thanks ppl :wink:

This will soon be fixed. It is already merged upstream, I am just waiting for a new release of pyatmo and then I’ll be available in HA shortly.

Good news! Thanks:)

2020-10-15 21:29:44 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class HomeData added
2020-10-15 21:29:44 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class WeatherStationData added
2020-10-15 21:29:44 DEBUG (MainThread) [homeassistant.components.netatmo.sensor] Adding module Sypialnia 70:ee:b6:e2:c2:92
2020-10-15 21:29:44 DEBUG (MainThread) [homeassistant.components.netatmo.sensor] Adding module Outdoor 02:70:1z:3f:8c:23
2020-10-15 21:29:44 DEBUG (MainThread) [homeassistant.components.netatmo.sensor] Adding module Deszcz 05:00:70:05:g9:eb
2020-10-15 21:29:44 DEBUG (MainThread) [homeassistant.components.netatmo.sensor] Adding module Salon 03:00:70:t8:89:c4
2020-10-15 21:29:44 DEBUG (MainThread) [homeassistant.components.netatmo.sensor] Adding module Piwnica 70:ee:70:ce:22:43
2020-10-15 21:29:44 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 193, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 160, in async_setup_entry
    async_add_entities(await find_entities(data_class_name), True)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 151, in find_entities
    NetatmoSensor(data_handler, data_class_name, module, condition)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 248, in __init__
    self._device_name = module_info["station_name"]
KeyError: 'station_name'

Home Assistant 0.116.3
Still the same error
This version 116.3 does not fix the error ?

You’re correct. :wink: