Add support for Formaldehyde and VOC level sensors (#52232)
This commit is contained in:
parent
451b976458
commit
7f309b4e6e
3 changed files with 39 additions and 0 deletions
|
@ -102,3 +102,17 @@ class CarbonDioxideConcentration(ZigbeeChannel):
|
|||
"config": (REPORT_CONFIG_MIN_INT, REPORT_CONFIG_MAX_INT, 0.000001),
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@registries.ZIGBEE_CHANNEL_REGISTRY.register(
|
||||
measurement.FormaldehydeConcentration.cluster_id
|
||||
)
|
||||
class FormaldehydeConcentration(ZigbeeChannel):
|
||||
"""Formaldehyde measurement channel."""
|
||||
|
||||
REPORT_CONFIG = [
|
||||
{
|
||||
"attr": "measured_value",
|
||||
"config": (REPORT_CONFIG_MIN_INT, REPORT_CONFIG_MAX_INT, 0.000001),
|
||||
}
|
||||
]
|
||||
|
|
|
@ -32,6 +32,7 @@ PHILLIPS_REMOTE_CLUSTER = 0xFC00
|
|||
SMARTTHINGS_ACCELERATION_CLUSTER = 0xFC02
|
||||
SMARTTHINGS_ARRIVAL_SENSOR_DEVICE_TYPE = 0x8000
|
||||
SMARTTHINGS_HUMIDITY_CLUSTER = 0xFC45
|
||||
VOC_LEVEL_CLUSTER = 0x042E
|
||||
|
||||
REMOTE_DEVICE_TYPES = {
|
||||
zigpy.profiles.zha.PROFILE_ID: [
|
||||
|
@ -62,6 +63,7 @@ SINGLE_INPUT_CLUSTER_DEVICE_CLASS = {
|
|||
# a different dict that is keyed by manufacturer
|
||||
SMARTTHINGS_ACCELERATION_CLUSTER: BINARY_SENSOR,
|
||||
SMARTTHINGS_HUMIDITY_CLUSTER: SENSOR,
|
||||
VOC_LEVEL_CLUSTER: SENSOR,
|
||||
zcl.clusters.closures.DoorLock.cluster_id: LOCK,
|
||||
zcl.clusters.closures.WindowCovering.cluster_id: COVER,
|
||||
zcl.clusters.general.AnalogInput.cluster_id: SENSOR,
|
||||
|
@ -73,6 +75,7 @@ SINGLE_INPUT_CLUSTER_DEVICE_CLASS = {
|
|||
zcl.clusters.hvac.Fan.cluster_id: FAN,
|
||||
zcl.clusters.measurement.CarbonDioxideConcentration.cluster_id: SENSOR,
|
||||
zcl.clusters.measurement.CarbonMonoxideConcentration.cluster_id: SENSOR,
|
||||
zcl.clusters.measurement.FormaldehydeConcentration.cluster_id: SENSOR,
|
||||
zcl.clusters.measurement.IlluminanceMeasurement.cluster_id: SENSOR,
|
||||
zcl.clusters.measurement.OccupancySensing.cluster_id: BINARY_SENSOR,
|
||||
zcl.clusters.measurement.PressureMeasurement.cluster_id: SENSOR,
|
||||
|
|
|
@ -20,6 +20,7 @@ from homeassistant.components.sensor import (
|
|||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||
CONCENTRATION_PARTS_PER_MILLION,
|
||||
LIGHT_LUX,
|
||||
PERCENTAGE,
|
||||
|
@ -319,3 +320,24 @@ class CarbonMonoxideConcentration(Sensor):
|
|||
_decimals = 0
|
||||
_multiplier = 1e6
|
||||
_unit = CONCENTRATION_PARTS_PER_MILLION
|
||||
|
||||
|
||||
@STRICT_MATCH(generic_ids="channel_0x042e")
|
||||
@STRICT_MATCH(channel_names="voc_level")
|
||||
class VOCLevel(Sensor):
|
||||
"""VOC Level sensor."""
|
||||
|
||||
SENSOR_ATTR = "measured_value"
|
||||
_decimals = 0
|
||||
_multiplier = 1e6
|
||||
_unit = CONCENTRATION_MICROGRAMS_PER_CUBIC_METER
|
||||
|
||||
|
||||
@STRICT_MATCH(channel_names="formaldehyde_concentration")
|
||||
class FormaldehydeConcentration(Sensor):
|
||||
"""Formaldehyde Concentration sensor."""
|
||||
|
||||
SENSOR_ATTR = "measured_value"
|
||||
_decimals = 0
|
||||
_multiplier = 1e6
|
||||
_unit = CONCENTRATION_PARTS_PER_MILLION
|
||||
|
|
Loading…
Add table
Reference in a new issue