Skip to content

Develco Air Quality Sensor #995

@EverythingSmartHome

Description

@EverythingSmartHome

Hello!

Firstly, this is not a bug but wasn't sure where else to put this.

I have managed to come up with a custom quirk for a Develco Air Quality sensor that seems to be working so far, I now have the air quality values showing up correctly under "Manage Clusters", and I can retrieve the correct values etc which is great and better than it was before, but I can't figure out how to get this into a Home Assistant sensor. What have I missed?

Any suggestions would be greatly appreciated, once I can get this working I will be happy to put in a PR!

"""Develco Air Quality Sensor"""
from zigpy.profiles import zha
from zigpy.quirks import CustomCluster, CustomDevice
import zigpy.types as t
from zhaquirks import Bus, LocalDataCluster
from zigpy.zcl.clusters.general import (
    Basic,
    BinaryInput,
    Identify,
    OnOff,
    Ota,
    PollControl,
    PowerConfiguration,
    Scenes,
    Time,
)
from zigpy.zcl.clusters.measurement import TemperatureMeasurement
from zigpy.zcl.clusters.measurement import RelativeHumidity
from zigpy.zcl.clusters.security import IasZone

from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.develco import DEVELCO, DevelcoPowerConfiguration

MANUFACTURER = 0x1015
VOC_MEASURED_VALUE = 0x0000
VOC_MIN_MEASURED_VALUE = 0x0001
VOC_MAX_MEASURED_VALUE = 0x0002
VOC_RESOLUTION = 0x0003

class DevelcoIASZone(CustomCluster, IasZone):
    """IAS Zone."""

    manufacturer_client_commands = {
        0x0000: (
            "status_change_notification",
            (
                IasZone.ZoneStatus,
                t.bitmap8,
                t.Optional(t.uint8_t),
                t.Optional(t.uint16_t),
            ),
            False,
        )
    }

class VOCMeasurement(CustomCluster):
    cluster_id = 0xfc03
    name = "VOC Measurement"
    ep_attribute = "voc_measurement"
    manufacturer_attributes = {
        VOC_MEASURED_VALUE: ("MeasuredValue", t.uint16_t),
        VOC_MIN_MEASURED_VALUE: ("MinMeasuredValue", t.uint16_t),
        VOC_MAX_MEASURED_VALUE: ("MaxMeasuredValue", t.uint16_t),
        VOC_RESOLUTION: ("Resolution", t.uint16_t)
    }
    server_commands = {}
    client_commands = {}

    def _update_attribute(self, attrid, value):
        super()._update_attribute(attrid, value)

class AQSZB110(CustomDevice):
    """Custom device air quality sensor"""
    manufacturer_id_override = MANUFACTURER

    signature = {
        # <SimpleDescriptor endpoint=1 profile=49353 device_type=1 device_version=1
        # input_clusters=[3, 5, 6] output_clusters=[]>
        # <SimpleDescriptor endpoint=38 profile=260 device_type=770 device_version=0
        # input_clusters=[0, 1, 3, 32, 1026, 1029, 64515] output_clusters=[3, 10, 25]>
        MODELS_INFO: [(DEVELCO, "AQSZB-110")],
        ENDPOINTS: {
            1: {
                PROFILE_ID: 49353,
                DEVICE_TYPE: 1,
                INPUT_CLUSTERS: [
                    Identify.cluster_id,
                    Scenes.cluster_id,
                    OnOff.cluster_id,
                ],
                OUTPUT_CLUSTERS: [],
            },
            38: {
                PROFILE_ID: 260,
                DEVICE_TYPE: 770,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    PollControl.cluster_id,
                    TemperatureMeasurement.cluster_id,
                    RelativeHumidity.cluster_id,
                    0xfc03,
                ],
                OUTPUT_CLUSTERS: [3, 10, 25],
            },
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: 49353,
                DEVICE_TYPE: 1,
                INPUT_CLUSTERS: [
                    Identify.cluster_id,
                    Scenes.cluster_id,
                    OnOff.cluster_id,
                ],
                OUTPUT_CLUSTERS: [],
            },
            38: {
                PROFILE_ID: 260,
                DEVICE_TYPE: 770,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    PollControl.cluster_id,
                    TemperatureMeasurement.cluster_id,
                    RelativeHumidity.cluster_id,
                    VOCMeasurement
                ],
                OUTPUT_CLUSTERS: [3, 10, 25],
            },
        },
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssue is inactivate and might get closed soon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions