New luftdaten component breaks existing configuration

Hi,

after updating from 0.81 to 0.83, the “luftdaten” sensor changed, requiring to update existing configurations. However, there are no instructions how to do so.

My previous configuration was (sensor id hidden):

sensor:
  - platform: luftdaten
    sensorid: 1xxxx
    name: luftdaten_partikel
    show_on_map: true
    monitored_conditions:
      - P1
      - P2
  - platform: luftdaten
    sensorid: 1xxyy
    name: luftdaten_wetter
    monitored_conditions:
      - temperature
      - humidity

New configuration should be (according to docs: https://www.home-assistant.io/components/luftdaten/):

luftdaten:
    sensor_id: 1xxxx
    show_on_map: true
    sensors:
      monitored_conditions:
        - P1
        - P2

Unfortunately there are several problems with that:

  1. unable to configure multiple sensor id’s. This is required as the measuring device has different sensor id’s for particulate matter on one hand, and temperature/humidity on the other hand

  2. optional configuration variable “name” does not work:
    2018-11-30 20:19:05 ERROR (MainThread) [homeassistant.config] Invalid config for [luftdaten]: [name] is an invalid option for [luftdaten]. Check: luftdaten->luftdaten->sensors->name. (See /home/homeassistant/.homeassistant/configuration.yaml, line 141). Please check the docs at https://home-assistant.io/components/luftdaten/

  3. looks like the historic sensor data is lost after migration to the new luftdaten component

  4. component creates duplicate entity ids, see issue: https://github.com/home-assistant/home-assistant/issues/18838

Has someone successfully migrated configuration (and historic data) to new component?

1 Like

Hi @khambrecht

thanks for opening this topic. I wanted to upgrade Hass but saw this breaking change which raised the same questions.
I wrote the first version of this component but it got changed a lot since then (first put into its own Python package and now “integrated” into the frontend configuration wizard). I can’t create a fix for that because I neither understand the architecture of Hass nor the way to do things in Python. Hass is becoming way to complex :smiley:

I hope someone will help us with this. If not I will see if we can take my original code as a custom component.

Cheers!

Should we open one or more issues on Github?

there is already a bug report which covers 1. (multiple sensors) and 4. (duplicate entity ids), however no further action so far:

from my point of view, the new luftdaten component requires a rework to deal with existing installations and migrate data/configuration.

@lichtteil since you are the author of the first version, maybe you should get in touch with the developer.

bug opened: https://github.com/home-assistant/home-assistant/issues/19591