Generic thermostat switching heater multizone

Hi all,

I have a setup with multiple generic thermostats for multi zone heating. Each thermostat controls a room and switches the heating on/off. On the readiators are Tuya valves and these are indirectly controlled with the generic thermostat. As a test the thermostats are connected to an Ikea light.

When the thermostat heats, it switches on the heater, when it is not needed anymore, it switched of. The problem is when one thermostat heats and the heater is switched on, a second thermostat that doesn’t heat the radiator, switches off the heater while the first thermostat still needs the heat.

The thermostats are configured as follow:

## woonkamer ##
  - platform: generic_thermostat
    name: Woonkamer
    heater: light.ikealamp
    target_sensor: sensor.woonkamer_temperature
    min_temp: 10
    max_temp: 25
    target_temp: 18
    cold_tolerance: 0.5
    initial_hvac_mode: heat
    hot_tolerance: 0
    min_cycle_duration:
      minutes: 5
    away_temp: 17
    precision: 0.1

## Slaapkamer groot ##
  - platform: generic_thermostat
    name: Slaapkamer groot
    heater: light.ikealamp
    target_sensor: sensor.slaapkamergroot_temperature
    min_temp: 10
    max_temp: 25
    target_temp: 18
    cold_tolerance: 0.5
    initial_hvac_mode: heat
    hot_tolerance: 0
    min_cycle_duration:
      minutes: 5
    away_temp: 17
    precision: 0.1

## Slaapkamer Yannick ##
  - platform: generic_thermostat
    name: Slaapkamer Yannick
    heater: light.ikealamp
    target_sensor: sensor.slaapkameryannick_temperature
    min_temp: 10
    max_temp: 25
    target_temp: 18
    cold_tolerance: 0.5
    initial_hvac_mode: heat
    hot_tolerance: 0
    min_cycle_duration:
      minutes: 5
    away_temp: 17
    precision: 0.1

## Kledingkamer ##
  - platform: generic_thermostat
    name: Kledingkamer
    heater: light.ikealamp
    target_sensor: sensor.tempvalve8
    min_temp: 10
    max_temp: 25
    target_temp: 18
    cold_tolerance: 0.5
    initial_hvac_mode: heat
    hot_tolerance: 0
    min_cycle_duration:
      minutes: 5
    away_temp: 17
    precision: 0.1

## Slaapkamer Wouter ##
  - platform: generic_thermostat
    name: Slaapkamer Wouter
    heater: light.ikealamp
    target_sensor: sensor.tempvalve9
    min_temp: 10
    max_temp: 25
    target_temp: 18
    cold_tolerance: 0.5
    initial_hvac_mode: heat
    hot_tolerance: 0
    min_cycle_duration:
      minutes: 5
    away_temp: 17
    precision: 0.1

## Badkamer ##
  - platform: generic_thermostat
    name: Badkamer
    heater: light.ikealamp
    target_sensor: sensor.0x00124b0022fe639c_temperature
    min_temp: 10
    max_temp: 25
    target_temp: 18
    cold_tolerance: 0.5
    initial_hvac_mode: heat
    hot_tolerance: 0
    min_cycle_duration:
      minutes: 5
    away_temp: 17
    precision: 0.1
2 Likes

I’ve found this example: Logical OR operation between switches? - #3 by pnbruckner

In the generic-thermostat i’ve added the bolean switches to each thermostat and these switches switch

I’ve adapted the code to:

- id: '1626606255114'
  alias: Heating switch
  trigger:
    platform: state
    entity_id:
    - input_boolean.heating_toggle_badkamer
    - input_boolean.heating_toggle_kledingkamer
    - input_boolean.heating_toggle_master
    - input_boolean.heating_toggle_slaapkamer_groot
    - input_boolean.heating_toggle_woonkamer
    - input_boolean.heating_toggle_wouter
    - input_boolean.heating_toggle_yannick
  action:
    service_template: >
      {% if is_state('input_boolean.heating_toggle_badkamer', 'on') or
            is_state('input_boolean.heating_toggle_kledingkamer', 'on') or
            is_state('input_boolean.heating_toggle_slaapkamer_groot', 'on') or
            is_state('input_boolean.heating_toggle_woonkamer', 'on') or
            is_state('input_boolean.heating_toggle_wouter', 'on') or
            is_state('input_boolean.heating_toggle_yannick', 'on') %}
        switch.turn_on
      {% else %}
        switch.turn_off
      {% endif %}
    entity_id: input_boolean.heating_toggle_master

The toggle_master won’t switch on.

Any help would be appreciated.

Your intended application is to have each thermostat control an individual heater. However, your testing environment attempted to use a single Ikea light controlled by multiple thermostats. Why? Each thermostat should control a separate device.

It’s not not a “problem” it’s the expected behavior of multiple thermostats controlling a single device.

You then assigned each thermostat a separate input_boolean which is the correct way to test the thermostats. However, then you created an automation that attempts to turn off a master input_boolean if any of the input_booleans is on. What is the purpose of this master input_boolean?

