The Problem
We all have humidity sensors. We all have "dumb" dehumidifiers. But tying them together usually results in one of two things:
- Alert Fatigue: You take a shower, humidity spikes to 85%, your phone screams at you, you ignore it.
- The "Dumb" Dehumidifier Issue: You put a smart plug on your dehumidifier to save energy. But when the tank fills up, the dehumidifier goes into "Standby," the plug stays ON, and you have no idea that it has stopped working while humidity climbs.
Use Case: The "Retrofit" Scenario
The Environment: A residence constructed in the 1970s located in the Southern United States. The architecture predates modern mechanical ventilation standards, resulting in bathrooms with no exhaust fans and high ambient humidity levels inherent to the region.
The Challenge: To mitigate moisture accumulation and prevent mold growth, portable dehumidifiers were deployed across multiple zones. However, these units lack internal pumps, requiring manual tank evacuation.
- The Failure Point: Without active monitoring, the tanks would frequently reach capacity and cease operation (Standby Mode) unnoticed. This resulted in critical equipment downtime lasting several days, allowing humidity to rebound to unsafe levels and creating a fertile environment for mold.
The Solution: Mold Guardian was developed to bridge the gap between "dumb" appliances and smart home safety.
- Tank Monitoring: By analyzing power draw versus humidity trends, the system detects when a unit has stalled (Tank Full) and alerts the homeowner immediately, eliminating downtime.
- Risk Analysis: Instead of relying on guesswork, the app calculates cumulative mold potential, ensuring that even if a tank is forgotten, a secondary "High Risk" alert will trigger before conditions become biological hazards.
The Solution: Mold Guardian
Mold Guardian is not just a simple automation; it is a full-featured Environmental Analysis Engine designed to replace simple threshold triggers. It uses ASHRAE Standard 62.1 logic, Dew Point calculations, and a new Predictive Mold Index to tell you when you are actually at risk, while ignoring false positives like showers.
It turns a $20 smart plug and a simple humidity sensor into a commercial-grade air quality monitor.
Key Features
1.
Predictive Mold Index (New in v20.0)
Most apps alert you if humidity hits a number (e.g., >65%). But mold doesn't grow instantly; it needs Time + Moisture. Mold Guardian implements a Cumulative Risk "Bucket" Algorithm:
- The Bucket: Every minute your room is above 60% RH, points are added to a "Risk Score." The higher the humidity, the faster the points accrue.
- The Drain: Every minute the room is below 60%, the score drains (drying kills spores faster than they grow).
- The Alert: You only get alerted if the score hits Critical (1000+). This catches slow leaks or persistent dampness that "snapshot" alerts miss, while ignoring temporary spikes from cooking or cleaning.
2.
"Stall" Detection for Dumb Dehumidifiers
How do you know if your dehumidifier tank is full without a sensor inside the tank? Math. The app monitors the Smart Plug's power state and the Room's Humidity trend.
- The Logic: If the plug is ON for 90 minutes (configurable), but the humidity has not dropped by at least 0.2%...
- The Conclusion: The unit is running but doing nothing.
- The Alert: It sends a specific alert: "Basement Dehumidifier Stalled: Tank Full or Coils Frozen."
- Auto-Reset: Once you empty the tank and the humidity drops, the app automatically clears the alert.
3.
Winter Mode (Condensation Protection)
60% humidity is safe for mold in July, but it will rot your window sills in January.
- Dynamic Targets: When the outdoor temperature drops (e.g., below 40°F), the app automatically lowers your safety target (e.g., to 45%).
- Safety Hysteresis: Includes a 5°F buffer to prevent the mode from flickering on/off on days with fluctuating weather.
- Stale Sensor Protection: If your outdoor sensor dies, the app forces Winter Mode OFF after 24 hours to prevent getting stuck in a strict state.
4.
Smart Shower Detection
Stop getting alerts when you bathe.
- If the associated Motion Sensor is active (or was active recently), the app pauses alerts for this zone.
- It queues a check for 60 minutes later.
- If the humidity has returned to normal by then? No alert sent.
- If humidity is still high after an hour? Alert sent (because your fan might be broken).
5.
The Dashboard Tile
The app generates a beautiful, rich-text HTML tile for your Hubitat Dashboard that displays:
- Zone Name & Status Badge (Running, Off, Tank Full, Offline).
- Current RH% & Temp with Trend Arrows (
/
). - Derived Science: Displays Dew Point and Wet Bulb temperature.
- Mold Risk Score: A color-coded percentage (0-100%) showing cumulative risk.
- Advice: Tells you to "Monitor," "Ventilate," or "Empty Tank."
How It Works (The Logic)
The "Bucket" Theory (Mold Index)
The app runs a calculation loop (Instant, 1m, 5m, or 15m intervals).
GroovyDelta = CurrentRH - 60 If (Delta > 0) Score += Delta // Filling the bucket If (Delta < 0) Score += (Delta * 2) // Draining the bucket (2x speed)
- Scenario A (Shower): Humidity spikes to 90% for 20 mins. Score rises to 300. Fan runs, humidity drops to 40%. Score drains to 0 in 15 mins. Result: Safe (Green).
- Scenario B (Basement Leak): Humidity sits at 68% for 48 hours. Score creeps up +8 points every cycle. Eventually, it crosses 1000. Result: Critical Mold Alert (Red).
The ASHRAE Compliance Check
On top of the prediction index, the app performs a strict standard check:
- Safe (Green): <= Target Limit
- Marginal (Yellow): < Target + 5%
- Violation (Red): >= Target + 5%
Hardware Safety & Data Integrity
- Filter Tracking: Tracks actual runtime hours. Caps sessions at 24h to prevent data corruption if a plug falls offline while ON.
- Reboot Safety: If your Hub reboots while a "Post-Shower Check" is pending, the app restores the queue immediately upon boot.
- Tank Loop Fix: Resetting a "Tank Full" alert automatically restarts the runtime timer, preventing an immediate false alarm 15 minutes later.
Configuration Guide
1. Main Settings
- Update Frequency: Choose between "Real-Time (Instant)" for max responsiveness or "15 Minute Polling" to save Hub resources.
- Notification Style: Standard, Minimal, or Urgent (adds emojis/caps).
2. Zone Setup (Supports up to 8 Zones)
For each room (e.g., Basement, Bathroom, Attic), you map:
- Humidity Sensor: (Required)
- Dehumidifier Plug: (Required for Stall/Tank logic)
- Motion Sensor: (Optional, for Shower Detection)
3. Advanced Tuning
- Winter Mode: Toggle ON/OFF. Set Trigger Temp (e.g., 40°F) and Target RH (e.g., 45%).
- Stall Timer: How long should the unit run without results before alerting? (Default: 90 mins).
- Filter Interval: Hours of runtime before "Clean Filter" badge appears (Default: 500 hrs).
Installation
- Go to Apps Code in Hubitat.
- Select New App.
- Paste the code provided below.
- Click Save and OAuth (not strictly required but good practice).
- Go to Apps, click Add User App, and select Mold Guardian.

