ramset
September 26, 2023, 11:30pm
1
A simple driver that accepts a numeric value and presents it as an Air Quality Value
Useful for integrating Air Quality into Homekit
Make sure you remove the temperature capability from the integrated sensor as temperature measurement is not implemented.
Use custom attribute to update the value.
The value can be specified or manually overwritten for testing purposes.
Homekit thresholds and values:
< 0 Unknown (Out of range)
0-50 Excellent
51-100 Good
101-150 Fair
151-200 Inferior
201-500 Poor
> 500 Unknown (Out of range)
/**
* Virtual Air Quality Sensor - Device Driver for Hubitat Elevation
*
* https://community.hubitat.com/t/dynamic-capabilities-commands-and-attributes-for-drivers/98342
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
* for the specific language governing permissions and limitations under the License.
*
* Simple way of processing a numeric value into an Air Quality sensor for integration with HomeKit
*
* Homekit thresholds (value):
*
* < 500 Unknown (Out of range)
* 0-50 Excellent
This file has been truncated. show original
5 Likes
Very useful for Xiaomi Air Purifier HomeKit integration.
You can add the air purifier in HomeKit Integration as a switch, temperature and humidity sensor, but fineDust level is missing.
I've used a local variable to pass the value from fineDust and then i passed it to the Virtual Air Quality Sensor whitch can be integrated as an Air Quality Sensor and it shows the thresholds in HomeKit.
For this integration i have used mi-connector on a RaspberryPi4.
1 Like
Is there a chance to add to that driver parser from remote json data file where air quality value is stored ? For example with 120s data refresh rate
ramset
November 9, 2023, 3:22pm
4
You can use jq to parse the json values (on a separate device like a raspberry pi) and automate refresh push to the MakerAPI
Maybe but it will be another point of failure. Is there another way?
ramset
November 9, 2023, 5:21pm
6
I know HE is capable of HTTP Get and Post via Rule Machine but not sure if that would work for you …