Many sensors one thermostat

Hi,
I have 3 sensors (living_room, bed_room, bath_room) and one switch (heatter_switch). I want to select whatever sensor I want to maintain the temperature for that room. I have played with climate but it is hard for me to make it work. Please, one example will be greate. Thank you.

I assume you mean the Generic Thermostat, yes?

What I would do is to create an Input Select with options for the three rooms. Then I’d create a Template Sensor that uses the value from the sensor selected by the input_select. And then I’d use that template sensor for generic thermostat’s target_sensor.

If you need a concrete example, let me know.

3 Likes

Thank you pnbrucker! It works great but I have one problem. Now I have Generic Thermostat and Input Select in different places on my page. How I can group them toghether? I have all configuration split into many files and folders (not in a single file ). Maybe group.yaml will do the trick.

Not exactly sure what you mean. Are you asking how to place the entities in the frontend (i.e, the UI)? Or are you talking about where to put the configuration items in your YAML files? Assuming the latter, I’d suggest putting them in a package. I almost exclusively use packages.

Yes, I try to make one entity from Generic Thermostat and Input Select. I will try with package to see what I can do.
Thank you for your help!

I have a problem with putting all into packages. This is what I made:
I have created a “packages” folder then create a thermostat.yaml file with that content:

input-select:
  thermostat_target:
    name: "ALEGE CAMERA DE INCALZIT"
    options:
      - "Termostat Salon"
      - "Termostat baie"
      - "Termostat Copii"
    initial: "Termostat baie"

sensor:
  - sensors:
    temperature_target:
      unit_of_measurement: "°C"
      value_template: >
        {% if is_state("input_select.thermostat_target", "Termostat Salon") %}
        {{ states("sensor.salon_temp") }}
        {% elif is_state("input_select.thermostat_target", "Termostat baie") %}
        {{ states("sensor.baie") }}
        {% elif is_state("input_select.thermostat_target", "Termostat Copii") %}
        {{ states("sensor.camera_copii") }}
        {% endif %}
    
      entity_id:
        - input_select.thermostat_target
        - sensor.salon_temp
        - sensor.baie
        - sensor.camera_copii

climate:
  - platform: generic_thermostat
    name: Seteaza Temperatura Dorita
    heater: switch.termostat_mijloc
    target_sensor: sensor.temperature_target
    min_temp: 15
    max_temp: 30
    target_temp: 25
    hot_tolerance: 0.2
    min_cycle_duration:
      seconds: 5
1 Like

In configuration.yaml I have added:
“packages: !include_dir_named packages” line.

When I try to validate the configuration, it ends with this error:

" Configuration invalid
Component error: packages - Integration ‘packages’ not found."

I am confused. What is wrong?

packages must be under homeassistant.

homeassistant:
  packages: !include_dir_named packages

Also, your template sensor config is wrong. You’re missing platform: template and the rest needs to be indented more.

sensor:
  - platform: template
    sensors:
      temperature_target:
        unit_of_measurement: "°C"
        value_template: >
        ...

what room if you have sensors in every room and only one heater?

If you have 3 sensors in different rooms and one heater that heats them all, I use a different approach:
I used to combine the readings via Min Sensor so the temperature in every room should be not less than a certain value. The problem with it is Min Sensor - even if all your sensors die, it’ll show the last numeric value.
So I ended up creating a custom multisource sensor (a hybrid of min sensor with a template sensor) which does the same but becomes unknown when all its sources become unknown (it can be done using template sensor, but involves much more effort/entities and does not offer similar flexibility). As a bonus, I added an option to switch sources on/off via input_booleans so at any time I can do it manually or via automation.