diff --git a/homeassistant/components/zha/core/channels/measurement.py b/homeassistant/components/zha/core/channels/measurement.py index 99d062d4c3e..77351441b56 100644 --- a/homeassistant/components/zha/core/channels/measurement.py +++ b/homeassistant/components/zha/core/channels/measurement.py @@ -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), + } + ] diff --git a/homeassistant/components/zha/core/registries.py b/homeassistant/components/zha/core/registries.py index 5fe7f806355..6bb9e155b0f 100644 --- a/homeassistant/components/zha/core/registries.py +++ b/homeassistant/components/zha/core/registries.py @@ -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, diff --git a/homeassistant/components/zha/sensor.py b/homeassistant/components/zha/sensor.py index 714df80eebb..b9a86b79063 100644 --- a/homeassistant/components/zha/sensor.py +++ b/homeassistant/components/zha/sensor.py @@ -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