Adjusting Room Thermostat temperature / state based on TRV state

Hi all - complete newbie who has come over to HA to try and sort out some heating niggles.

My heating is controlled by Heatmiser room thermostats which are linked to HA via Homekit integration.

I’ve bought a MOES Zigbee smart thermostatic radiator valve (TRV) connected to HA via ZHA and a Sonoff dongle.

My upstairs heating is controlled by a single zone thermostat. My desired behaviour is that if the zone thermostat is idle (i.e. reached preset temp) and if a connected room TRV is in a heat state (but the boiler is off due to the zone stat state), then HA would compare the TRV and zone thermostat states and temporarily “boost” the zone thermostat until the room TRV had reached idle; at which point the zone thermostat would be returned to its starting temperature and idle state.

I’m no coder and have been trying to build an automation in the GUI, but am getting nowhere fast.

Climate Entities available (sorry I don’t know how to paste these and keep a table format!?:

Zone thermostat
hvac_modes: heat_cool
min_temp: 5
max_temp: 35
current_temperature: 19.6
temperature: 19.5
hvac_action: idle
friendly_name: Upstairs Master Thermostat Neo
supported_features: 1

TRV thermostat

hvac_modes: heat
min_temp: 5
max_temp: 35
preset_modes: none, away, Schedule, comfort, eco, boost, Complex
current_temperature: 18
temperature: 17.5
hvac_action: idle
preset_mode: none
system_mode: [<SystemMode.Heat: 4>]/heat
occupancy: 1
occupied_heating_setpoint: 1750
unoccupied_heating_setpoint: 1500
friendly_name: Master Bedroom TRV Thermostat
supported_features: 17

My best guess so far was to

Check Condition that Upstairs Master Thermostat Neo, attribute “Current Action” is state “Idle”, and Master Bedroom TRV Thermostat, attribute “Current Action” is state “Heating”.

However I’m then lost when setting an action - the device Action for the zone thermostat (Upstairs Master Thermostat) only alloys me to change standby state or change HVAC mode. Selecting “change HVAC mode” doesn’t allow any action to switch to heat.

Can anyone point me to a way to boost (by say adding 1 or 2 degrees) to the Zone thermostat, and then keep looping until the TRV stat goes to idle?

This is tricky to do without the entity names or, frankly, having a similar setup to yours. However, if it were me it would be a complex setup involving some helper entities to know if the main zone were “boosted” so I could use that in combo with the TRV state to know when to shut everything off. That is going to be challenging to convey to someone new to the system so I am going to recommend to use a “wait for trigger”, which I don’t generally recommend since it uses system resources while it waits, but it is easier to demonstrate.

Here’s a rough draft of an automation you could try, replace the entity names with the names of your entities and you should be able to use the triple dots in the upper right of a new automation to view YAML mode and paste it:

description: "Boost Zone when TRV Still Heating"
mode: single
trigger:
  - platform: state
    entity_id:
      - climate.the_name_of_your_zone_entity
    attribute: hvac_action
    to: idle
    from: heating
condition:
  - condition: state
    entity_id: climate.the_name_of_your_trv_entity
    attribute: hvac_action
    state: heating
action:
  - service: climate.set_temperature
    data:
      hvac_mode: heat
      temperature: >-
        {{ float(state_attr('climate.the_name_of_your_trv_entity', 'temperature'), 0) }}
    target:
      entity_id: climate.the_name_of_your_zone_entity
  - wait_for_trigger:
      - platform: state
        entity_id:
          - climate.the_name_of_your_trv_entity
        attribute: hvac_action
        from: heating
        to: idle
  - service: climate.set_temperature
    data:
      temperature: >-
        {{ float(state_attr('climate.the_name_of_your_zone_entity', 'current_temperature'), 0) }}
      hvac_mode: heat
    target:
      entity_id: climate.the_name_of_your_zone_entity

This says that if the zone goes idle but a TRV is on then set the zone set point to that of the TRV (you can change this if that is incorrect). Then, wait for the TRV to go idle and set the zone’s set point to whatever it’s detected the current temperature to be, effectively turning it off.

I don’t know if that is precisely what you are looking for, but it might be a start. Once you paste this and change the entity names to be your proper names then you can click the triple dots to view it back in visual mode, however some of this will stay in YAML mode because of the code.

There are a dozen other ways to do this but it becomes increasingly difficult to demonstrate that in the blind like this.

1 Like

Thanks very much for your help, hoping I can pick your brains a bit further.

Re the operation suggested - (if the zone goes idle but a TRV is on then set the zone set point to that of the TRV) - this wouldn’t work as it isnt the case that the TRV is set to a higher temp than the zone, just that the room hasn’t reached that temp yet due to it being remote from the zone stat. My thinking was therefore that the zone temp needs to be boosted above its original temp (by a nominal 1 or 2 degrees to ensure a boost) until the TRV meets its temp point, then revert to its starting temperature.

This will basically overheat the wider Zone, but I intend to control this by having TRVs on all the radiators other than one heatsink that can allow the boiler to keep driving.

The entity names are:
(Zone) climate.upstairs_master_thermostat_neo
(TRV) climate.master_bedroom_trv_thermostat

I’ve tried to follow your code and assume this will involve changing in the action

  temperature: >-
    {{ float(state_attr('climate.master_bedroom_trv_thermostat', 'temperature'), 0) }}

But I’m not sure if I can just change it to {{ float(state_attr(‘climate.upstairs_master_thermostat_neo’, ‘temperature’ + 1??), 0) }}

I’ve also no idea how in that instance I could get the zone stat to return to its starting (preset) temperature when the action is finished.

Thanks in advance, and in hope rather than expectation!

Sure, you can do that. You’ll probably want another automation to stop the thermostat at some point, but to answer your question about adding temperature, absolutely:

temperature: >-
    {{ float(state_attr('climate.master_bedroom_trv_thermostat', 'temperature'), 0) + 1 }}

You could also adjust the original automation by waiting for a period of time, say 5 minutes, before you run this and if the TRV hasn’t shut off just yet then run the automation.

This modified version, which includes your entities, says that if the Neo goes idle and the TRV is still heating then set the Neo to the TRV + 1 degree (you can set that to whatever you like) and then when the TRV goes idle to tell the Neo that it’s set point is whatever it is at now so it shuts off.

description: "Boost Zone when TRV Still Heating"
mode: single
trigger:
  - platform: state
    entity_id:
      - climate.upstairs_master_thermostat_neo
    attribute: hvac_action
    to: idle
    from: heating
condition:
  - condition: state
    entity_id: climate.master_bedroom_trv_thermostat
    attribute: hvac_action
    state: heating
action:
  - service: climate.set_temperature
    data:
      hvac_mode: heat
      temperature: >-
        {{ float(state_attr('climate.master_bedroom_trv_thermostat', 'temperature'), 0) + 1 }}
    target:
      entity_id: climate.upstairs_master_thermostat_neo
  - wait_for_trigger:
      - platform: state
        entity_id:
          - climate.master_bedroom_trv_thermostat
        attribute: hvac_action
        from: heating
        to: idle
  - service: climate.set_temperature
    data:
      temperature: >-
        {{ float(state_attr('climate.upstairs_master_thermostat_neo', 'current_temperature'), 0) }}
      hvac_mode: heat
    target:
      entity_id: climate.upstairs_master_thermostat_neo