core: Netatmo, second base station (probably) causing error setting up platform

The problem

After adding a second base station to my netatmo account, the new station didn’t show up automatically. After removing and adding the integration I get the below error.

Environment

  • Home Assistant Core release with the issue: 0.116.2
  • Last working Home Assistant Core release (if known): 0.116.2
  • Operating environment (OS/Container/Supervised/Core): Core
  • Integration causing this issue: Netatmo
  • Link to integration documentation on our website: …

Problem-relevant configuration.yaml

Didn't change the config of this integration :)

Traceback/Error logs

Logger: homeassistant.components.sensor
Source: components/netatmo/sensor.py:252
Integration: Sensor (documentation, issues)
First occurred: 11:34:25 (2 occurrences)
Last logged: 14:26:09

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 159, in async_setup_entry
    async_add_entities(await find_entities(data_class_name), True)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 150, in find_entities
    NetatmoSensor(data_handler, data_class_name, module, condition)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 252, in __init__
    f"{MANUFACTURER} {self._device_name} {SENSOR_TYPES[sensor_type][0]}"
KeyError: 'temp_trend'

Additional information

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 48 (20 by maintainers)

Most upvoted comments

You can try the fix:

ssh <your_instance>
docker exec -it $(docker ps -f name=homeassistant -q) bash
pip install --upgrade https://github.com/cgtobi/netatmo-api-python/releases/download/v4.1.0b1/pyatmo-4.1.0-py3-none-any.whl

That has nothing to do with this issue but I talked to Netatmo today and now I know where those issues come from at least.

Ok, I’ll take a look.

I was referring to the iOS app from Netatmo.

I am now

Here also interested in the unofficial release 😃

Sure, I would give it a shot if it can easily be removed once the official release comes out.

@cgtobi, not sure if it helps but I downloaded the test script (gen_test_data.py) you mentioned in a parallel thread on what seems to be the same or very similar issue. I can confirm that the script returns the same error as the HA integration:

Checking for available weather stations...
Traceback (most recent call last):
  File "gen_test_data.py", line 124, in <module>
    (i, s["station_name"]) for i, s in weather_data.stations.items()
  File "gen_test_data.py", line 124, in <listcomp>
    (i, s["station_name"]) for i, s in weather_data.stations.items()
KeyError: 'station_name'

To rule out issues on Netatmo API side, I downloaded their Swagger file and using the same authentication method as the integration, I tested the getstationsdata method - which was successful. Let me know if the response I get with Swagger would help you with debugging.

Since I dont know Python well enough to be of much help, I bought you a couple of coffees 😉