Virtual AirQuality driver anyone?

Has anyone built a generic Virtual AirQuality capable driver that takes a numeric value as a parameter?

Take a numeric value as a parameter and does... what with it? Not trying to be difficult, trying to understand the request.

A couple of my weather drivers take a PM2.5 value AND a regional parameter set by the user to generate the Air Quality Index (value and string) for that user's region. It is not a separate driver, but the function could be easily copied and a driver made so it would be standalone (and PM2.5 could be input). Is that the type of thing you are looking for?

Oh i should have been clear as your question makes sense.

I have several sensors outside of the Hubitat zigbee/z-wave realm. They feed data into Hubitat via Maker Api and then into the apple environment.

For instance I have a radon monitoring device that reports radon values.

Data provided by the radon sensor, is processed and grouped based on value in the 1-5 AQI categories (this is done locally post publishing to the Maker API), which then sets the Virtual AQI value based on that (via Maker API). Then the Virtual AQI sensor value is interpreted in Homekit and displayed as such.

I need a simple virtual AQI driver that accepts a numerical value as a parameter in order for me to pass it on to HomeKit as an Air Quality sensor.

For instance on the Virtual Temperature Sensor, you can push the desired sensor value via Maker API :blush:

I need the same for the airQuality capability

I took the Virtual Omni Sensor and modified it so it would store data from an Amazon Air Quality Monitor coming from Home Assistant. The code for the Virtual Omni Sensor is available but I don't remember exactly where it's saved. I can post my code if you want to take a look to get you started. Otherwise, let me do some digging to find the code for Virtual Omni Sensor.

I got this far:

Doesnt seem to pass the value to Homebridge:

1 Like

I have 2 virtual drivers used with Air Gradient sensors. They push their values to HE via Maker API. Creating a driver to do this shouldn't be hard but you do need to know what information your sensor produces. Can you control what url they call to send the data to HE.

You do nee dto know what data your devices can send to HE though.

I just need the virtual sensor to catch any numerical value it’s being thrown at it and relay that to homebridge-hubitat as an Air Quality value

Ok. But the virtual sensor doesn't have anything to do with relaying to Home bridge per se. It will just track the thing it is setup to do. So from the device page if you put a number in for that command does it update the value for the state you want and update home bridge?

If it does then simply have your device call the correct url to run a command and pass the parms after it.

I have the above code catch the device’ output.

It outputs a number and the code I came up with above is updating it’s value however the sensor in homekit shows excellent quality regardless of value :slight_smile:

Ok so homekit isn't updating. This isn't really a driver issue. Does homekit support these attributes?

Have you checked with the Homebridge folks to see what could keep it from updating.

Scratch that. It was user error.

It works … i should probably release this as a plain Air Quality Driver :blush:

I’m good :blush:

Data is feeding in real time in Homekit now via the AQI sensor :slight_smile:

2 Likes

Not versed enough to follow the entire discussion, but did pick up the above.
Do you mind sharing which device you have?

Sure thing. I have the RadonEye RD200.

I bluetooth capture the broadcast every minute and convert it into a metric that I can report from :blush:

What does it take to get radoneye rd200 into hubitat? I have one and would love to get it integrated. I'm quite the novice with this stuff and had a hard time following what else was used and how radoneye connects to hubitat. This is one of two threads I can find on the hubitat forum that mention radoneye.

Is there any other special hardware required? I have HE C8. Appreciate any direction you can provide!
Thank you!

Radoneye is very chatty on bluetooth. It broadcasts the values constantly.
You need to capture that data (i do it on a separate raspberry pi) and pass the value to hubitat via MakerAPI to one of these virtual ai quality sensors.

I used this (with slight modification to fit my use case):

I separately store the values and they look like this:

Awesome! Thank you for the tip! I'll play around and see what I can do with it. Is there a rpi version you would recommend for this?

If you’re not planning on having anything else memory intensive on it, a zero-w is more than enough. A 3 would do also, a 3b …
Whatever you find on the cheap side :slight_smile:

Perfect! Thank you!