Hi 123 Taras,

Thanx for the reply. I use Tuya valves on the radiators and the generic-thermostat to control a group of these radiators. From this group i take the average temperature and use this to feed the generic-thermostat. The generic-thermostat is linked with an automation with the Tuya valves for setting the desired temperature.

I have multiple groups of these Tuya valves (for each room) and the Generic-thermostat for each room needs to switch my heater (boiler). I want to use the “master input_boolean” as an output for switching the boiler.

I hope the diagram explains it a bit:

[quote]
It’s not not a “problem” it’s the expected behavior of multiple thermostats controlling a single device.
[/qoute] i know, but it is a problem to me :smiley:

I still haven’t found a solution to the problem. Any “nudge” in the right direction :smiley: :smiley:

I don’t see how you can prevent this behavior when all of the thermostats control the same device.

Let’s assume the thermostats in two rooms are currently reporting “Heating”. The first room to reach its target temperature will turn off the shared device. It doesn’t matter if the other room hasn’t yet reached its target temperature, the shared device is now off.

Hi Taras,

As described, i’ve modified the generic-thermostats to control a boolean swtich, each room has its own thermostat and booleanswitch:

    - input_boolean.heating_toggle_badkamer
    - input_boolean.heating_toggle_kledingkamer
    - input_boolean.heating_toggle_master
    - input_boolean.heating_toggle_slaapkamer_groot
    - input_boolean.heating_toggle_woonkamer
    - input_boolean.heating_toggle_wouter
    - input_boolean.heating_toggle_yannick

With these switches i want to control a “master switch”.

input_boolean.heating_toggle_master

greetings

Barry

Create a group containing all of the input_booleans. As long as at least one of the input_booleans is on the group’s state will also be on. When all input_booleans are off then the group’s state will be off.

You can use the group entity in a State Trigger to control your boiler switch.

- id: '1626606255114'
  alias: Heating switch
  trigger:
  - platform: state
    entity_id: group.heating_toggle
  action:
  - service: 'switch.turn_{{ trigger.to_state.state }}'
     target:
       entity_id: switch.boiler
2 Likes

Hi Taras,

This was the trick, thank you very much for the help !

Greets

Barry

1 Like

You’re welcome!

Please consider marking my post (above) with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. It also puts a link below your first post that leads to the solution post. All of this helps users find answers to similar questions.

Hi,
How can i change the target temperature on the generic HA thermostat?
My AC temperature sensor is fk up.
Thanks

Use the following service call: climate.set_temperature

Right, but i want to change the target temperature to a aqara sensor, not a number. Do you know hot is done? Thanks you!

  action:
    - service: climate.set_temperature
      target:
        entity_id: climate.kitchen
      data:
        temperature: "{{ states('sensor.your_aqara_sensor') }}"
        hvac_mode: heat

Reference: Templating - States

I´ve created other generic thermostat like you said, but for me in only appears with 2 AC options, Cold or Heat and OFF. The original thermostat has 6 options, Heat/Cold, Heat, Cold, Dry, Fan only and OFF.
I used this code to create it, but i cannot add more options. Generic Thermostat - Home Assistant.
I just want to get 4 thermostats for my 4 ACs units with all the options that they original have, but with a different target sensor yes. It seems easy to config, but im struggling…
If you know, can you please share the code?
Thans!

Created with code in YAML:
termo1
Captura de ecrĂŁ 2022-11-16 180731

Original:
termo2

The Generic Thermostat integration only supports two modes: heating and cooling.

This sounds exactly what I need. But we’re almost 2 years further in time now and I don’t really understand it (yet).

I have 4 generic thermostats in 4 rooms. I want the main switch to only turn off when all 4 thermostat don’t need heating.

What do I do?

Start a separate topic containing what you have and what you want to achieve.

As explained in the solution above, create one input_boolean helper per thermostat. You don’t need to create the group. Just create an automation that monitors all the input_binary helpers and evaluate their states.
This example will do the trick:

alias: main heater control
description: Control the state of the CV switch
trigger:
  - platform: state
    entity_id:
      - input_boolean.zone_logeerkamer
      - input_boolean.zone_slaapkamer
  - platform: time_pattern
    minutes: /5
condition: []
action:
  - if:
      - condition: state
        entity_id: input_boolean.zone_logeerkamer
        state: "off"
      - condition: state
        entity_id: input_boolean.zone_slaapkamer
        state: "off"
    then:
      - service: switch.turn_off
        target:
          entity_id: switch.main_cv
        data: {}
    else:
      - service: switch.turn_on
        target:
          entity_id: switch.main_cv
        data: {}
mode: queued
max: 2

The condition checks all input_binaries . If all are off, it will turn the main switch off. Otherwise it will turn the main switch on. Additionally the condition is check every 5 minutes in case there main switch occasionally doesn’t respond