8000 netatmo not working · Issue #37257 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

netatmo not working #37257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
timmornYE opened this issue Jun 30, 2020 · 10 comments · Fixed by #35571
Closed

netatmo not working #37257

timmornYE opened this issue Jun 30, 2020 · 10 comments · Fixed by #35571
Assignees

Comments

@timmornYE
Copy link

The problem

I set up netatmo like described in https://www.home-assistant.io/integrations/netatmo/ in the following steps:

  • no netatmo extension was configured
  • add entries in configuration.yaml
  • restart hass
  • on hass got to settings - integrations and add netatmo extension
  • select "configuration.yaml"
  • restart hass

Until restart all was ok and netatmo says it is configured. But wenn home assistant starts, the exception "Error while setting up netatmo platform for sensor" is thrown and netatmo does not detect my devices.

Environment

Home assistant Version: 0.111.4 running in docker with following docker-compose.yml

version: '2'
services:
    mqtt:
        container_name: mqtt
        image: eclipse-mosquitto:1.5.4
        restart: always
        ports: 
            - 1883:1883
            - 9001
    hassdb:
        container_name: hassdb
        image: mysql
        command: mysqld --default-authentication-plugin=mysql_native_password 
        restart: always
        ports:
            - 3306:3306
        environment:
            MYSQL_ROOT_PASSWORD: 'xxx' 
            MYSQL_DATABASE: 'homeassistant'
            MYSQL_USER: 'hass'
            MYSQL_PASSWORD: 'xxx' 
    homeassistant:
        depends_on:
            - hassdb
            - mqtt
        restart: always
        container_name: hass
        image: homeassistant/home-assistant
        volumes:
            - ./hass-config:/config
            - /etc/localtime:/etc/localtime:ro
        ports:
            - 8123:8123

Problem-relevant configuration.yaml

http:
  base_url: https://myid.ui.nabu.casa

netatmo:
  client_id: myclientid
  client_secret: mysecret

Traceback/Error logs

hass             | 2020-06-30 15:48:04 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up netatmo platform for sensor
hass             | Traceback (most recent call last):
hass             |   File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
hass             |     await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
hass             |   File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
hass             |     return fut.result()
hass             |   File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 146, in async_setup_entry
hass             |     async_add_entities(await hass.async_add_executor_job(get_entities), True)
hass             |   File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
hass             |     result = self.fn(*self.args, **self.kwargs)
hass             |   File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 142, in get_entities
hass             |     entities.extend(find_entities(data))
hass             |   File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 117, in find_entities
hass             |     all_module_infos = data.get_module_infos()
hass             |   File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 545, in get_module_infos
hass             |     return self.station_data.getModules()
hass             |   File "/usr/local/lib/python3.7/site-packages/pyatmo/weather_station.py", line 89, in getModules
hass             |     "module_name": m["module_name"],
hass             | KeyError: 'module_name'

Additional information

@probot-home-assistant
Copy link

netatmo documentation
netatmo source
(message by IssueLinks)

@timmornYE
Copy link
Author
timmornYE commented Jul 2, 2020

Like mentioned by @cgtobi in #35731 I tried to remove and re-add the integration but this didn't solve anything.

@cgtobi
Copy link
Contributor
cgtobi commented Jul 2, 2020

This is a bug that won’t be solved by restarting/re-adding the integration.

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

It contains many fixes.

@timmornYE
Copy link
Author
timmornYE commented Jul 2, 2020

Tested. Followed this instructions after importing custom component. Now I get:

hass             | 2020-07-02 16:57:34 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform netatmo.light: Platform not found (cannot import name 'LightEntity' from 'homeassistant.components.light' (/usr/src/homeassistant/homeassistant/components/light/__init__.py)).
hass             | 2020-07-02 16:57:34 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform netatmo.climate: Platform not found (cannot import name 'ClimateEntity' from 'homeassistant.components.climate' (/usr/src/homeassistant/homeassistant/components/climate/__init__.py)).
hass             | 2020-07-02 16:57:34 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up netatmo platform for sensor
hass             | Traceback (most recent call last):
hass             |   File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
hass             |     await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
hass             |   File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
hass             |     return fut.result()
hass             |   File "/config/custom_components/netatmo/sensor.py", line 154, in async_setup_entry
hass             |     async_add_entities(await get_entities(), True)
hass             |   File "/config/custom_components/netatmo/sensor.py", line 150, in get_entities
hass             |     entities.extend(await find_entities(data_class))
hass             |   File "/config/custom_components/netatmo/sensor.py", line 136, in find_entities
hass             |     module_id=module["_id"]
hass             | KeyError: '_id'

@timmornYE
Copy link
Author

Tried also with home assistant 0.113.0.dev20200702

Here I had the problem that http: base_url was deprecated. I tried to set the URL of nabu.casa in homeassistant: external_url, but when I try to add netatmo Integration, I get to the site where I grant access and when I try to save, I am not redirected to this URL. It tries to access the internet IP of my server, but there is no port open. So it is not successful.

@timmornYE
Copy link
Author

Ok, seems that I have to set internal_url in 0.113, so that I can add netatmo. But now I have the same error again:

hass             | 2020-07-02 20:19:23 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up netatmo platform for sensor
hass             | Traceback (most recent call last):
hass             |   File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
hass             |     await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
hass             |   File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
hass             |     return fut.result()
hass             |   File "/config/custom_components/netatmo/sensor.py", line 154, in async_setup_entry
hass             |     async_add_entities(await get_entities(), True)
hass             |   File "/config/custom_components/netatmo/sensor.py", line 150, in get_entities
hass             |     entities.extend(await find_entities(data_class))
hass             |   File "/config/custom_components/netatmo/sensor.py", line 136, in find_entities
hass             |     module_id=module["_id"]
hass             | KeyError: '_id'

