You can not fix what you can not measure. Most homes have CO2 levels well above 1000 ppm in bedrooms by morning, which causes poor sleep, headaches, and brain fog. Fine dust from cooking, traffic, or wildfires silently builds up without you noticing. Home Assistant turns air quality data into action: open a window, kick on the ventilation, or send you an alert before things get bad. This guide covers the best sensors, how to set them up, and the automations that keep your air clean without you lifting a finger.
Jump to a section
People obsess over smart lighting and voice assistants, but the air you breathe has a bigger impact on your health and productivity than any automation. Studies show that CO2 levels above 1000 ppm reduce cognitive performance by up to 15%. Above 2500 ppm, decision-making drops by 50%. And most bedrooms hit 1500 to 2000 ppm by 3 AM with the door closed.
Fine particulate matter (PM2.5) is even sneakier. Cooking a steak can spike PM2.5 to 200+ micrograms per cubic meter, which is "hazardous" by outdoor air quality standards. Wildfire season, nearby construction, or just living near a busy road adds up over years.
The good news: once you start measuring, fixing it is straightforward. Open a window, run an ERV, turn on a HEPA filter. Home Assistant makes it automatic.
High CO2 makes you drowsy and unfocused. Automated ventilation keeps levels below 800 ppm so you sleep deeper and think clearer.
PM2.5 particles are small enough to enter your bloodstream. Monitoring lets you run HEPA filters only when needed, protecting your lungs without wasting energy.
VOC sensors catch off-gassing from new furniture, paint fumes, and cleaning product residue. Get an alert before chemicals build up to uncomfortable levels.
Instead of running ventilation 24/7, trigger it only when air quality actually needs it. Demand-controlled ventilation can cut heating and cooling costs by 20 to 40%.
Air quality is not a single number. Different pollutants require different sensors, and not everyone needs to measure everything. Here is what each metric tells you and when it matters.
| Metric | What It Measures | Good Level | Action Threshold | Priority |
|---|---|---|---|---|
| CO2 | Carbon dioxide from breathing | Below 800 ppm | Above 1000 ppm | Critical |
| PM2.5 | Fine dust, smoke, pollen | Below 12 ยตg/mยณ | Above 35 ยตg/mยณ | Important |
| VOC | Chemicals, off-gassing, fumes | Below 250 ppb | Above 500 ppb | Nice to Have |
| Humidity | Moisture in the air | 40 to 60% | Below 30% or above 70% | Key |
| Temperature | Room temperature | 18 to 22ยฐC | Outside comfort range | Core |
| Radon | Radioactive gas from soil | Below 100 Bq/mยณ | Above 200 Bq/mยณ | Regional |
Start with CO2
If you only buy one air quality sensor, make it a CO2 sensor. It is the most actionable metric because it directly tells you when to ventilate. A single CO2 sensor in your bedroom will probably change how you think about fresh air forever.
The air quality sensor market is split between polished consumer devices and DIY options. Consumer sensors look nice and work out of the box. DIY sensors cost less, give you more flexibility, and connect locally without any cloud. Here are the best options in each category.
The reference standard for consumer CO2 monitoring. NDIR sensor with proven accuracy, e-ink display, 2+ year battery life, Bluetooth connection to HA. The only downside is the price: around 150 euros. But you get lab-grade accuracy in a pocket-sized device.
Same NDIR technology as the Aranet4, but you build it yourself. A SenseAir S8 module (around 20 euros) on an ESP32 with ESPHome gives you accurate CO2 readings over Wi-Fi, fully local, for a fraction of the price. Add a BME280 for temperature and humidity in the same box.
A compact all-in-one sensor from Xiaomi's ecosystem. Measures CO2, PM2.5, PM10, temperature, and humidity. Connects via Bluetooth. The CO2 accuracy is decent but not quite Aranet4 level. Great if you want multiple metrics in one device for around 60 to 80 euros.
IKEA's air quality sensor measures PM2.5, VOC, temperature, and humidity. It connects to Home Assistant directly via Zigbee (pair it with your existing coordinator, skip the IKEA hub). For around 35 euros, you get a lot of sensor coverage with a nice display. Possibly the best bang for your buck in air quality monitoring.
The Plantower PMS5003 is the sensor inside most commercial PM2.5 monitors, including PurpleAir. Wire it to an ESP32 with ESPHome for PM1.0, PM2.5, and PM10 readings. Very accurate for its price. Runs about 15 euros for the sensor module alone.
If you already have a Xiaomi/Smartmi air purifier, it has a built-in PM2.5 sensor. The Xiaomi Miot HACS integration exposes the PM2.5 reading as a sensor entity. You get monitoring and purification in one device with no extra hardware.
Open-source hardware that measures CO2 (SenseAir S8), PM2.5 (PMS5003), VOC (SGP41), temperature, and humidity. Runs ESPHome out of the box, so it connects locally to Home Assistant with zero cloud. Available as a pre-built kit or DIY. One of the most popular air quality monitors in the HA community.
Build your own combo sensor with an ESP32 board, SenseAir S8 (CO2), PMS5003 (PM2.5), SGP30 or SGP41 (VOC), and BME280 (temp, humidity, pressure). Total cost around 45 euros. You choose exactly which sensors to include and can add more later. ESPHome makes configuration simple.
The only consumer sensor that measures radon along with CO2, VOC, temperature, humidity, and pressure. Connects to HA via Bluetooth. Battery powered (1.5 years). At around 200 euros it is not cheap, but if radon is a concern in your area, this is the go-to device.
Side by side: every sensor that matters for Home Assistant, ranked by what they measure, how they connect, and what they cost.
| Sensor | CO2 | PM2.5 | VOC | Temp/Hum | Connection | Local? | Price |
|---|---|---|---|---|---|---|---|
| AirGradient ONE | โ NDIR | โ | โ | โ | Wi-Fi (ESPHome) | 100% local | ~โฌ90 |
| Aranet4 | โ NDIR | - | - | โ | Bluetooth | 100% local | ~โฌ150 |
| IKEA VINDSTYRKA | - | โ | โ | โ | Zigbee | 100% local | ~โฌ35 |
| Qingping Air Monitor | โ NDIR | โ | - | โ | Bluetooth | 100% local | ~โฌ70 |
| Airthings Wave Plus | โ | - | โ | โ | Bluetooth | 100% local | ~โฌ200 |
| DIY Multi-Sensor | โ NDIR | โ | โ | โ | Wi-Fi (ESPHome) | 100% local | ~โฌ45 |
| PMS5003 + ESP32 | - | โ | - | - | Wi-Fi (ESPHome) | 100% local | ~โฌ20 |
Building your own sensor is one of the most satisfying Home Assistant projects. You get better sensors than most commercial products, full local control, and total flexibility. Here is a complete parts list and ESPHome configuration for an all-in-one air quality monitor.
| Component | Purpose | Price |
|---|---|---|
| ESP32 DevKit | Brain, Wi-Fi connectivity | โฌ5 |
| SenseAir S8 | CO2 (NDIR, accurate) | โฌ18 |
| PMS5003 | PM1.0, PM2.5, PM10 | โฌ12 |
| BME280 | Temperature, humidity, pressure | โฌ3 |
| SGP30 or SGP41 | VOC and eCO2 (optional) | โฌ8 |
| USB-C cable, wires, case | Power and housing | โฌ5 |
Total: around โฌ45 to โฌ50 for a sensor that measures everything. Compare that to โฌ150+ for a commercial device that measures less.
Here is a working ESPHome YAML configuration for the full multi-sensor build. Copy this into a new ESPHome device and flash it to your ESP32.
esphome:
name: air-quality-sensor
platform: ESP32
board: esp32dev
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
api:
logger:
ota:
i2c:
sda: GPIO21
scl: GPIO22
uart:
- id: uart_co2
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 9600
- id: uart_pm
tx_pin: GPIO25
rx_pin: GPIO26
baud_rate: 9600
sensor:
- platform: senseair
uart_id: uart_co2
co2:
name: "Air Quality CO2"
update_interval: 30s
- platform: pmsx003
type: PMSX003
uart_id: uart_pm
pm_1_0:
name: "Air Quality PM1.0"
pm_2_5:
name: "Air Quality PM2.5"
pm_10_0:
name: "Air Quality PM10"
update_interval: 60s
- platform: bme280_i2c
temperature:
name: "Air Quality Temperature"
humidity:
name: "Air Quality Humidity"
pressure:
name: "Air Quality Pressure"
update_interval: 30s
- platform: sgp30
eco2:
name: "Air Quality eCO2"
tvoc:
name: "Air Quality VOC"
compensation:
temperature_source: bme280_temperature
humidity_source: bme280_humidity
update_interval: 30sPro Tip: 3D Print a Case
Search Thingiverse or Printables for "AirGradient case" or "ESP32 air quality case." You will find dozens of enclosures designed for these exact sensor combinations. Make sure your case has ventilation holes so the sensors can actually sample the air.
Once your sensors are reporting data, here is how to get the most out of them in Home Assistant.
ESPHome devices auto-discover in HA. Bluetooth sensors (Aranet4, Airthings) need a BLE proxy or the built-in Bluetooth integration. Zigbee sensors (VINDSTYRKA) pair through ZHA or Zigbee2MQTT.
Group sensors by room using areas in HA. Name them consistently: "Bedroom CO2", "Bedroom PM2.5", etc. This makes automations and dashboards much cleaner to build and maintain.
Create template sensors that categorize air quality as Good, Fair, or Poor. Use CO2 below 800 for good, 800 to 1200 for fair, above 1200 for poor. Same for PM2.5: below 12 good, 12 to 35 fair, above 35 poor.
Use gauge cards for current levels (color-coded green/yellow/red), history graphs for trends over 24 hours, and a mini graph card (HACS) for a compact overview. See the dashboard section below for examples.
Start simple: a notification when bedroom CO2 exceeds 1000 ppm. Then add ventilation control, air purifier triggers, and window-open reminders. See the automations section below for ready-to-use YAML.
Mount sensors at breathing height (1 to 1.5m), away from windows, doors, and HVAC vents. Do not put a CO2 sensor right next to your bed head, your breath will spike it. Keep it 2 meters away for an accurate room average.
These are not gimmicks. Each one solves a real problem and runs silently in the background once you set it up.
Get a notification on your phone when bedroom CO2 rises above 1000 ppm. Simple, but life-changing for sleep quality. Only triggers once per night to avoid alarm fatigue.
automation:
- alias: "Bedroom CO2 Alert"
trigger:
- platform: numeric_state
entity_id: sensor.bedroom_co2
above: 1000
for:
minutes: 5
condition:
- condition: time
after: "22:00:00"
before: "08:00:00"
action:
- service: notify.mobile_app
data:
title: "Bedroom air is stuffy"
message: "CO2 is at {{ states('sensor.bedroom_co2') }} ppm. Open a window or turn on ventilation."Control your ERV, HRV, or bathroom fan speed based on CO2 levels. Low speed below 800 ppm, medium at 800 to 1200, high above 1200. This is demand-controlled ventilation, the same strategy commercial buildings use.
automation:
- alias: "Demand Controlled Ventilation"
trigger:
- platform: numeric_state
entity_id: sensor.living_room_co2
above: 1200
action:
- service: fan.set_percentage
target:
entity_id: fan.ventilation
data:
percentage: 100
- alias: "Ventilation Medium"
trigger:
- platform: numeric_state
entity_id: sensor.living_room_co2
above: 800
below: 1200
action:
- service: fan.set_percentage
target:
entity_id: fan.ventilation
data:
percentage: 50
- alias: "Ventilation Low"
trigger:
- platform: numeric_state
entity_id: sensor.living_room_co2
below: 800
action:
- service: fan.set_percentage
target:
entity_id: fan.ventilation
data:
percentage: 25Turn on your air purifier when PM2.5 spikes (cooking, wildfires, dusty day) and turn it off when levels drop back to safe. Works perfectly with Xiaomi purifiers via Xiaomi Miot, or any smart plug controlling a dumb HEPA filter.
automation:
- alias: "Air Purifier On - High PM2.5"
trigger:
- platform: numeric_state
entity_id: sensor.living_room_pm25
above: 35
for:
minutes: 2
action:
- service: fan.turn_on
target:
entity_id: fan.air_purifier
- service: fan.set_percentage
target:
entity_id: fan.air_purifier
data:
percentage: 80
- alias: "Air Purifier Off - Clean Air"
trigger:
- platform: numeric_state
entity_id: sensor.living_room_pm25
below: 10
for:
minutes: 10
action:
- service: fan.turn_off
target:
entity_id: fan.air_purifierPM2.5 spikes dramatically when you cook, especially when frying or grilling. This automation sends a reminder to turn on the range hood and opens a smart window or activates the kitchen fan.
automation:
- alias: "Kitchen Cooking - PM2.5 Spike"
trigger:
- platform: numeric_state
entity_id: sensor.kitchen_pm25
above: 50
action:
- service: notify.mobile_app
data:
title: "Range hood reminder"
message: "Kitchen PM2.5 is {{ states('sensor.kitchen_pm25') }} ยตg/mยณ. Turn on the range hood!"
- service: switch.turn_on
target:
entity_id: switch.kitchen_fanAfter using cleaning products or painting, VOC levels can stay elevated for hours. This automation alerts you and opens windows or cranks up ventilation until levels drop back to normal.
automation:
- alias: "High VOC Alert"
trigger:
- platform: numeric_state
entity_id: sensor.living_room_voc
above: 500
for:
minutes: 5
action:
- service: notify.mobile_app
data:
title: "High VOC detected"
message: "VOC is {{ states('sensor.living_room_voc') }} ppb. Open windows to ventilate."
- service: fan.set_percentage
target:
entity_id: fan.ventilation
data:
percentage: 100A well-designed air quality dashboard gives you a glanceable overview of every room. Here are the best card types and layouts for monitoring your indoor air.
Use gauge cards for CO2 and PM2.5 with color-coded severity zones. Green below 800 ppm, yellow from 800 to 1200, red above 1200. One gauge per room for an instant overview.
type: gauge
entity: sensor.bedroom_co2
min: 400
max: 2000
severity:
green: 0
yellow: 800
red: 1200
name: Bedroom CO224-hour history graphs reveal patterns: does CO2 spike every night in the bedroom? Does PM2.5 jump every evening when you cook dinner? Stack multiple rooms on one graph to compare.
type: history-graph
entities:
- sensor.bedroom_co2
- sensor.living_room_co2
- sensor.office_co2
hours_to_show: 24
title: CO2 TrendsMushroom chips (HACS) work great for a compact air quality bar at the top of any dashboard. Show CO2, PM2.5, humidity, and temperature as small colored chips. Tap to expand.
type: custom:mushroom-chips-card
chips:
- type: entity
entity: sensor.bedroom_co2
icon: mdi:molecule-co2
- type: entity
entity: sensor.bedroom_pm25
icon: mdi:blur
- type: entity
entity: sensor.bedroom_humidity
icon: mdi:water-percent๐จ Color Coding Is Everything
Use conditional card styling (available in Mushroom and custom:button-card) to change entity colors based on thresholds. A dashboard where everything turns red when air quality drops is far more useful than one with static colors. Check out our dashboard examples guide for more inspiration.
Placement makes or breaks the usefulness of your data. Here is where to put each type of sensor for the most accurate and actionable readings.
CO2 sensor. Mount at nightstand height but at least 2 meters from the bed head. CO2 from your breath concentrates near your pillow, so placing it too close gives falsely high readings. One per bedroom that people sleep in.
PM2.5 sensor. Place it 2 to 3 meters from the stove. Directly above the stove will trigger constantly while cooking. You want to measure the ambient kitchen air, not the direct exhaust from your pan.
CO2 + VOC sensor. Small rooms with closed doors get stuffy fast. A CO2 sensor here keeps you productive. VOC is useful if you have new furniture or carpet off-gassing in the office.
All-in-one sensor. The main living area benefits from a multi-sensor (CO2 + PM2.5 + temp + humidity). Place it on a shelf at about 1.5 meters height, away from windows and heating vents.
โ ๏ธ Avoid These Placement Mistakes
You do not need to monitor every room on day one. Start small, see the value, then expand. Here are three sensible starting points based on budget.
~โฌ35
Best for: testing the waters, seeing if air quality monitoring is useful for you.
~โฌ125
Best for: meaningful coverage of the rooms that matter most. CO2 for ventilation, PM2.5 for cooking.
~โฌ250
Best for: complete picture. Every occupied room has data. Demand-controlled ventilation that actually works.
The Aranet4 is the gold standard for accuracy. It uses NDIR technology, connects via Bluetooth, and has a 2+ year battery life. For a budget option, build a DIY sensor with an ESP32 and SenseAir S8 module for around 25 euros total. Both give you accurate NDIR readings. For an all-in-one solution, the AirGradient ONE includes CO2, PM2.5, and VOC in one ESPHome device for about 90 euros.
Yes. Home Assistant can trigger fans, ERV/HRV systems, or smart vents when CO2 exceeds a threshold. Many people set up tiered responses: low ventilation at 800 ppm, medium at 1000, high at 1200. This is called demand-controlled ventilation and it saves energy compared to running fans on a fixed schedule.
CO2 sensors measure carbon dioxide from breathing, telling you when a room needs fresh air. VOC sensors detect volatile organic compounds from paints, cleaning products, and furniture. PM2.5 sensors measure fine particulate matter like dust, pollen, and smoke. For most homes, CO2 is the most actionable metric for ventilation. PM2.5 matters most in kitchens and areas near traffic or wildfires.
DIY sensors built with ESPHome connect directly over Wi-Fi with zero cloud. The Aranet4 and Airthings connect via Bluetooth. IKEA VINDSTYRKA works over Zigbee. All of these are 100% local. Some commercial sensors like Awair require cloud APIs, making them less reliable. For best results, stick with local sensors.
Place CO2 sensors at breathing height (1 to 1.5 meters) in bedrooms and home offices. Keep them at least 2 meters from beds and away from windows, doors, and HVAC vents. For PM2.5, the kitchen and rooms near busy roads benefit most. Start with one CO2 sensor per bedroom plus one in the main living area.
A single IKEA VINDSTYRKA costs about 35 euros and gives you PM2.5, VOC, temperature, and humidity. A complete living room setup with an AirGradient ONE (CO2 + PM2.5 + VOC) runs about 90 euros. A DIY multi-sensor with ESP32, SenseAir S8, and PMS5003 costs around 45 euros. Full home coverage (3 to 4 rooms) ranges from 150 to 300 euros depending on whether you buy or build.
For PM2.5, VOC, temperature, and humidity, it is excellent. At 35 euros with Zigbee connectivity, it is one of the best value air quality sensors for HA. The main limitation is that it does not measure CO2. If you want CO2 monitoring (which is the most useful metric for ventilation), you will need a separate sensor like the AirGradient, Aranet4, or a DIY SenseAir S8 build.
Start with a free HomeShift scan to see which of your existing smart home devices can contribute air quality data. Then add a sensor or two and let Home Assistant do the rest.
Build DIY sensors and devices with ESP32 boards and ESPHome firmware.
Track electricity, gas, water, and solar production in Home Assistant.
Inspiration for automations across lighting, climate, security, and more.
Beautiful dashboard ideas and card configurations for Home Assistant.
VINDSTYRKA, TRADFRI, DIRIGERA, and more IKEA devices in Home Assistant.
Outdoor weather monitoring with Ecowitt, Tempest, and DIY ESP32 stations.