Skip to content

Humidity Alert with Automatic Dehumidifier

Medium 30 min

High humidity in basements or bathrooms can lead to mold, musty smells, and expensive repairs. This guide shows you how to monitor humidity, get alerts when it’s too high, and automatically control a dehumidifier.

ProblemConsequenceSolution
Mold growthHealth hazard, expensive to removeKeep humidity below 60%
Musty smellUnpleasant, spreadsDehumidify regularly
Moisture damageDamaged furniture, wallsEarly alert + action
CondensationRust on metal, damaged electronicsConstant monitoring
ComponentExamplesPrice approx.
Humidity sensorAqara, SONOFF, Xiaomi€10-25
ComponentExamplesPrice approx.
Humidity sensorAqara WSDCGQ11LM, SONOFF SNZB-02€10-25
Smart dehumidifierTuya WiFi dehumidifier€80-200
Smart plug with power monitoringShelly Plug S, NOUS A1T€15-30
  1. Connect your Zigbee sensor via Zigbee2MQTT or ZHA
  2. Verify the sensor reports in Home Assistant
  3. Find the entity_id (e.g., sensor.basement_humidity)
  4. Check that the value updates regularly

Test your sensor:

# Go to Developer Tools → States
# Search for "humidity"
# Your sensor should show a value between 30-80%
  1. Go to SettingsDevices & ServicesHelpers
  2. Click Create helperDropdown
  3. Name: “Basement Humidity Status”
  4. Options: normal, high, critical, dehumidifier_active
automation:
- alias: "Alert on high basement humidity"
description: "Send notification when humidity is above 65% for 1 hour"
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.basement_humidity
above: 65
for:
hours: 1
action:
- service: notify.mobile_app_your_phone
data:
title: "💧 High humidity in basement"
message: >
Humidity: {{ states("sensor.basement_humidity") }}%.
Turn on dehumidifier!
data:
tag: "humidity_basement"
persistent: true

Turn on the dehumidifier automatically when humidity is too high, turn off when normal:

automation:
# Turn on dehumidifier when humidity is high
- alias: "Basement: Turn on dehumidifier on high humidity"
description: "Start dehumidifier when humidity above 60% for 30 min"
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.basement_humidity
above: 60
for:
minutes: 30
condition:
- condition: state
entity_id: humidifier.dehumidifier_basement
state: "off"
action:
- service: humidifier.turn_on
target:
entity_id: humidifier.dehumidifier_basement
- service: notify.mobile_app_your_phone
data:
title: "💨 Dehumidifier turned on"
message: >
Humidity: {{ states("sensor.basement_humidity") }}%
Dehumidifier started automatically.
# Turn off dehumidifier when humidity is normal
- alias: "Basement: Turn off dehumidifier on normal humidity"
description: "Stop dehumidifier when humidity below 50%"
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.basement_humidity
below: 50
for:
minutes: 15
condition:
- condition: state
entity_id: humidifier.dehumidifier_basement
state: "on"
action:
- service: humidifier.turn_off
target:
entity_id: humidifier.dehumidifier_basement
- service: notify.mobile_app_your_phone
data:
title: "✅ Dehumidifier turned off"
message: >
Humidity normalized: {{ states("sensor.basement_humidity") }}%

Keep track of how often the dehumidifier runs - useful for maintenance:

# Helpers (add via UI or configuration.yaml)
counter:
basement_dehumidifier_cycles:
name: "Basement Dehumidifier Cycles"
icon: mdi:water-percent
initial: 0
step: 1
input_datetime:
basement_dehumidifier_last_cycle:
name: "Basement Dehumidifier Last Cycle"
has_date: true
has_time: true
icon: mdi:clock-outline
automation:
- alias: "Basement Dehumidifier Cycle Tracker"
description: "Count dehumidifier cycles based on power consumption"
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.dehumidifier_power
above: 100
for:
seconds: 10
action:
- service: counter.increment
target:
entity_id: counter.basement_dehumidifier_cycles
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.basement_dehumidifier_last_cycle
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
  1. Install Local Tuya via HACS
  2. Find your dehumidifier’s Device ID and Local Key via Tuya IoT Platform
  3. Add the device in Local Tuya
  4. Select entity type: Humidifier (dehumidifier mode)
type: vertical-stack
cards:
- type: entities
title: "💧 Basement Humidity"
entities:
- entity: sensor.basement_humidity
name: Current humidity
icon: mdi:water-percent
- entity: humidifier.dehumidifier_basement
name: Dehumidifier
- entity: counter.basement_dehumidifier_cycles
name: Total cycles
- entity: input_datetime.basement_dehumidifier_last_cycle
name: Last cycle
format: relative
- type: history-graph
title: "Humidity over time"
hours_to_show: 168 # 1 week
entities:
- entity: sensor.basement_humidity
name: Basement
type: gauge
entity: sensor.basement_humidity
name: Basement Humidity
unit: "%"
min: 30
max: 80
severity:
green: 40
yellow: 55
red: 65

Configure different alerts based on severity:

LevelHumidityAction
NormalBelow 55%None
Elevated55-65%Log to history
High65-75%Notification + turn on dehumidifier
CriticalAbove 75%Repeated alarms + TTS
  1. Ventilation - Open windows regularly
  2. Heat source - Warm air holds less moisture
  3. Avoid indoor drying - Dry clothes outside or in dryer
  4. Check drains - Ensure floor drains work
  5. Insulation - Avoid cold surfaces that cause condensation

🌡️ Temperature Monitoring

Combine with temperature for better climate control.

Better Thermostat →


Kommentarer