Air Quality sensor in homekit bridge

Hello,

I purchase a QingPing Air Monitor Lite. This Monitor integrates 5 sensors including Temperature, Humidity, PM2.5, PM10, CO2.

I found out that there are no Integrations supporting this device. Since this device support homekit protocol natively, I follow this guide to add the sensor through Homekit Controller Integrations. After that, all of the sensor values can be obtained in the Home assistant.

I use the homekit bridge integration to add those sensors to the apple homekit. But I found out that the 2 PM Sensors are missing. 3 sensors named temperature, humidity, CO2 are in sensor entity domain and 2 sensors named PM2.5 and PM10 are in air_quality domain. The homekit bridge cannot recognize the air_qualtiy entity domain as a sensor and cannot be added to the homekit bridge.

I create a temporary solution but is not perfect. I create 2 sensor entity with sensor template as a PM2.5 sensor and PM10 sensor in the configuration.yaml file. These sensor templates can be added to the homekit but seperate 2 sensor units.

I want to add the all of the PM sensors as one unit in homekit. Any perfect solution suggested? Could I add the air_quality entity directly as a sensor through homekit bridge?

When I added the device through the homekit directly, the PM sensor is displaying in this format

# My Sensor template
sensor:
        - platform: template
          sensors:
                         qingping_air_monitor_lite_pm25:
                                friendly_name: "PM 2.5 Sensor"
                                unique_id: "qingping_air_monitor_lite_pm25"
                                value_template: "{{ state_attr('air_quality.qingping_air_monitor_lite', 'particulate_matter_2_5') }}"
                                unit_of_measurement: "μg/m³"
                                icon_template: "mdi:weather-fog"
                         qingping_air_monitor_lite_pm25_pm10:
                                friendly_name: "PM 10 Sensor"
                                unique_id: "qingping_air_monitor_lite_pm10"
                                value_template: "{{ state_attr('air_quality.qingping_air_monitor_lite', 'particulate_matter_10') }}"
                                unit_of_measurement: "μg/m³"
                                icon_template: "mdi:weather-fog"

EDIT:

Form the “home assistant/core” source ode. The Air Quality Sensor type is only defined with 2 Characteristics which are Air Particulate Density and Air Qualitly. Could we add PM2.5 Density and PM10 Density Characteristics to the homekit bridge?

The home assistant entities after I added the device via homekit controller

I make a pull request to solve this problem. The pm sensor in homekit as a AirQualitySensor will now showing in PM2.5 Density or PM10 Density rather than Air Paticulate Density.

But in ultimate goal. I think the homekit bridge should create the sensor unit from air_quality domain directly.

1 Like