yorickpeterse / openflow

A ventilation system built around Itho Daalderop's DemandFlow system, written in Inko
Mozilla Public License 2.0
7 stars 0 forks source link

Sample CO2 levels of ventilated rooms #2

Closed yorickpeterse closed 1 year ago

yorickpeterse commented 1 year ago

Currently we apply a fixed increase in the flow rate for every 100 PPM above the target threshold, regardless of what room is to blame for the increase in CO2 levels. To optimise this, we should do the following:

We maintain a CO2 histogram per room, in addition to a global one. Every X minutes we schedule all actively ventilated rooms for sampling. Every time we wake up we pop a room from this list, set its state to "Sampling", then reduce the ventilation speed of all other rooms by 50%. We then sample the room for N minutes, recording the CO2 levels in a histogram. After N minutes all rooms are reset to their previous state, the CO2 histogram is "flushed" into a CO2 value for the given room. To account for other ventilated rooms dilluting the CO2 levels, we could simply add X PPM for every other room to the CO2 value. After this we wait N minutes for the CO2 levels to settle in. This process repeats until all rooms have been sampled.

Once all rooms are sampled we take those with CO2 levels above the target threshold, increasing their ventilation by X% for every 100 PPM above the target threshold.

If one or more rooms are humid, we don't perform any sampling. Sampling only operates on rooms configured in co2.rooms.

The resulting setup is similar to how the DemandFlow system works, except we only sample rooms that are actively ventilated, instead of sampling all rooms in an unspecified order. The end goal is to only increase CO2 based ventilation for rooms that actually need it, instead of simply increasing it for all rooms.

yorickpeterse commented 1 year ago

The problem this tries to solve is this: when entering a small room (e.g. a toilet), CO2 levels can rise quickly. In the current setup this results in OpenFlow also adjusting the ventilation of e.g. the bedroom and living room, which more often than not isn't necessary.

An alternative approach is this:

We add the setting co2.ignore_when_active, which is a list of room names. When ventilation is active in any of these rooms, we do update the CO2 histogram but we don't update the CO2 histogram. In practise this setting would only contain your toilet and bathroom.

The result is that going to the toilet for 10 minutes won't result in ventilation getting cranked up to the max. Unlike the initial proposal we don't need sampling, making the implementation much easier and less prone to producing excessive noise (due to not having to adjust the exhaust motors).

The downside is that if other rooms are ventilated, we'd still increase ventilation across all those rooms, even if only one room would need the extra ventilation.