Add Indoor Air Quality integration#169552
Open
liudger wants to merge 15 commits intohome-assistant:devfrom
Open
Add Indoor Air Quality integration#169552liudger wants to merge 15 commits intohome-assistant:devfrom
liudger wants to merge 15 commits intohome-assistant:devfrom
Conversation
Calculates an Indoor Air Quality (IAQ) index from a configurable set of sensor sources (temperature, humidity, CO2, tVOC, VOC index, PM, NO2, CO, formaldehyde, radon) using a configurable rating standard. Provides two sensor entities per config entry: a numeric iaq_index (0-65, MEASUREMENT state class) and an iaq_level enum sensor (excellent/good/fair/poor/inadequate). The integration is a calculated helper - it does not poll, but updates in response to source state changes. Includes a config flow that can auto-detect supported sensors from a selected device, an options flow, and a reconfigure flow.
Covers init/setup/unload, the user/sources/options/reconfigure config flow paths, and the IAQ index/level sensor calculations across the supported sources.
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a new indoor_air_quality helper integration that computes an Indoor Air Quality (IAQ) index + level from user-selected sensor sources, configured via config flow/options/reconfigure, and surfaced as two sensor entities.
Changes:
- Added the new
indoor_air_qualityintegration (controller/scoring, config flow, sensors, translations, manifest, quality scale metadata). - Added a full test suite covering setup, config flow behavior, and key scoring/unit-conversion cases.
- Registered the integration in generated metadata and assigned CODEOWNERS.
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/indoor_air_quality/__init__.py |
Entry setup/unload, runtime controller wiring, state-change subscriptions, entry data validation. |
homeassistant/components/indoor_air_quality/bands.py |
IAQ band tables + scoring/level mapping logic for the UK standard. |
homeassistant/components/indoor_air_quality/config_flow.py |
User/device-based config flow, optional manual source selection, options flow, and reconfigure flow. |
homeassistant/components/indoor_air_quality/const.py |
Integration constants: domain, standards, source keys, levels, and unit conversion maps. |
homeassistant/components/indoor_air_quality/coordinator.py |
Core controller that resolves sources, normalizes units, computes index/level, and notifies listeners. |
homeassistant/components/indoor_air_quality/helpers.py |
Helper utilities for unit normalization, state resolution, and conversion. |
homeassistant/components/indoor_air_quality/icons.json |
Default/state icons for the index and level sensors. |
homeassistant/components/indoor_air_quality/manifest.json |
Integration manifest (helper/calculated, config flow enabled, quality scale, docs link). |
homeassistant/components/indoor_air_quality/quality_scale.yaml |
Quality scale rule tracking for the new integration. |
homeassistant/components/indoor_air_quality/sensor.py |
Sensor platform exposing iaq_index and iaq_level entities backed by the controller. |
homeassistant/components/indoor_air_quality/strings.json |
Config-flow, options, selector, and entity translation strings. |
homeassistant/generated/config_flows.py |
Adds indoor_air_quality to the generated config flow registry. |
homeassistant/generated/integrations.json |
Adds integration metadata entry for indoor_air_quality. |
tests/components/indoor_air_quality/__init__.py |
Test package marker for the new integration tests. |
tests/components/indoor_air_quality/test_config_flow.py |
Tests for user/device flows, validation, options flow, and reconfigure flow. |
tests/components/indoor_air_quality/test_init.py |
Tests for controller behavior, setup/unload, updates, scoring, and conversions. |
CODEOWNERS |
Assigns ownership for the new integration directory. |
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…ed options flow tests
Co-authored-by: Copilot <copilot@github.com>
…ller Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…constants for concentration units and improving unit aliases. Co-authored-by: Copilot <copilot@github.com>
…ity ids while preserving order Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…sts for user input scenarios Co-authored-by: Copilot <copilot@github.com>
…ocumentation in Indoor Air Quality integration Co-authored-by: Copilot <copilot@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change
Proposed change
This integration calculates an Indoor Air Quality (IAQ) index from a configurable set of sensor sources (temperature, humidity, CO2, tVOC, VOC index, PM, NO2, CO, formaldehyde, radon) using a configurable rating standard.
Provides two sensor entities per config entry: a numeric iaq_index (0-65, MEASUREMENT state class) and an iaq_level enum sensor (excellent/good/fair/poor/inadequate).
The integration is a calculated helper - it does not poll, but updates in response to source state changes. Includes a config flow that can auto-detect supported sensors from a selected device and a reconfigure flow.
Indoor Air Quality is modeled as a helper because it creates derived air-quality entities from user-selected source sensors. It does not integrate with external hardware or a cloud service, and its behavior is closer to existing helper integrations such as statistics, derivative, threshold, min_max, and mold_indicator than to a device or service integration.
(generated)
Details
This pull request introduces a new "Indoor Air Quality" integration to Home Assistant. The integration calculates an Indoor Air Quality (IAQ) index based on a configurable set of sensor sources and a configurable rating standard. It includes a controller for aggregating and normalizing sensor data, a scoring and banding system for IAQ levels, and configuration constants. Additionally, it updates the
CODEOWNERSfile to assign ownership of this new integration.New Indoor Air Quality Integration
indoor_air_qualityintegration, which calculates an IAQ index from user-configurable sensor sources and supports configurable rating standards. The integration includes setup, validation, and event handling logic in__init__.py.coordinator.py), which aggregates sensor data, normalizes units, calculates the IAQ index, and manages listeners for updates. This includes robust per-source configuration and conversion handling.bands.py) to map sensor values to index scores and human-readable IAQ levels, supporting extensibility for additional rating standards.Configuration and Constants
const.py, enabling flexible and extensible configuration.Project Ownership
CODEOWNERSfile to assign the new integration to the appropriate maintainer.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: