I have tried the blueprint from: 🪟 Open Window Recommendation | Absolute Humidity Based Blueprint
but it was not working for me. So I have decided to extend the functionality and build something by myself.
This blueprint helps you maintain optimal indoor humidity by notifying you when to open or close windows based on Absolute Humidity (AH) differences between indoor and outdoor air. Unlike relative humidity, absolute humidity accounts for temperature, making it a more accurate indicator for effective ventilation.
Key Features
Temperature-aware ventilation - Uses Absolute Humidity (AH) calculations
Smart notifications - Only notifies when conditions are optimal
Quiet hours support - No notifications during sleep time
Multi-room support - Shared settings across all rooms
Customizable messages - Personalize notification text
Window state detection - Clears notifications when windows open
Cooldown period - Prevents notification spam
How It Works
The Science Behind It
Absolute Humidity (AH) measures the actual amount of water vapor in the air (g/m³), regardless of temperature. When indoor AH is higher than outdoor AH by a significant amount, opening windows will help dry out the indoor air.
Formula used:
AH = (6.112 × e^((17.67 × T)/(T + 243.5)) × RH × 2.1674) / (273.15 + T)
Where:
- T = Temperature in °C
- RH = Relative Humidity (as decimal, e.g., 0.60 for 60%)
- e = 2.71828 (Euler’s number)
Notification Logic
“Open Window” notification triggers when:
AH difference (indoor - outdoor) > threshold (default: 3 g/m³)
Indoor relative humidity > minimum threshold (default: 50%)
Current time is NOT in quiet hours
Windows are closed
Cooldown period has passed (default: 4 hours)
“Close Window” notification triggers when:
AH difference drops to ≤ (threshold / 2) (default: 1.5 g/m³)
Windows are open
Notification clears when:
- You open a window (no need to manually dismiss)
Prerequisites
Required Sensors
For each room, you need:
- Temperature sensor (e.g.,
sensor.bedroom_temperature) - Humidity sensor (e.g.,
sensor.bedroom_humidity) - Window/door sensor (e.g.,
binary_sensor.bedroom_window)
For outdoor conditions:
- Outdoor temperature sensor
- Outdoor humidity sensor
Installation Guide
Step 1: Install the Blueprint
Step 2: Create Template Sensors for AH Calculation
Add this to your configuration.yaml or create a separate templates.yaml:
template:
- sensor:
# Outside AH
- name: "AH Outside"
unique_id: ah_outside
unit_of_measurement: "g/m³"
device_class: humidity
state_class: measurement
icon: mdi:water
state: >
{% set t = states('sensor.outdoor_temperature') | float(0) %}
{% set rh = states('sensor.outdoor_humidity') | float(0) %}
{% set e = 2.71828 %}
{{ ((6.112 * (e ** ((17.67 * t)/(t + 243.5))) * rh * 2.1674) / (273.15 + t)) | round(2) }}
# Bedroom AH
- name: "AH Bedroom"
unique_id: ah_bedroom
unit_of_measurement: "g/m³"
device_class: humidity
state_class: measurement
icon: mdi:water
state: >
{% set t = states('sensor.bedroom_temperature') | float(0) %}
{% set rh = states('sensor.bedroom_humidity') | float(0) %}
{% set e = 2.71828 %}
{{ ((6.112 * (e ** ((17.67 * t)/(t + 243.5))) * rh * 2.1674) / (273.15 + t)) | round(2) }}
# Bedroom AH Difference
- name: "AH Bedroom Difference"
unique_id: ah_bedroom_difference
unit_of_measurement: "g/m³"
device_class: humidity
state_class: measurement
icon: mdi:delta
state: >
{{ (states('sensor.ah_bedroom') | float(0) - states('sensor.ah_outside') | float(0)) | round(2) }}
Important:
- Replace
sensor.outdoor_temperature,sensor.outdoor_humiditywith your actual outdoor sensor entity IDs - Replace
sensor.bedroom_temperature,sensor.bedroom_humiditywith your actual room sensor entity IDs - Create similar sensors for each room you want to monitor
Restart Home Assistant after adding these sensors.
Step 3: Create Shared Helper Entities
Go to Settings → Devices & Services → Helpers and create the following:
3.1 AH Difference Threshold
- Type: Number (Helper)
- Name:
AH Difference Threshold - Icon:
mdi:delta - Minimum: 0.5
- Maximum: 10
- Step: 0.5
- Unit:
g/m³ - Default value: 3.0
Entity ID: input_number.ah_difference_threshold
3.2 Humidity Threshold
- Type: Number (Helper)
- Name:
Humidity Threshold - Icon:
mdi:water-percent - Minimum: 30
- Maximum: 80
- Step: 1
- Unit:
% - Default value: 50
Entity ID: input_number.humidity_threshold
3.3 Quiet Hours Start
- Type: Date and/or Time → Time only
- Name:
Ventilation Quiet Start - Icon:
mdi:sleep - Initial value:
22:00:00
Entity ID: input_datetime.ventilation_quiet_start
3.4 Quiet Hours End
- Type: Date and/or Time → Time only
- Name:
Ventilation Quiet End - Icon:
mdi:weather-sunset-up - Initial value:
08:00:00
Entity ID: input_datetime.ventilation_quiet_end
Step 4: Create Per-Room Helper Entities
For each room you want to monitor, create:
Last Notification Time Helper
- Type: Date and/or Time → Date and Time
- Name:
Ventilation [Room Name] Last Notification(e.g., “Ventilation Bedroom Last Notification”) - Icon:
mdi:bell
Example Entity IDs:
input_datetime.ventilation_bedroom_last_notificationinput_datetime.ventilation_living_room_last_notificationinput_datetime.ventilation_kitchen_last_notification