[RELEASE] Free Device Driver for the PurpleAir Air Quality Station - Now with Hubitat support!

It's still working here.

Are you using your own private device or the cloud integration? Did you not get the API announcement from PurpleAir a few days ago (it’s in this thread a couple messages up)

I have both an internal and external PurpleAir device using the cloud API fork I modified to make work with private devices, posted above. I got the announcement but according to the announcement:

It is important to note this update provides no functional changes to our current API...

So I'm hoping it will stay working and it's not just that my devices haven't gotten the firmware update yet, which is possible.

When I get home this evening I will try using:

    if (settings.purpleKey) {
	        url="https://api.purpleair.com/v1/sensors/$purpleID?api_key=$purpleKey"
        } else {
            url="https://api.purpleair.com/v1/sensors/$purpleID"
    }

Note the change from read_key -> api_key.

To my surprise the fork worked as is. I was pretty sure it'd need to be api_key but I guess not.

I contacted PurpleAir support to get the right key.

Can anybody share how to update version 1.1.08 installed using Package Manager to 1.1.10?

I located the updated driver code dated June 4 ( Update to use Purple API · SANdood/PurpleAirStation@275e600 · GitHub) and I can see the changes that were made in comparison to version 1.1.08. But I don't know how to update my version from 1.1.08 to 1.1.10.

Thanks in advance for any assistance.

Edit: I was able to get it updated to 1.1.11 simply by creating a new driver and copying and pasting the code into the window and saving it. However, I was surprised to see that it is asking me for both an API Key and the Station ID. Is that correct for it to be asking for both even with PurpleAir's new API? Anybody know how to find the station ID now that the old JSON webpage is gone?

1 Like

I had a heck of a time finding it, but what I did was to got to the website where my sensor was, click on "get widget", and noted the number. In my case it was 6 digits, not 5 like has been stated before:

Then I requested and received my API read/write keys from Purpleair and used the read key.
Worked for me!!!!

Thank you! That worked

image

Never changes.

Hey everyone. Hope you are well. I am trying to get data from my PurpleAir sensors into Sharptools. My outdoor sensor works great, but the indoor doesn’t pick up data. In case it helps, I’m trying to pick up sensor 133282, which is located in Random Hills VA.

Thanks so much for any help you can offer :slight_smile:

Do you have your Private key, that is the only real difference between the public (Outdoor) and private (Indoor) sensors. The key should have been provided when you registered the device otherwise Purple Air support could probably provide it. The fork below works for both my indoor and outdoor sensors.

Edit:
I figured the payment thing out. You start with 1,000,000 points with a new account. They are credited to your organization, You then have to transfer them to a "Project". Once I added points to my project I started receiving data from a nearby Purple public sensor.

I created a new driver using the gethub code. Says the version is 1.1.10. I was able to go to purple and create a read and write api key. However they now require a payment. Looks to be a minimum of $10.

That explains it. Being the belt-and-suspender kinda guy I am, I prolly burned through my first 100,000 calls in, oh, about a day. :laughing:

Thanks so much

Cross posting: Would it be possible to draw up a driver that would instead of using the cloud, use the local network IP address to provide the data to hubitat?
Apparently MeteoBridge has done that and is pulling the data from the local IP.
The deeper reason are (1) emerging pay for service scheme at PurpleAir (2) sensors going broke (3) needing only local value (related to (1)).

1 Like

I'm encountering the same problem as @Busthead. Current states reports as "timestamp: initializing" but nothing changes. Is this driver working for others? I am hoping to use this to pull data from local sensors listed on the PurpleAir map, and I don't have my own device? Is the functionality of this driver limited to users that have a PurpleAir private key for their device?

I don’t recall what I did to fix this but it’s working for me now. I’m using an API key.

Double check your settings and Save Device again.

Yup!

I have resolved this immediate issue, but I am left with more questoins.

I discovered that Hubitat Package Manager had installed @storageanarchy's driver version 1.1.08. I installed version 1.2.0 from mgroeninger, forked from SANdood, which conform with PurpleAir's current API setup.

I also created an API key for PurpleAir. For other's benefit the process is described here.

This definitely enables communication with PurpleAir, but I have yet to find any devices from the map that I can query successfully. Is it possible that I need to provide a "private key"? Has anyone else had success requesting data from public PrupleAir devices they do not own? If so, what Sation ID are you using (so I could test my setup)?

In the meantime, I have chosen to use the AirNow driver from csteele, installed from Hubitat Package Manager, which provides most of the information I'll need about regional air quality.

This works well (tested and running), and you do not get charged for downloading your own PurpleAir data on your home - or if the PurpleAir does not report to the cloud anymore - which can happen.