File “/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py”, line 120, in find_entities
for module_id in data_class.get_modules(station_id):
File “/usr/local/lib/python3.8/site-packages/pyatmo/weather_station.py”, line 88, in get_modules
“station_name”: station[“station_name”],
KeyError: ‘station_name’
I assume you’re webhook is not setup correctly. Please check the dev portal if it is banned. Also check if your internal and external URLs are set correctly.
@cgtobi thank you for your reply and the support you are giving. It is much appreciated. You are right, when I set it up it was not yet visible, but in the meantime the webhook got banned. Now I need to figure out what led to the banning. I have now unbanned the connection.
On the Home Assistant side, I tried to unregister the webhook, cleared my log file, restarted the Home Assistant and registered the webhook using the developer tools.
The following was logged:
2020-10-11 08:28:17 INFO (MainThread) [homeassistant.components.netatmo] Register Netatmo webhook: https://www.myaddress.duckdns.org/api/webhook/SomeLongHexValue
2020-10-11 08:28:17 INFO (MainThread) [homeassistant.components.light] Setting up light.netatmo
2020-10-11 08:28:17 WARNING (MainThread) [homeassistant.components.light] Platform netatmo not ready yet. Retrying in 30 seconds.
2020-10-11 08:28:28 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2947961904] Handler is already defined!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 138, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1335, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1370, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/netatmo/__init__.py", line 148, in register_webhook
webhook_register(
File "/usr/src/homeassistant/homeassistant/components/webhook/__init__.py", line 36, in async_register
raise ValueError("Handler is already defined!")
ValueError: Handler is already defined!
I have masked my duckdns address, which in reality matches the ones in the system settings and the long string after /webhook/ assuming this will lead to my netatmo account.
This is my URL setup. Next to the .org I have not identified an additional port.
I’m getting the same type of error using 0.116.2, I am using the :
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’
Enter it inside the homeassistant container in portainer, if you’re running Hassio.
Found the solution in a github comment on some pretty random issue, by cgtobi, about 2 weeks into researching how to get my new Netatmo weather station to work with HA. (Never give up!?) It seems this only hits very few, probably new users in the latest versions, without an old sensor config?
Hi,
I updated to 0.117.3 yesterday and after that the Netatmo sensors have been displayed. To me it looks like they report the current value as soon as the system starts but after that the status is not updated anymore. In the admin view the sensors are display as unavailable, but the glance card shows values from the time the system started.
Additionally I see the following entry in the log:
Logger: homeassistant.components.sensor
Source: components/netatmo/data_handler.py:117
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 8:40:55 (1 occurrences)
Last logged: 8:40:55
Error while setting up netatmo platform for sensor
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 197, in _async_setup_platform await asyncio.shield(task) File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 227, in async_setup_entry await add_public_entities(False) File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 201, in add_public_entities await data_handler.register_data_class( File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 149, in register_data_class await self.async_fetch_data( File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 117, in async_fetch_data self.data[data_class_entry] = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) TypeError: __init__() got an unexpected keyword argument 'LAT_NE'´
This is the public weather sensors that is broken. If you don’t rely on other fixes in 0.117.3 you can downgrade to 0.117.2 for now. A fix is already submitted.