4 min read

When to air the room? Track CO₂, temperature and humidity

A sensor for CO₂, temperature and humidity sends a notification when the air in the room stays heavy, and stays quiet when the window is already open. We set the thresholds per room.

Level
Beginner
Active time
30–60 minutes
Home Assistant required
Yes

After a few hours with the windows closed, the room gets stuffy and your head feels heavy, but there is nothing to look at that tells us when to open them. We just want a notification when the air starts to get worse, and silence when the airing is already doing its job.

What we will get

A CO₂, temperature and humidity sensor that Home Assistant watches. When CO₂ stays above a chosen threshold for a few minutes, we get an “open the window” notification. If the window is already open, no notification comes. This is a guide for airing, not a medical or measuring instrument.

What we need

  • SONOFF AirGuard CO2: one sensor for each room we want to watch. For more rooms we need one per room.
  • Home Assistant with the Matter integration (the sensor is Matter over Wi-Fi) and Wi-Fi coverage in the room.
  • Optionally: an open-window sensor, so we don’t get a notification when the window is already open. If we don’t have one, we skip that condition.
  • The Home Assistant app on the phone for the notifications.

Setup time: about 30 minutes. Then a day or two of observation to tune the threshold.

How it works

CO₂ in a room with people rises until we air it. The sensor reports a value in ppm (parts per million). The automation watches the value and sends a notification when it stays above the threshold for a set time, so that we don’t react to a short spike.

The thresholds are a matter of preference. As a starting point, around 1000 ppm is often used for “starting to get stuffy” and higher for “really air it out”. The numbers in the example are examples. We tune them by our own feel and by how the value rises in our room.

How it is at our place

As of 22.11.2026 we did not find a CO₂ sensor in Marto’s Home Assistant: the home air sensors are IKEA VINDSTYRKA, which are not for CO₂. So this project is not a description of a home setup. There is already similar logic at home for the windows: when a window stays open, the AC is stopped, and when it closes, it comes back. For that idea see the open window and AC project.

Steps

  1. We turn on the sensor, connect it to Wi-Fi and add it to Home Assistant through Matter following the manufacturer’s guide. We expect a device with CO₂, temperature and humidity sensors.
  2. We place it at the height where we sit, away from the window, the vent and direct breath. In a corner behind furniture the readings lag.
  3. We watch the values for a day or two without an automation. We note what it shows when it is “stuffy” and when it is “fresh”.
  4. We create the automation from the example. We replace the entity IDs and the threshold with our own.
  5. We add a second notification for humidity only if we need it, for example above an example 65%.
# Example: add to a new automation (Edit in YAML).
# The entity IDs, the threshold and the notify service name are examples.
alias: Air the room when CO2 stays high
triggers:
  - trigger: numeric_state
    entity_id: sensor.airguard_carbon_dioxide
    above: 1000
    for:
      minutes: 5
conditions:
  - condition: state
    entity_id: binary_sensor.living_room_window
    state: "off"
actions:
  - action: notify.mobile_app_my_phone
    data:
      title: Time to air the room
      message: "CO2 is {{ states('sensor.airguard_carbon_dioxide') }} ppm."
mode: single

The window condition is removed if we don’t have such a sensor. Then the notification comes even with the window open, until the value drops below the threshold.

Checking the result

  • Normal case: we close the room with a few people and wait for the value to pass the threshold for five minutes. The notification comes.
  • Edge case: we open the window. After airing, the value drops and no more notifications come until it rises again. The trigger fires only on crossing the threshold.
  • Missing data: when the sensor is off, the state becomes “unavailable”. The automation does not start. If we want a notification for an off sensor, we make a separate rule.

If it doesn’t work

  • There is no device in Matter → Wi-Fi is on a different network or the Matter Server is not working → we check Settings → Devices & services.
  • The notification comes too often → the threshold is too low for the room → we raise it or extend “for”.
  • The values look “stuck” → the sensor is in a bad place → we move it to an open space.

Limitations

  • The sensor gives a guide for airing.
  • The readings of sensors in this class can differ; we don’t take them as a reference.
  • Without Home Assistant there are no notifications. The sensor can also be read in the manufacturer’s app, if we use it.
  • We stop the automation from Settings → Automations.

Sources and verification status

Checked against the Home Assistant documentation, 22.11.2026, and a read-only reading of Marto’s Home Assistant (see ha-evidence).

Need a hand?

We can set up and install everything in this project. In some regions we install it ourselves — ask us.

Contact us

Related projects

SONOFF AirGuard CO2 – Smart CO2 monitor with Matter over Wi-Fi for air quality (SAWF-08P)

51,90 €
View parts

What you need

Added to cart

Real Home Automations

Sign in to your account

With a code sent to your email

Continue with Google
or

By continuing, you accept the Terms and Conditions and the Privacy Policy.