Home Assistant release with the issue:
0.83
Last working Home Assistant release (if known):
0.81
Operating environment (Hass.io/Docker/Windows/etc.):
Linux/CentOS with python 3.6 in venv
Component/platform:
Luftdaten: https://www.home-assistant.io/components/luftdaten/
Description of problem:
the new luftdaten component has several issues. This breaks existing configurations with previous (simple) luftdaten sensor available up to version 0.81 (or 0.82, not sure).
unable to configure multiple sensor id’s. This is required as some measuring devices have different sensor id’s for particulate matter on one hand, and temperature/humidity on the other hand
optional configuration variable “name” does not work
looks like the historic sensor data is lost after migration to the new luftdaten component
component creates duplicate entity ids, this is already reported in issue #18838
Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
this yaml shows configuration for new luftdaten component, according to docs, with invalid configuration variable "name":
luftdaten:
sensor_id: 1xxxx
name: mysensor
show_on_map: true
sensors:
monitored_conditions:
- P1
- P2
Traceback (if applicable):
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/
Additional information:
for reference, previous yaml configuration (up to v0.81) was:
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
with the new luftdaten component it looks like there is no way to configure multiple sensors. Also, as the entities have changed, it looks like the historic sensor data is lost. Unfortunately the docs do not provide a way how to migrate luftdaten sensors to luftdaten component.
As a side note, it's pretty hard to figure out which configuration key has been changed between which versions, e.g. sensorid => sensor_id. That's not just a problem with the Luftdaten component but rather with the docs, but still annoying.
Well, that was mentioned in the release note as breaking change. Multiple sensor can be configured with the frontend.
unable to configure multiple sensor id’s. This is required as some measuring devices have different sensor id’s for particulate matter on one hand, and temperature/humidity on the other hand
The config flow allows you to define as many sensors as you like.
optional configuration variable “name” does not work
As we want to move away from the YAML-based configuration should this be done in the frontend as well. Docs are out-dated (https://github.com/home-assistant/home-assistant.io/commit/917bddc3bfabb2f90c9c2262eca2abdf671a7ff5).
looks like the historic sensor data is lost after migration to the new luftdaten component
As the data is still available it's a matter of minutes to update the existing data in the DB.
component creates duplicate entity ids, this is already reported in issue #18838
This was mentioned in the release notes as well.
@mattsches, the whole configuration was migrated to the config flow which was mentioned in the release notes. Feel free to contribute to the docs to improve them.
Had to wait until issue #19622 was resolved, which is the case with recent release 0.85.0
Mentioning the luftdaten component with config flow as a breaking change is fine, but imho this is not enough. The corresponding docs should then also provide a way how to deal with existing installations. Honestly, I was not aware that this require to remove the existing config section and reconfigure the sensors via frontend (as manual configuration does not really work, see below).
And it's still unclear to me how to get back the historic sensor data (e.g. what and how to update in the DB).
Anyway, I tried to configure the sensors via config flow fronted. This works somehow but I'm not really happy with that. As already mentioned, most Luftdaten devices will report their sensor data via different sensor ID's (e.g. particulate matter vs. temperature/humidity). But when configuring luftdaten via config flow this will result in integrations with entities for all possible sensor values and not only the actual reported values. In case of my device, I now have two integrations, both with entities for P1, P2, temperature, humidity and pressure (btw. my devices does not have a pressure value at all, so this is useless). It should be possible to select the desired values per sensor.
Manual configuration in configuration.yaml currently does not make sense. Not only it's not possible to configure multiple sensors, the issue #18838 is still not resolved (even though it's status is set to closed). Either these manual configuration issues should get fixed, or remove the option for configuration in configuration.yaml at all (but then allow to select the desired values).
I've experienced the same issue with my sensor - in order to read all the values for p2.5/10, humidity, temp, etc. I had to configure two integrations as the the two sensors sds11 and bme280 are registered with two separate ids in luftdaten. As a result I've two duplicated integrations with few non-functional sensors in each of them.
I don't mind whether i configure the integration through the UI or through yaml, but it would be great if the ui is a bit more flexible. I love the new lovelace ui, though I have it in yaml mode as i prefer having my configuration version controlled.
instead of doing 2 'luftdaten' integrations wouldn't it be better to have that does two api calls?
during configuration we could optionally set the sds11 id and the bme280 id and depending on which ones are set the sensor states/values can be updated.
Was addressed with https://github.com/home-assistant/home-assistant/pull/20643
Most helpful comment
I've experienced the same issue with my sensor - in order to read all the values for p2.5/10, humidity, temp, etc. I had to configure two integrations as the the two sensors sds11 and bme280 are registered with two separate ids in luftdaten. As a result I've two duplicated integrations with few non-functional sensors in each of them.
I don't mind whether i configure the integration through the UI or through yaml, but it would be great if the ui is a bit more flexible. I love the new lovelace ui, though I have it in yaml mode as i prefer having my configuration version controlled.