Dependencies between heaters in thermostats (domestic hot water priority)

I have 3 generic thermostats for:

  • 2 central heating zones,
  • hot water cylinder.

They are on a UK S-plan system, which means water supply from the boiler is shared by these 3 zones via independent valves, 1 per zone. When heating water, the boiler is set to a higher flow temperature than it is for central heating (in central heating mode the boiler uses weather compensation to lower the flow temperature depending on outside temperature). This means I do not want hot water thermostat and central heating thermostat to activate simultaneously. Typical installations use a timer to switch between central heating and hot water but this is non-ideal (for example in periods of high hot water usage). A better approach is “domestic hot water priority”, which temporarily disables central heating when heating water.

What solution would you recommend for implementing such mechanism in Home Assistant? I was thinking about several solutions:

  • Having a logical “CH and not HW” operation in the switch for CH heater/valve. How?
  • Temporarily disabling CH thermostats when hot water thermostat is active.

What tools to use? Automations, switch templates, input booleans?

I can probably implement something with automations myself but I wonder if there are any better solutions.

This is what I have done, it works well but, honestly, I wish HomeAssistant had boolean functions, similar to “combine sensors” helper for numerical states.

I have defined three input_boolean.heating_* toggles one for each zone and defined the following monstrous automation, essentially implementing 4x 3-input boolean functions. Then I assigned these toggles to one thermostat each (not shown here).

alias: Hot Water Priority
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.heating_hot_water
  - platform: state
    entity_id:
      - input_boolean.heating_upstairs
  - platform: state
    entity_id:
      - input_boolean.heating_downstairs
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.heating_hot_water
            state: "on"
        sequence:
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.heating_downstairs
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.heating_upstairs
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.switch_ch_mode
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.switch_hot_water
      - conditions:
          - condition: and
            conditions:
              - condition: state
                entity_id: input_boolean.heating_upstairs
                state: "on"
              - condition: state
                entity_id: input_boolean.heating_downstairs
                state: "on"
              - condition: not
                conditions:
                  - condition: state
                    entity_id: input_boolean.heating_hot_water
                    state: "on"
        sequence:
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.switch_hot_water
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.switch_ch_mode
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.heating_upstairs
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.heating_downstairs
      - conditions:
          - condition: and
            conditions:
              - condition: state
                entity_id: input_boolean.heating_upstairs
                state: "on"
              - condition: not
                conditions:
                  - condition: state
                    entity_id: input_boolean.heating_downstairs
                    state: "on"
              - condition: not
                conditions:
                  - condition: state
                    entity_id: input_boolean.heating_hot_water
                    state: "on"
        sequence:
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.switch_hot_water
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.switch_ch_mode
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.heating_upstairs
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.heating_downstairs
      - conditions:
          - condition: and
            conditions:
              - condition: not
                conditions:
                  - condition: state
                    entity_id: input_boolean.heating_upstairs
                    state: "on"
              - condition: state
                entity_id: input_boolean.heating_downstairs
                state: "on"
              - condition: not
                conditions:
                  - condition: state
                    entity_id: input_boolean.heating_hot_water
                    state: "on"
        sequence:
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.switch_hot_water
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.switch_ch_mode
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.heating_upstairs
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.heating_downstairs
      - conditions:
          - condition: and
            conditions:
              - condition: not
                conditions:
                  - condition: state
                    entity_id: input_boolean.heating_hot_water
                    state: "on"
              - condition: not
                conditions:
                  - condition: state
                    entity_id: input_boolean.heating_upstairs
                    state: "on"
              - condition: not
                conditions:
                  - condition: state
                    entity_id: input_boolean.heating_downstairs
                    state: "on"
        sequence:
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.switch_ch_mode
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.switch_hot_water
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.heating_upstairs
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.heating_downstairs
mode: single