I am making available an Edge driver for air quality measurements, that is based on an original Groovy-based driver.
PurpleAir provides realtime monitoring of air quality. You can use your own sensors, or access the many sensors in your geographic area. A free access key can be obtained from their website.
PurpleAir provides a RESTful API to access their sensors via the internet, but because Edge drivers are normally limited to communicating to the local network only, in order to use this driver, you will need to be running my edgebridge application on an always-on LAN computer (Raspberry Pi, Windows, Linux). This application provides a āproxyā or ābridgeā for forwarding the API requests to addresses outside the local network.
Features
Displays AQI, AQI category, and sensor names
Average of multiple sensors within a defined latitude/longitude coordinate box, or use a specific sensor by index number
Automatic periodic updates
Dynamically change the update interval via automations
Thanks to @bthrock for requesting this driver and testing it.
TAustin, I presume this works with their newer Touch Indoor Sensor as well. Does your driver allow reporting of the VOCs, or just the AQI? Iād love a local solution for reading VOC, Iām currently using Amazonās devices, but rely on their Smarthome to flip a virtual switch to accomplish what I want.
Hello - Right now, the devices include only the AQI, but as long as the VOC data is included in the API response, thereās no reason I couldnāt add it.
This is what I see in the docs regarding the voc measurement:
voc Number
VOC concentration (IAQ) in Bosch static iaq units as per BME680 spec sheet, EXPERIMENTAL. Null if not equipped.
Variations:
voc returns average for channel A and B.
voc_a returns channel A data.
voc_b returns channel B data.
Would you just want the voc or do you care also about the channel A and B data?
This sounds cool but I have a couple of questions.
Do you know what data is being returned by voc_a and voc_b? Ģ¶AĢ¶rĢ¶eĢ¶ Ģ¶oĢ¶nĢ¶eĢ¶ Ģ¶oĢ¶fĢ¶ Ģ¶tĢ¶hĢ¶oĢ¶sĢ¶eĢ¶ Ģ¶cĢ¶hĢ¶aĢ¶nĢ¶nĢ¶eĢ¶lĢ¶sĢ¶ Ģ¶bĢ¶eĢ¶iĢ¶nĢ¶gĢ¶ Ģ¶uĢ¶sĢ¶eĢ¶dĢ¶ Ģ¶tĢ¶oĢ¶ Ģ¶rĢ¶eĢ¶tĢ¶uĢ¶rĢ¶nĢ¶ Ģ¶mĢ¶eĢ¶aĢ¶sĢ¶uĢ¶rĢ¶eĢ¶mĢ¶eĢ¶nĢ¶tĢ¶ Ģ¶dĢ¶aĢ¶tĢ¶aĢ¶ Ģ¶fĢ¶oĢ¶rĢ¶ Ģ¶PĢ¶MĢ¶ Ģ¶2Ģ¶.Ģ¶5Ģ¶,Ģ¶ Ģ¶aĢ¶nĢ¶dĢ¶ Ģ¶tĢ¶hĢ¶eĢ¶ Ģ¶oĢ¶tĢ¶hĢ¶eĢ¶rĢ¶ Ģ¶fĢ¶oĢ¶rĢ¶ Ģ¶PĢ¶MĢ¶ Ģ¶1Ģ¶0Ģ¶?Ģ¶
Is there a free tier for API calls, or will we be responsible to pay for our API calls?
Edit: Ģ¶PĢ¶aĢ¶rĢ¶tĢ¶iĢ¶cĢ¶lĢ¶eĢ¶ matter is part of AQI measurements, not VOC.
Edit #2: Correct terms are particulate matter, or particle pollution.
Iāve started to look at the code modifications to add the VOC data. Could you help me out by providing me an example of the response data that includes the VOC value(s), along with the (SmartThings) device settings you use? Iām not entirely clear on if this is coming from sensors within a search box, or from a specific device you have configured, and if the latter, how the data is formatted.
When I signed up, they had just converted over to a points system and I got a million points assigned to my account for free. They get deducted every time I make an API call, so not sure whatās going to happen when I run outā¦
Thatās some useful information, thanks for sharing. I guess how long the free point allotment will last all depends on the individualās call frequency, and after the points are used, weāll need to buy more.
I donāt, at the moment have a Purple Air device. I currently use an Amazon device, the behavior of which is limited because it can only interact with SmartThings via a simple binary switch. I use the VOCs to trigger an exhaust fan when they are over a certain threshold. Iād really like to make the trigger more sophisticated, e.g. the VOCs increased by X or more over Y or less minutes, and that is why I asked about VOCs in your driver.
Itās worth noting that with Toddās driver you have the ability to dynamically change the update interval via automations.
In our area, where smoky skies due to wildfires are part of what we call āsummer,ā AQI has a significant effect on our HVAC automations, so I use the interval change capability to adjust the update frequency based on changing conditions. For example, if the AQI is elevated or changes rapidly, I increase the frequency of updates. If it drops, the call frequency drops.
Also, itāll take me years to use 1 million points, and $10 to buy another. I can live with that.
I really donāt know how the PurpleAir Touch Indoor Air Quality Monitor actually works, so I canāt say 100% for sure if it would work with this driver. The web page says that its data is made available through the āPurpleAir Mapā; if that means it looks like any other PurpleAir sensor on their network, then yes, it should work. In my vicinity I found a couple public PurpleAir sensors that are returning VOC data and Iāve already made modifications to my driver to display that in addition to the AQI.
If you get one and we find issues, Iāll be happy to do whatever we need to to make it work, even if that means a separate Edge driver.
Thatās a really good idea, rather keeping a constant call frequency. The wildfire smoke is a factor here, too, and I was also looking at the PurpleAir Touch but will hold off until I see if it can be supported by this driver. Until then, my Cube air purifiers is running on Auto.
And youāre right, those million points will last a long time for the majority of us.
Thanks for the advice @TAustin in using this driver.
My API key is in the device settings, and I am doing a āSearch for devicesā and have put in my lat and log and increased the search box size to 25 as well. But I am getting a 402 error in the Bridge server. when pasting the link from the bridge server into a browser I get the following
{
āapi_versionā : āV1.0.11-0.0.47ā,
ātime_stampā : 1690585572,
āerrorā : āApiKeyMissingErrorā,
ādescriptionā : āNo API key was found in the request.ā
}
What am I doing wrong?
It looked like he may need to have followed this procedure to ensure that his assigned points are useable:
Your organization starts with one million points. However, these points are not added to any projects yet. On https://develop.purpleair.com/ home, select the āProjectsā tab. Next to the project you want to add points to, select the āUpdate Projectā button. Near the top of this pop-up is your organizationās total number of points. Below that, you can enter the number of points to give to this project. Once that is updated, your API keys will work once more.
(1) If I am the owner of both outdoor and indoor PurpleAir sensors and I have direct LAN access to the sensors, is there any way to use this driver without going through the external API and spending API points?
(2) How can I add an additional device to monitor a second specific PurpleAir sensor?
I was able to answer my own question (2) about how to add an additional device.
I used vEdge Creator V2.94 to create a virtual air quality sensor and then changed the driver of that device to āPurpleAir AQI v1.0ā. After filling in the settings, it now provides me an additional PurpleAir sensor device in SmartThings.
I donāt know what the direct interface to the devices is. If it replicates the cloud-based API, then it may be possible to get it to work. DM me if you want to discuss further.
Regarding what you did to create a second device, Iām very surprised that would even work! Regardless, giving the ability to create additional PurpleAir devices is a feature I can add, but just never did since no one asked before. But if you are happy with what you have, then that may not be necessary!