PurpleAir AQI Sensor not found [Solved]

Found this error this morning from Arcola, Virginia, USA Home Weather Station (wd version) (novawx.dscloud.me): Problem 59: No sensor found Check settings and data.

My sensor is reporting on my website ( Willowsford Farm - PurpleAir Realtime Air Quality (novawx.dscloud.me)) and on the purpleair map. The latest (9 Sep 23) PWS updates are installed on my system. Any ideas why the AQI sensor is reported as missing. My sensor, along with ll the others in my area are reporting “0” AQI.

Have you run out of points? :wink:

Your /jsondata/purpleair.txt says

Nope, I have over 602,000 left

Left where? In your Organization or your Project?

Whatever, it seems PAir doesn’t recognise your API key. . .

In my project. My API key hasn’t changed nor have I changed any PWS settings.

The API Key seems to be working on my wxpurpleair.php page that gets my PurpleAir Sensor ID and API key from Ken’s purpleair-inc.php.

Where does PWS get the API key? In PWS_easyweathersetup.php, in the Devices tab, it has my PurpleAir Sensor ID, the same Sensor ID as in the purpleair-inc.php file. I don’t see a location to enter my Sensor ID in the Api&Keys tab in PWS_easyweathersetup.php.

Line 4 of the new PWS_load_files.php. Comment line 3:

2 # test version purpleair API  NOT a general update 
3 #$purpleairAPI   = '72F1 . . . 242';  // OLD obtain a developer key by e-mail at purpleiar
4 $purpleairAPI   = 'X34 . . . 009';  // latest api key  # 2023-09-04 
5 # test version for the paid for purpleair API 

See Charges for PurpleAir API calls - #24 by pwsdashboard

There might have been an update for that script since then?

I had the same problem as @novawx. I updated my PWS_load_files.php based on the information provided by @bitsostring and it’s working once again. Thank you @bitostring and Wim for (once again) updating the dashboard files due to a change driven by a data provider.

I’m not happy with the way PurpleAir has implemented their APIs, but they have made a few comments that they don’t want to charge to get your own data and that their API implementation will continue to evolve, so I’m hopeful.


So, the issue isn’t that I’ve run out of points, it’s the implementation of PWS_load_files.php? That file on my server is dated 2023-09-09. Looks like I need my current API on line 3 and then I have to request a new one and enter it on line 4?

If I get a new key, then I have to update my WD and Saratoga Weather implementation I assume with the new key. Ugh!

No, you already have a new key so just enter it in line 4. Line 3 was the old free API key, so you could even just delete line 3: I expect Wim left it there so he could switch back and forth.

Note also that the call to the PurpleAir API in PWS_load_files.php has been modified to cost fewer points per call, as mentioned in the link I gave.

Perfect, got it and thanks. Looks like it worked.

It’s also interesting my AQI has been near zero for almost 48 hours, along with all the others in my area, due to Tropical Storm Ophelia. I always thought it was the clean Canadian air that helped our air quality. I guess the tropics can help too.

If you want to track the API usage of your individual sites, you can create another API key and assign some of your points to it in the PurpleAir developer portal.

I’m across the river in Maryland and saw the same impact from Ophelia - AQI at or near 0 this weekend and up to 10 today.

I have different API keys for my PWS_Dashboard and Saratoga “Projects” so I can keep track of the usage separately.

Im a bit confused here, after I installed the updated files i got the same problem 59 error too.

I just restored from yesterdays server back up and it worked again.

Can I leave it like this, or do I need to change over?

I’m a bit confused, too: which updated files?

AFAIK the new version of PWS_load_files,php referenced here is only for users that have a new, paid API key from PurpleAir. Users with an old, free API key do not need to change: I think that still works.

One has to put the user API which one got from Purpleair, ( either last year or a few weeks/ months ago) in the script n the first few lines.

Multiple old (test) versions of the scripts use one of my development keys which were only valid for the development to adapted the scripts to use an API-key.
But the validity those development keys are or will all end shortly.

Just make sure that you enter your API key in settings or the script.

As soon as I can acces the scripts I will add exemaples were and how to add.

Sorry for the confusion.


1 Like