Skip to content

Add Indoor Air Quality integration#169552

Open
liudger wants to merge 15 commits intohome-assistant:devfrom
liudger:add-indoor-air-quality
Open

Add Indoor Air Quality integration#169552
liudger wants to merge 15 commits intohome-assistant:devfrom
liudger:add-indoor-air-quality

Conversation

@liudger
Copy link
Copy Markdown
Contributor

@liudger liudger commented Apr 30, 2026

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 CODEOWNERS file to assign ownership of this new integration.

New Indoor Air Quality Integration

  • Adds the indoor_air_quality integration, 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.
  • Implements the IAQ controller (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.
  • Provides banding and scoring logic (bands.py) to map sensor values to index scores and human-readable IAQ levels, supporting extensibility for additional rating standards.

Configuration and Constants

  • Defines all constants, configuration options, supported standards, sensor types, level identifiers, and unit conversion tables in const.py, enabling flexible and extensible configuration.

Project Ownership

  • Updates the CODEOWNERS file to assign the new integration to the appropriate maintainer.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

liudger added 2 commits April 30, 2026 12:02
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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_quality integration (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.

Comment thread homeassistant/components/indoor_air_quality/coordinator.py
Comment thread homeassistant/components/indoor_air_quality/__init__.py Outdated
Comment thread homeassistant/components/indoor_air_quality/strings.json
Comment thread homeassistant/components/indoor_air_quality/config_flow.py Outdated
liudger and others added 2 commits April 30, 2026 13:23
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 30, 2026 13:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated 3 comments.

Comment thread homeassistant/components/indoor_air_quality/config_flow.py Outdated
Comment thread homeassistant/components/indoor_air_quality/helpers.py
Comment thread homeassistant/components/indoor_air_quality/coordinator.py Outdated
Copilot AI review requested due to automatic review settings April 30, 2026 13:58
…ller

Co-authored-by: Copilot <copilot@github.com>
@liudger liudger marked this pull request as ready for review April 30, 2026 14:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated 8 comments.

Comment thread homeassistant/components/indoor_air_quality/config_flow.py
Comment thread homeassistant/components/indoor_air_quality/quality_scale.yaml Outdated
Comment thread homeassistant/components/indoor_air_quality/const.py
Comment thread homeassistant/components/indoor_air_quality/helpers.py
Comment thread homeassistant/components/indoor_air_quality/helpers.py Outdated
Comment thread tests/components/indoor_air_quality/test_init.py
Comment thread tests/components/indoor_air_quality/test_init.py
Comment thread tests/components/indoor_air_quality/test_init.py
liudger and others added 4 commits April 30, 2026 14:25
…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>
Copilot AI review requested due to automatic review settings April 30, 2026 14:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated 2 comments.

Comment thread homeassistant/components/indoor_air_quality/__init__.py
Comment thread homeassistant/components/indoor_air_quality/helpers.py
liudger and others added 2 commits April 30, 2026 14:59
Co-authored-by: Copilot <copilot@github.com>
…sts for user input scenarios

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 30, 2026 15:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated 2 comments.

Comment thread homeassistant/components/indoor_air_quality/config_flow.py
Comment thread homeassistant/components/indoor_air_quality/bands.py Outdated
…ocumentation in Indoor Air Quality integration

Co-authored-by: Copilot <copilot@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants