All posts
Projects7/3/2026

Smart Buildings: Demand-Controlled HVAC with CO₂ Sensing & n8n

Fresh air without wasting energy. An ESP32 + SCD30 measures room CO₂; an n8n flow boosts ventilation only when it's needed, then eases off.

Smart Buildings: Demand-Controlled HVAC with CO₂ Sensing & n8n

Demand-Controlled Ventilation

Running HVAC flat-out wastes energy; running it too little makes rooms stuffy. An ESP32 + SCD30 measures CO₂ and reports it to IoTFlow; an n8n flow boosts ventilation only when CO₂ climbs.

Device code (ESP32)

iot.virtualWrite("co2", readCO2ppm());

The n8n workflow

n8n workflow

Here is the low-code automation that ties it together. In IoTFlow, every device event (telemetry, alert, command) can be forwarded to an n8n Webhook, and n8n calls back into the platform to control the device.

  1. The Webhook receives the CO₂ reading (metric = co2).
  2. An IF node checks CO₂ > 1000 ppm.
  3. An HTTP Request boosts the HVAC (pin hvac), easing off when it recovers.

Wire it up in 3 steps

  1. In n8n, add a Webhook node, activate it and copy the Production URL.
  2. In IoTFlow → Automations → New automation, pick the event and paste the URL.
  3. Click Test, then let real device data trigger it automatically.
Tip: bind a Switch or Slider widget to the same virtual pin so you can also control the device by hand from the web or mobile app.

Happy building! 🚀

Reviews

Leave a review