CO2 Control System Using Node-RED and Home Assistant

Hello everyone! I wanted to share an exciting project I recently completed to better manage indoor air quality in my new apartment. The goal was to automate our ventilation system to maintain optimal CO2 levels while minimizing noise and energy consumption. Here’s how I approached the problem and the solution I implemented.

The Challenge

Our modern ventilation system is designed to maintain air quality and energy efficiency, but it requires high fan speeds to keep CO2 levels below 1000 ppm. This constant noise was becoming quite irritating, so I decided to find a smarter way to control the fans.

The Solution

I set up a Node-RED flow within Home Assistant to monitor CO2 levels using two external sensors. The system uses a PID controller to adjust fan speeds dynamically based on real-time data. Here’s a breakdown of the components and logic:

  1. CO2 Sensors: I have sensors in both the living room and bedroom. The Node-RED flow takes the highest reading from these sensors to ensure we’re addressing the worst-case scenario.
  2. PID Controller: Inspired by the power saver flows, this controller calculates the necessary fan speed (load) to maintain CO2 levels below a set threshold (I chose 900 ppm).
  3. Fan Control: The ventilation unit is a Flexit Nordic CL3, controlled via the new flexit_bacnet integration. The Node-RED flow adjusts preset fan modes (away, home, boost) based on the calculated load.
  4. Temperature Scheduling: The flow also adjusts the air temperature according to a daily schedule for comfort and efficiency.

Implementation Details

  • Input Numbers: I created input_number entities for co2_limit, fan_temperature, co2_load, and fan_mode to make the system configurable and transparent.
  • Flow Logic: The flow compares the current CO2 levels against the target limit, calculates the required fan mode, and updates the system accordingly. It also ensures we don’t repeatedly change the fan mode too quickly.

Results

This system has been running smoothly for a few weeks now. The graphs below show how the CO2 levels (bottom) and fan speeds (top) adjust in real-time. It’s been a great way to maintain a healthy environment without the constant noise of high fan speeds.

CO2 and Fan Speed Graphs

Conclusion

I’m really happy with how this project turned out. It’s a practical solution that improves our quality of life without being intrusive. If you’re dealing with similar ventilation challenges, I hope this approach inspires you to explore automation options!

Let me know if you have any questions or suggestions for improvement. Happy tinkering! :rocket: