HVAC automation help - duct damper open / close based on room temp

Bit of a noob here, need some guidance. I’ve recently installed some duct dampers (coded as a ‘valve’ in HA) in my HVAC ducts that are triggered by a relay. I have temperature sensors in each room, and a Nest thermostat. I’m wanting the dampers to only open or close when the heating cycle in on. I’ve got it working for when the Nest state initially changes to heating, however I’m stuck on how to continue monitoring throughout the heating cycle, and close (or even open) as necessary .

Eg. assuming the room is initially below target (as measured by what the Nest is set to), the duct will open (if it’s not already) when the heating cycle is initially triggered (this works with the code below) - then when the room temperature reaches target temp, the damper gets closed while the heating cycle is still running.

This is what I’ve come up with so far:

alias: North Bedroom
description: ""
triggers:
  - trigger: state
    entity_id:
      - sensor.nest_status
    to: heating
conditions: []
actions:
  - if:
      - condition: numeric_state
        entity_id: sensor.atc_e6e9_temperature
        below: sensor.nest_thermostat_temp
    then:
      - action: valve.open_valve
        metadata: {}
        data: {}
        target:
          entity_id: valve.lilygo_relay_north_bedroom_damper
    else:
      - action: valve.close_valve
        metadata: {}
        data: {}
        target:
          entity_id: valve.lilygo_relay_north_bedroom_damper
mode: single

You can add more triggers to cover the situation. I would include a duration to reduce the chance of the valves being bounced back and forth between open and closed.

alias: North Bedroom
description: ""
triggers:
  - trigger: state
    entity_id:
      - sensor.nest_status
    to: heating
  - trigger: numeric_state
    entity_id: sensor.atc_e6e9_temperature
    below: sensor.nest_thermostat_temp
    for: "00:02:00"
  - trigger: numeric_state
    entity_id: sensor.atc_e6e9_temperature
    above: sensor.nest_thermostat_temp
    for: "00:02:00"
conditions: 
  - condition: state
    entity_id: sensor.nest_status
    state: heating
actions:
  - if:
      - condition: numeric_state
        entity_id: sensor.atc_e6e9_temperature
        below: sensor.nest_thermostat_temp
    then:
      - action: valve.open_valve
        metadata: {}
        data: {}
        target:
          entity_id: valve.lilygo_relay_north_bedroom_damper
    else:
      - action: valve.close_valve
        metadata: {}
        data: {}
        target:
          entity_id: valve.lilygo_relay_north_bedroom_damper
mode: single
1 Like