When should I open the basement windows? A dew point automation with Home Assistant

Hi everyone,

every autumn I have the same question about our basement: does opening the windows actually help, or does it make things worse? Many people simply air out when it’s sunny outside. In a basement, that can backfire. Warm outside air carries a lot of moisture, cools down on the cold walls and leaves even more humidity behind.

So I built a small automation in Home Assistant that tells me when ventilating really makes sense.

The idea

Relative humidity alone is misleading because it depends on temperature. The better value is the dew point, because it reflects the actual amount of water in the air. If the dew point inside is clearly higher than the dew point outside, opening the windows removes moisture. If it’s the other way round, keep them closed.

What I use

In each basement room (party room and laundry room) I have an Aqara Temperature and Humidity Sensor. You can use either the original model or the newer T1. Both measure temperature, humidity and air pressure, and both work fine for this. A third Aqara sensor sits outside on the terrace. Home Assistant calculates the dew point for each of them.

Here’s how the dew points looked over the last few days:

The logic

Ventilation is recommended once the indoor dew point is at least 3.0 °C higher than outside. The recommendation only ends when the difference drops below 1.5 °C. This gap stops it from switching back and forth when the values are close. On top of that, the difference has to hold for 10 minutes before the recommendation turns on, and 5 minutes before it turns off.

yaml

template:
  - sensor:
      - name: "Dew point basement"
        unique_id: dew_point_basement
        device_class: temperature
        state_class: measurement
        unit_of_measurement: "°C"
        state: >
          {% set t = states('sensor.basement_temperature') | float(0) %}
          {% set rh = states('sensor.basement_humidity') | float(50) %}
          {% set a = log(rh / 100) + (17.62 * t) / (243.12 + t) %}
          {{ (243.12 * a / (17.62 - a)) | round(1) }}

      - name: "Dew point outside"
        unique_id: dew_point_outside
        device_class: temperature
        state_class: measurement
        unit_of_measurement: "°C"
        state: >
          {% set t = states('sensor.outside_temperature') | float(0) %}
          {% set rh = states('sensor.outside_humidity') | float(50) %}
          {% set a = log(rh / 100) + (17.62 * t) / (243.12 + t) %}
          {{ (243.12 * a / (17.62 - a)) | round(1) }}

  - binary_sensor:
      - name: "Ventilation useful basement"
        unique_id: ventilation_useful_basement
        icon: mdi:window-open-variant
        delay_on: "00:10:00"
        delay_off: "00:05:00"
        state: >
          {% set diff = states('sensor.dew_point_basement') | float(0)
                      - states('sensor.dew_point_outside') | float(0) %}
          {% if diff >= 3.0 %}
            true
          {% elif diff < 1.5 %}
            false
          {% else %}
            {{ is_state('binary_sensor.ventilation_useful_basement', 'on') }}
          {% endif %}

Just replace the entity IDs with the ones from your own sensors.

Notifications

When the binary sensor turns on, I get a push notification on my phone. Alexa also announces it on our Echos, but only between 8 am and 9 pm, so nobody gets woken up by a basement announcement.

First impressions

It’s interesting how often my gut feeling was wrong. On some warm, sunny days ventilating would have done more harm than good, while on cool, dry evenings it’s ideal.

How do you deal with humidity in your basement? Does anyone already use a window sensor to check whether the window was actually opened after the recommendation? That’s my next step.

Frank

1 Like