Generic thermostat switching heater multizone

Tags: #<Tag:0x00007fc3ea38b070>

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

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

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.