Add particle count and typical particle size sensors to air-Q (#179216)

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Michael Neuffer
2026-10-14 18:25:24 +02:00
committed by GitHub
co-authored by Copilot Autofix powered by AI
parent 4159d374e3
commit ec12becb0c
4 changed files with 100 additions and 1 deletions
+4
View File
@@ -7,4 +7,8 @@ CONF_CLIP_NEGATIVE: Final = "clip_negatives"
DOMAIN: Final = "airq"
MANUFACTURER: Final = "CorantGmbH"
ACTIVITY_BECQUEREL_PER_CUBIC_METER: Final = "Bq/m³"
LENGTH_MICROMETER: Final = "μm"
# The device reports the size-resolved particle counts in the native unit of its
# optical counter: the number of particles per 100 mL (0.1 L) of sampled air.
PARTICLE_COUNT_PER_100_MILLILITER: Final = "particles/100mL"
UPDATE_INTERVAL: float = 10.0
+21
View File
@@ -10,6 +10,24 @@
"oxygen": {
"default": "mdi:leaf"
},
"particle_count_0_3": {
"default": "mdi:grain"
},
"particle_count_0_5": {
"default": "mdi:grain"
},
"particle_count_1": {
"default": "mdi:grain"
},
"particle_count_10": {
"default": "mdi:grain"
},
"particle_count_2_5": {
"default": "mdi:grain"
},
"particle_count_5": {
"default": "mdi:grain"
},
"performance_index": {
"default": "mdi:head-check"
},
@@ -25,6 +43,9 @@
"radon": {
"default": "mdi:radioactive"
},
"typical_particle_size": {
"default": "mdi:diameter-variant"
},
"virus_index": {
"default": "mdi:virus-off"
}
+54 -1
View File
@@ -23,7 +23,11 @@ from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import AirQConfigEntry, AirQCoordinator
from .const import ACTIVITY_BECQUEREL_PER_CUBIC_METER
from .const import (
ACTIVITY_BECQUEREL_PER_CUBIC_METER,
LENGTH_MICROMETER,
PARTICLE_COUNT_PER_100_MILLILITER,
)
_LOGGER = logging.getLogger(__name__)
@@ -276,6 +280,48 @@ SENSOR_TYPES: list[AirQEntityDescription] = [
state_class=SensorStateClass.MEASUREMENT,
value=lambda data: data.get("ph3"),
),
AirQEntityDescription(
key="cnt0_3",
translation_key="particle_count_0_3",
native_unit_of_measurement=PARTICLE_COUNT_PER_100_MILLILITER,
state_class=SensorStateClass.MEASUREMENT,
value=lambda data: data.get("cnt0_3"),
),
AirQEntityDescription(
key="cnt0_5",
translation_key="particle_count_0_5",
native_unit_of_measurement=PARTICLE_COUNT_PER_100_MILLILITER,
state_class=SensorStateClass.MEASUREMENT,
value=lambda data: data.get("cnt0_5"),
),
AirQEntityDescription(
key="cnt1",
translation_key="particle_count_1",
native_unit_of_measurement=PARTICLE_COUNT_PER_100_MILLILITER,
state_class=SensorStateClass.MEASUREMENT,
value=lambda data: data.get("cnt1"),
),
AirQEntityDescription(
key="cnt2_5",
translation_key="particle_count_2_5",
native_unit_of_measurement=PARTICLE_COUNT_PER_100_MILLILITER,
state_class=SensorStateClass.MEASUREMENT,
value=lambda data: data.get("cnt2_5"),
),
AirQEntityDescription(
key="cnt5",
translation_key="particle_count_5",
native_unit_of_measurement=PARTICLE_COUNT_PER_100_MILLILITER,
state_class=SensorStateClass.MEASUREMENT,
value=lambda data: data.get("cnt5"),
),
AirQEntityDescription(
key="cnt10",
translation_key="particle_count_10",
native_unit_of_measurement=PARTICLE_COUNT_PER_100_MILLILITER,
state_class=SensorStateClass.MEASUREMENT,
value=lambda data: data.get("cnt10"),
),
AirQEntityDescription(
key="pm1",
device_class=SensorDeviceClass.PM1,
@@ -297,6 +343,13 @@ SENSOR_TYPES: list[AirQEntityDescription] = [
state_class=SensorStateClass.MEASUREMENT,
value=lambda data: data.get("pm10"),
),
AirQEntityDescription(
key="TypPS",
translation_key="typical_particle_size",
native_unit_of_measurement=LENGTH_MICROMETER,
state_class=SensorStateClass.MEASUREMENT,
value=lambda data: data.get("TypPS"),
),
AirQEntityDescription(
key="pressure",
device_class=SensorDeviceClass.PRESSURE,
@@ -122,6 +122,24 @@
"oxygen": {
"name": "Oxygen"
},
"particle_count_0_3": {
"name": "Particle count (>0.3 μm)"
},
"particle_count_0_5": {
"name": "Particle count (>0.5 μm)"
},
"particle_count_1": {
"name": "Particle count (>1 μm)"
},
"particle_count_10": {
"name": "Particle count (>10 μm)"
},
"particle_count_2_5": {
"name": "Particle count (>2.5 μm)"
},
"particle_count_5": {
"name": "Particle count (>5 μm)"
},
"performance_index": {
"name": "Performance index"
},
@@ -146,6 +164,9 @@
"silicon_hydride": {
"name": "Silicon hydride"
},
"typical_particle_size": {
"name": "Typical particle size"
},
"virus_index": {
"name": "Virus index"
}