Instead of reactively responding to high humidity in a smart home (when it's already too late), this end-to-end project proactively forecasts room climate for the next hour.
By combining historical IoT sensor data (TimescaleDB), external weather forecasts (Open-Meteo API), and thermodynamic calculations, a LightGBM model delivers precise ventilation recommendations to prevent mold—especially in critical areas like cold basements during humid summer months.
- Automated Weather Ingestion: Periodic retrieval of weather forecasts (temperature, relative humidity, direct solar radiation) via the Open-Meteo API, joined seamlessly with internal smart home telemetry.
-
Thermodynamic Feature Engineering: Calculation of absolute humidity (
$\text{g/m}^3$ ) using the Magnus formula for saturation vapor pressure. This is essential for physically comparing moisture content between indoor and outdoor air environments. -
ML Time-Series Forecasting: A LightGBM regressor predicts room temperature trends and humidity drift for a
$+1$ hour horizon without active ventilation. -
Intelligent Ventilation Alerts:
- Mold Prevention: Proactive alerts and ventilation recommendations whenever forecasted indoor humidity exceeds safety thresholds.
- Summer Condensation Shield: Automatic suppression of ventilation advice for cold basement or ground-floor rooms when warm, humid outdoor air would condense against cold masonry (dew point drop).
Built in alignment with modern Data Engineering and MLOps industry standards:
- Event Broker & Ingestion: Redpanda & Redpanda Connect for high-throughput streaming of IoT sensor events.
- Database & Storage: TimescaleDB (PostgreSQL extension) for time-series hypertable management.
- Orchestration: Apache Airflow for scheduling cyclic pipeline runs (Ingestion -> Feature Engineering -> Training -> Inference).
- High-Performance Processing: Polars for lightning-fast, memory-efficient DataFrame transformations, window lags, and data imputation (
Forward-Fillfor irregular Zigbee transmissions). - Machine Learning: LightGBM & Scikit-Learn for gradient boosting regression incorporating solar radiation and temporal lags.
[Smart Home Sensors] -> (MQTT/Redpanda) -> [TimescaleDB]
│
[Open-Meteo API] ------------------------------►├─► [Polars Feature Engineering]
│ │
▼ ▼
[Airflow DAGs] ◄─ [LightGBM Model] ─► [Ventilation Alerts]