# Ventilation

I have a logic boolean variable `vent` which should result in ventilation running on **high** if `true`, and **medium** if `false`.

Then I use logic like:

```javascript
if (home) {
    if (vent) {
        fanmode = "High"
    } else {
        fanmode = "Medium"
    }
} else {
    fanmode = "Low"
}
```

The vent variable should be true if either there is a high CO2 level is high or there is high humidity in the bathroom.

The flow for updating the aggregated `vent` variable goes like this (and there is a duplicated trigger flow for each of the vent-.. variables.

![](https://1587494504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ltn3vQOSB-YGC6qLZu_%2F-Ltp8676QsUAu5rat8YS%2F-Ltp8z_-VKg9tU3tRY6Q%2FSkjermbilde%202019-11-16%20kl.%2017.59.42.png?alt=media\&token=5ad56804-74ad-46cf-abee-283185251ad4)
