Use input_select to choose sensors in generic_thermostat

Hi.

I have more one wire sensors and I want to use them with generic thermostat platform. How should I choose wich sensor to use?

For example, if I want to switch from living room sensor to bathroom sensor or other room. So, I want to use the same heater switch but choose from different one wire sensor. I think it is possible with input_select but I don’t know how.

Can I have a little help, please?

Thank you.

I should make more thermostats.

I make it two thermostats but the heater switch is switching back on and off if the target temperature it’s different from one thermostat to other.

Here is a print screen with my heater switch:

Can you show your config?

  • platform: generic_thermostat
    name: Termostat camera mijloc
    heater: switch.termostat_mijloc
    target_sensor: sensor.10000803054a0c
    min_temp: 15
    max_temp: 30
    target_temp: 21
    tolerance: 0.3
    min_cycle_duration:
    seconds: 5

  • platform: generic_thermostat
    name: Termostat baie
    heater: switch.termostat_mijloc
    target_sensor: sensor.280516811728ff
    min_temp: 15
    max_temp: 30
    target_temp: 21
    tolerance: 0.3
    min_cycle_duration:
    seconds: 5

I think the heater switch its switching between two target sensors. For that reason, it will be great if I can add more target_sensor and switch betweens in one generic_thermostat platform.

You can try next setup:

input_select:
  thermostat_target:
    name: "Thermostat target"
    options:
      - "Termostat camera mijloc"
      - "Termostat baie"
    initial: "Termostat camera mijloc"

sensor:
  - platform: template
    sensors:
      one_wire_target:
        unit_of_measurement: "°C"
        value_template: >
          {% if is_state("input_select.thermostat_target", "Termostat camera mijloc") %}
          {{ states("sensor.10000803054a0c") }}
          {% elif is_state("input_select.thermostat_target", "Termostat baie") %}
          {{ states("sensor.280516811728ff") }}
          {% endif %}
        
        entity_id:
          - input_select.thermostat_target
          - sensor.10000803054a0c
          - sensor.280516811728ff

climate:
  - platform: generic_thermostat
    name: "Thermostat"
    heater: switch.termostat_mijloc
    target_sensor: sensor.one_wire_target
    min_temp: 15
    max_temp: 30
    target_temp: 21
    tolerance: 0.3
    min_cycle_duration:
      seconds: 5
5 Likes

Thank you @omeasire. Now the thermostat it works like I want. :relaxed:

If I want to group Climate and Input Select?

Beautiful!
Had the same need and took this as an inspiration for my setup. But in Lovelace the thermostat card doesn’t show the value of target_sensor (i.e. sensor.one_wire_target in the above YAML). It shows 0 (value of zero) °C and the heater is allways on. But in developer tools - states I can ask the state (value) of sensor.one_wire_target and it shows the value according to the sensor selected by input select.
Where am I wrong?

Just morbidly curious as to what the use case is for this?

My bad! I had a typo in code.
Thanks!

As @luci78 said in his first post, if you have multiple temperature sensors but only one heating device it may be (very) useful to decide what sensor you use for thermosat. Could be one of those multiple sensor and/or some value computed from them (min/max/average).