I live in the Canadian Prairies where it gets extremely cold. In late January and into February, we always seem to get a few weeks where temperatures range from -20 to -40 °C. During these cold spells, I get condensation forming on the inside of the windows caused by the humid air in my home contacting the cold panes of my windows.
The solution is to lower the humidity in the home during extreme cold and then raise it to a more comfortable level once temperatures warm up again. My public utility company has recommended indoor humidity values for different outdoor temperatures. Since this relationship is nearly linear, I can fit a linear regression using R:
> # Create dataframe
> temperature <- c(-35,-30,-25,-18,-10,-5,0)
> humidity <- c(.2,.25,.3,.35,.4,.45,.5)
> max_humidity <- data.frame(temperature, humidity)
> max_humidity
temperature humidity
1 -35 0.20
2 -30 0.25
3 -25 0.30
4 -18 0.35
5 -10 0.40
6 -5 0.45
7 0 0.50
> # Fit linear model
> lm_humid <- lm(humidity~temperature, data = max_humidity)
> # Print extracted model coefficients
> coef(lm_humid)
(Intercept) temperature
0.493928965 0.008191079
> # Create plot showing fit
> plot(max_humidity)
> abline(lm_humid)
So the formula is indoor_humidity = outside_temp * 0.008191079 + 0.493928965
. If you prefer Fahrenheit, you can try this formula from this Reddit post instead: indoor_humidity = (outside_temp / 2) + 25
. Now that we have the formula, we can create the sensors for our target_humidity
in our configuration.yaml
. I pull the temperature for the Weather forecast card. I use the formula to calculate the maximum target humidity then use that value to create the minimum value that is 5% lower. I also use an if to set the lower threshold of maximum humidity to 20%.
sensor:
- platform: template
sensors:
target_humidity_max:
device_class: humidity
unit_of_measurement: '%'
value_template: >-
{% if (state_attr('weather.my_address', 'temperature') * 0.008191079 + 0.493928965) * 100 | int < 20 %}
20
{% else %}
{{ (state_attr('weather.my_address', 'temperature') * 0.008191079 + 0.493928965) * 100 |int }}
{% endif %}
target_humidity_min:
device_class: humidity
unit_of_measurement: '%'
value_template: >-
{{states('sensor.target_humidity_max') | float - 5.0 | float }}
Now that we have our targets, we need to automate our humidifier and dehumidifier to activate based on these values. Your setup will be different but mine is pretty simple. I use an WeMos D1 Mini with relay, programed using ESPHome, to manually activate the switch on my humidifier’s humidistat and another relay to activate my HRV. Exchanging the dry outside air for the humid indoor air drops my humidity quickly. The humidifier relay is added to Home Assistant as a generic_hygrostat
. I use the Min/Max integration to create an average humidity sensor called sensor.humidity
.
generic_hygrostat:
- name: hygrostat
unique_id: hygrostat
humidifier: switch.humidifier_control_relay
target_sensor: sensor.humidity
min_humidity: 20
max_humidity: 50
dry_tolerance: 1
wet_tolerance: 1
device_class: "humidifier"
Now we can create the automations. The first automation will set the target humidity on the hygrostat/humidistat to the target_humidity_min
. This is the value when we want the humidifier to activate. This automation also has a condition to only occur when temperatures are below freezing.
alias: HVAC_HUMIDIFIER_ON
trigger:
- platform: state
entity_id:
- weather.my_address
attribute: temperature
action:
- service: humidifier.set_humidity
entity_id: humidifier.hygrostat
data:
humidity: "{{ states(target_humidity_min) }}"
variables:
target_humidity_min: sensor.target_humidity_min
mode: single
condition:
- condition: numeric_state
entity_id: weather.my_address
attribute: temperature
below: 0
I also create a simple automation called HVAC_HUMIDIFIER_OFF that turns off the humidifier when temperatures are above 0 °C. I then add another automation that activates the HRV if the indoor humidity is above target_humidity_max.
alias: HVAC_HRV_ON_HUMIDITY
description: ""
trigger:
- platform: numeric_state
entity_id:
- sensor.humidity
above: sensor.target_humidity_max
condition:
- condition: numeric_state
entity_id: weather.my_address
attribute: temperature
below: 0
action:
- type: turn_on
device_id:
entity_id:
domain: switch
mode: single
The final automation turns off the HRV when sensor.humidity
is below target_humidity_max
.
Balancing humidifier and dehumidifier in extreme cold
byu/rastrillo inhomeassistant