@cgtobi
Copy link
Contributor
cgtobi commented Jul 2, 2020

Please increase the log level for the Netatmo integration to debug so we can see where it's failing. Feel free to contact me on the forums or on Discord if you want to share that data more privately.

@timmornYE
Copy link
Author

Replaced private data with "..."

Logs while adding component:

It shows that my weatherstation is found. But to the homeassistant.components.sensor exception I do not get more data.

hass             | 2020-07-03 09:17:25 INFO (MainThread) [custom_components.netatmo.config_flow] Successfully authenticated
hass             | 2020-07-03 09:17:25 DEBUG (MainThread) [custom_components.netatmo.data_handler] Data class CameraData added
hass             | 2020-07-03 09:17:26 DEBUG (SyncWorker_5) [custom_components.netatmo.pyatmo.auth] addwebhook: {'status': 'ok', 'time_exec': 0.03019404411315918, 'time_server': 1593760646}
hass             | 2020-07-03 09:17:26 INFO (MainThread) [custom_components.netatmo] Register Netatmo webhook: https://hooks.nabu.casa/...
hass             | 2020-07-03 09:17:26 DEBUG (MainThread) [custom_components.netatmo.webhook] Got webhook data: {'user_id': '...', 'user': {'id': '...', 'email': '...'}, 'push_type': 'webhook_activation'}
hass             | 2020-07-03 09:17:26 INFO (MainThread) [custom_components.netatmo.data_handler] Netatmo webhook successfully registered
hass             | 2020-07-03 09:17:27 DEBUG (MainThread) [custom_components.netatmo.data_handler] Data class WeatherStationData added
hass             | 2020-07-03 09:17:27 DEBUG (MainThread) [custom_components.netatmo.sensor] Adding module Innen 70:ee:50:5f:56:80
hass             | 2020-07-03 09:17:27 DEBUG (MainThread) [custom_components.netatmo.sensor] Adding module None None
hass             | 2020-07-03 09:17:27 DEBUG (MainThread) [custom_components.netatmo.data_handler] Data class HomeData added
hass             | 2020-07-03 09:17:27 DEBUG (MainThread) [custom_components.netatmo.data_handler] Data class HomeData removed
hass             | 2020-07-03 09:17:27 DEBUG (MainThread) [custom_components.netatmo.data_handler] Data class CameraData removed

Restart:

hass             | 2020-07-03 09:37:06 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.netatmo
hass             | 2020-07-03 09:37:09 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.unifi
hass             | 2020-07-03 09:37:09 DEBUG (MainThread) [custom_components.netatmo.data_handler] Data class CameraData added
hass             | 2020-07-03 09:37:11 DEBUG (MainThread) [custom_components.netatmo.data_handler] Data class WeatherStationData added
hass             | 2020-07-03 09:37:11 DEBUG (MainThread) [custom_components.netatmo.sensor] Adding module Innen 70:ee:50:5f:56:80
hass             | 2020-07-03 09:37:11 DEBUG (MainThread) [custom_components.netatmo.sensor] Adding module None None
hass             | 2020-07-03 09:37:11 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up netatmo platform for sensor
hass             | Traceback (most recent call last):
hass             |   File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
hass             |     await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
hass             |   File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
hass             |     return fut.result()
hass             |   File "/config/custom_components/netatmo/sensor.py", line 154, in async_setup_entry
hass             |     async_add_entities(await get_entities(), True)
hass             |   File "/config/custom_components/netatmo/sensor.py", line 150, in get_entities
hass             |     entities.extend(await find_entities(data_class))
hass             |   File "/config/custom_components/netatmo/sensor.py", line 136, in find_entities
hass             |     module_id=module["_id"]
hass             | KeyError: '_id'
hass             | 2020-07-03 09:37:11 DEBUG (MainThread) [custom_components.netatmo.data_handler] Data class HomeData added
hass             | 2020-07-03 09:37:11 DEBUG (MainThread) [custom_components.netatmo.data_handler] Data class HomeData removed
hass             | 2020-07-03 09:37:11 DEBUG (MainThread) [custom_components.netatmo.data_handler] Data class CameraData removed
hass             | 2020-07-03 09:37:12 DEBUG (SyncWorker_3) [custom_components.netatmo.pyatmo.auth] addwebhook: {'status': 'ok', 'time_exec': 0.01427912712097168, 'time_server': 1593761831}
hass             | 2020-07-03 09:37:12 INFO (MainThread) [custom_components.netatmo] Register Netatmo webhook: https://hooks.nabu.casa/...
hass             | 2020-07-03 09:37:12 DEBUG (MainThread) [custom_components.netatmo.webhook] Got webhook data: {'user_id': '...', 'user': {'id': '...', 'email': '...'}, 'push_type': 'webhook_activation'}
hass             | 2020-07-03 09:37:12 INFO (MainThread) [custom_components.netatmo.data_handler] Netatmo webhook successfully registered

@timmornYE
Copy link
Author

Strange... restartet today again, error gone, and all is running. I did nothing but trying the ~ 20th restart.

@cgtobi
Copy link
Contributor
cgtobi commented Jul 9, 2020

This should be fixed in the latest release of the custom component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0