home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.81k stars 30.51k forks source link

Cannot configure multiple luftdaten sensors in yaml #32739

Closed twsl closed 3 years ago

twsl commented 4 years ago

The problem

I would like to add multiple luftdaten sensors to my HA. Multiple luftdaten sensors cannot be configured via the yaml template. Adding them via the UI is possible. Attempting the same in yaml results in only the latest config being imported.

Environment

Problem-relevant configuration.yaml

luftdaten:
  sensor_id: XXXXX
  show_on_map: true
  sensors:
    monitored_conditions:
      - temperature
      - humidity

luftdaten:
  ### air
  sensor_id: XXXXXX
  show_on_map: true
  sensors:
    monitored_conditions:
      - P1
      - P2

Traceback/Error logs

None, simply overwritten

Additional information

probot-home-assistant[bot] commented 4 years ago

Hey there @fabaff, mind taking a look at this issue as its been labeled with a integration (luftdaten) you are listed as a codeowner for? Thanks!

twsl commented 4 years ago

The warning btw is:

2020-03-16 22:04:57 WARNING (SyncWorker_0) [homeassistant.util.yaml.loader] YAML file /config/packages/luftdaten.yaml contains duplicate key "luftdaten". Check lines 2 and 11.
2020-03-16 22:04:57 WARNING (SyncWorker_0) [homeassistant.util.yaml.loader] YAML file /config/packages/luftdaten.yaml contains duplicate key "luftdaten". Check lines 11 and 19.
stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ofalvai commented 4 years ago

It's still relevant

DanielXYZ2000 commented 4 years ago

Hi, Use the integration feature - that should work. Anyway for the config I think you need to configure like this:

` luftdaten:

stefferber commented 3 years ago

First, I had the same issue. But you can add two "Luftdaten" Integrations for two sensors. That is working fine. Therefore, I don't think that this feature request is valid. There is nothing additional you can specify in the yaml file. Maybe you add the "how-to" in the documentation that multiple sensor integrations are possible. I did not find it myself...

mpasternacki commented 3 years ago

Providing a list of dictionaries as config doesn't work:

luftdaten:
- sensor_id: 1
  show_on_map: true
  scan_interval: 900
- sensor_id: 2
  show_on_map: true
  scan_interval: 900

ha core check returns an error: Invalid config for [luftdaten]: expected a dictionary for dictionary value @ data['luftdaten']. Got [OrderedDict([('sensor_id', 1), ('show_on_map', True), ('scan_interval', 900)]), OrderedDict([('sensor_id', 2), ('show_on_map', True), ('scan_interval', 900)])]. (See /config/configuration.yaml, line 93).

I want to keep all my configuration in version-controlled files, not managed from UI. If something that's possible in UI can't be done in YAML, it seems like a bug to me.

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ronron261 commented 3 years ago

Did you find a solution for this? I have the same errors like you have greetings Ronald

frenck commented 3 years ago

The Luftdaten YAML configuration has been deprecated for Home Assistant 2021.6 and is pending removal.

See #50365