Core: Netatmo component -> discovery:false -> doesn't work

Created on 24 Apr 2019  路  6Comments  路  Source: home-assistant/core

Homeassistant 0.91.4

Last working Home Assistant release (if known):
none

Operating environment (Hass.io/Docker/Windows/etc.):

Raspbian

Component/platform:

Netatmo.sensor

Description of problem:

if I set discovery to false, the IA doesn't show any of the sensors listed in my sensor section. The HA trace back goes on regurarly without any error.
If I set discovery to true, the IA show me all my sensors with all details

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

configuration.yaml

netatmo:
  api_key: !secret netatmo_apikey
  secret_key: !secret netatmo_secretkey
  username: !secret netatmo_username
  password: !secret netatmo_password
  discovery: false

sensor.yaml

- platform netatmo
  station: home
  modules:
    anemometer:
      - windangle
      - windstrength
      - battery_vp
      - battery_percent
      - gustangle
      - guststrength
      - rf_status

Traceback (if applicable):
No errors in traceback

Additional information:
None

netatmo

Most helpful comment

pyatmo 2.1.1 is out. Feel free to test https://github.com/home-assistant/home-assistant/pull/24902

All 6 comments

I have the same config than yours with discovery set to false and it's working good. Are you sure that the weather station and module names are correct in your configuration ?

This should be fixed in #24788.

@cgtobi are you sure this is fixed?

Because after updating from 0.95.0 to 0.95.3 it broke for me, so I kind of guess your fix caused some problems.

When starting HA, I get the following error:

Error while setting up platform netatmo
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  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 161, in setup_platform
    dev.extend(find_devices(data))
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 177, in find_devices
    data, module_name, condition.lower(), data.station))
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 199, in __init__
    self._module_type = module['type']
TypeError: 'NoneType' object is not subscriptable

I have multiple stations in my Netatmo account but only want to have a specific one tracked by HA:

Component:

netatmo:
    api_key: !secret netatmo_api_key
    secret_key: !secret netatmo_secret_key
    username: !secret netatmo_username
    password: !secret netatmo_password
    discovery: false

and Sensor

- platform: netatmo
  station: Berlin

This config has been working fine since quite a long time and I never had to touch it. The docs also say that the modules entry in the sensor config is optional, so I guess this should be still a valid config.

@sibbl Thanks for reporting this issue. I haven't tested "partial" configuration but I'll take a look.

@sibbl The issue is caused by the upstream python module and has been fixed. I'll let you know once its new release is out.

pyatmo 2.1.1 is out. Feel free to test https://github.com/home-assistant/home-assistant/pull/24902

Was this page helpful?
0 / 5 - 0 ratings