dolezsa / thermal_comfort

Thermal Comfort sensor for HA (absolute humidity, heat index, dew point, thermal perception)
Other
593 stars 111 forks source link

[Question] Possible to create virtual thermal_comfort devices via YAML configuration? #289

Open coreuter opened 1 year ago

coreuter commented 1 year ago

Hi there!

Is it possible to create virtual devices via the YAML configuration, just like when configuring the integration via the UI?

Currently, the following YAML configuration creates the 15 sensors, but the corresponding virtual device is missing.

- custom_icons: true # global option for the entry
  sensor:
    - name: office 1
      poll: true
      temperature_sensor: sensor.dht22_office_1_temperature
      humidity_sensor: sensor.dht22_office_1_humidity
      unique_id: thermal_comfort_office_1
    # ...

One virtual device per configuration entry would be very helpful, e.g. for assigning an area. Currently it takes 3 x 15 x <number of configuration entries> clicks to assign an area to all YAML-defined thermal comfort sensors via the UI - in my current setup this would be 360 clicks. Although it is also possible to set the area directly in the core.entity_registry, there are still 120 entries that would have to be adjusted in my case. With virtual devices there would only be 8 entries to adjust.

Is there an error in my configuration or does the YAML setup behave differently to the UI setup? Thank you very much!

rautesamtr commented 1 year ago

YAML does not support devices since we need a config entry. https://developers.home-assistant.io/docs/device_registry_index/#defining-devices