Weather Underground’s Next Frontier: Air Quality

For the DIY’ers, if you are interested in tinkering with this type of sensor a number of reasonably priced laser PM sensors suitable for this application can be found by searching ebay for “Plantower”. Prices start around $20.

More info here.

Will that be available also in the updated ZIP version?
yes, of course as for
https://map.purpleair.org/json?show=SENSOR_ID'
what is say your sensor ID, to see if that works? (there is a sensor ID in the airquality.txt file, but where and how do you use that in the above url?) ah, nevermind, you just need to have "" around the ID

but that still does not seem to show the other channel data?

Niko, thank you for providing the link to the ‘Worldwide Air Quality’ site - quite interesting, very informative. Just wish my dexterity, my sight and my brain cells were a bit younger … I would certainly get involved into building my own air quality sensor… :oops:

Brian, the ID found in the ‘airquality.txt’ data file is not the sensor ID. To view the data uploaded by my PurpleAir unit to the Thingspeak cloud storage, use the following link:

https://map.purpleair.org/json?show=1256

Using the above link in a browser will display a JSON data file. Using the above link as the IP Address in the software ‘cronairquality.exe’ will download the JSON data file (and overwrite the previously saved data file). :wink:

ing the above link in a browser will display a JSON data file. Using the above link as the IP Address in the software 'cronairquality.exe' will download the JSON data file (and overwrite the previously saved data file)
yes of course, but that is not what would happen instead the cronairquality.exe program would get both lots of data (local IP and then from the purple air site, to 2 different file names) where /how does the owner get the ID? (e.g 1256

also I see that json data has two
“PM2_5Value”:
values, I assume the first is one channel the other is the other channel?

Indeed. The software ‘cronairquality.exe’ by itself (without an external additional configuration file) could download the data from the local PurpleAir unit (channel #1) to the file ‘airquality.txt’ (as it does presently).

The software ‘cronairquality.exe’ with (using) an external additional configuration file could download the data from:

  • either the local PurpleAir unit (channel #2) to a file with a different name (a name other than ‘airquality.txt’ to prevent overwriting)
  • or from the Thingspeak cloud storage (channels #1 and #2), again, to a file with a different name (a name other than ‘airquality.txt’ to prevent overwriting)

The unit ID number is supplied with the unit when it is sold.

Indeed, again, the two ‘PM2_5Value’ values represent the two channels.

I am attaching the PDF file ‘Using PurpleAir Data’ that will identify the parameters found in the file downloaded from the Thingspeak cloud storage.


Using PurpleAir Data.pdf (85.4 KB)

I am thinking though currently its not known how to get the second channel data from the local json data?
I can make so that in the setup in WD the user enters their sensor ID so that the data can be downloaded from the cloud data to make sure the channel A (local) is OK (i,e compares OK)…if one is much too high (different), then the lesser is used, yes?

Brian, to make things a bit more simple, and since getting any data other than for the PM2.5 is unnecessary (such as PM1.0 and PM10.0), it might be more useful to only get the data for both channels from the Thingspeak cloud storage (using the PurpleAir unit ID).

This is what I have been doing with one of my PHP script, I download the data, extract the data from the first ‘PM2_5Value’ (channel #1), extract the data from the second ‘PM2_5Value’ (channel #2), ensure that the values do not exceed 500, compare the value from channel #1 to the value of channel #2 and use the value of channel #1 if it is within the range of the value from channel #2 (range would be

that sounds like a good idea
then people do not need to worry about finding the IP address of their local device and needing to make that a fixed IP etc

one thing, using the cloud data
which one of these data points is the other micron sizes?
{"v":5.44,"v1":5.582239810294803,"v2":6.025010763633549,"v3":5.927219052577544,"v4":6.145393002971199,"v5":5.514878692977332,"v6":21.797971012049327,"pm":5.44,"lastModified":1503286165055,"timeSinceModified":80241}"}]}
maybe v1 is the 1.0?

None of them - only the data for the PM2.5 is available from the link - for both channel #1 and channel #2.

Brian, if you have a look at the ‘Using PurpleAir Data.pdf’ file I mentioned above, you will have your answer to the purpose of the other parameters.

As I mentioned in the previous message, after reading more about the air quality index (on other sites), of the different particulate matter (PM) values, only the 2.5 (PM2.5) appears to be used for the calculation, the PM1.0 and PM10.0 seem to be ignored or unused.

As I have suggested many times, there is probably more data that can be downloaded, both from the local network (such as the data from channel #2) and from the Thingspeak cloud storage - it is my understanding that there is a lot, a lot more data on that Thingspeak cloud storage, enough to create hourly, daily, weekly and yearly graphics … but it appears that the designer/reseller behind the PurpleAir unit does not want to share the information on how to access that data (certainly not with me, even after multiple messages/requests :x ).

I could still use both sources then…local IP and cloud data (the cloud data to get the other channel 2.5 reading, for use as a back up)
so as to get the other micron data from the local IP data

Indeed, Brian, you could use both URL. But…

I still think that the data from the Thingspeak cloud storage (ie: ‘https://map.purpleair.org/json?show=SENSOR_ID’) should be the default procedure (option) and, true, we would obtain the data for PM2.5 (only), but the data for both channels - we would have a backup channel.

There could be an option to also download a single channel with the data for all three PM (PM2.5, PM1.0 and PM10.0).

That is why in a previous message I was suggesting that the software ‘cronairquality.exe’ had the flexibility to possibly use an external setting file so that the software ‘cronairquality.exe’ could download data from multiple locations/sites without overwriting the saved data file (thanks to its external configuration file).

I do like the idea of not having to mess around with a local IP address and just use the sensor ID that is provided with the sensor
and since it looks like the PM 2.5 value is the important one, and only one needed or the air quality index, then we can get that value (for both channels) via the purpleair.com cloud data

one other advantage of using the cloud data is I could make it where another sensor ID could be monitored (e.g via custom tags)

I do have others interested in this feature in WD (via email and via the WD Facebook page ) :slight_smile:

maybe have it optional to get the data data via the local sensor IP address

this update
http://www.weather-display.com/downloadfiles/weatherdisplaytest.zip

allows to set the sensor ID

and so the PM2.5 value is used from the cloud site (I still need to compare the 2nd channel data and use that if the first channel data is out of range)

and you can set to use the local IP to get the other data (1.0 and 10.0)

also you can set to upload the gauge and graph to your web site (see in the misc setup)
(aqi.gif and aqigraph.gif)

Brian, big, BIG, BIG problem!

I just had a look at the computer running the test version of Weather Display, the one downloading the data from the PurpleAir sensor using the software ‘cronairquality.exe’ and had an unusual Windows error message stating that the computer had run out of memory to run a specific software. I then look at the tasks running and found hundreds (yes, hundreds) of ‘cronairquality.exe’ running. I had to shut off every software running and reboot the computer to clear out the ‘infestation’. I have now deactivate the download of the PurpleAir data.

I have downloaded the latest test version of Weather Display and will check its behaviour…

Brian, the latest versions of Weather Display and the software ‘cronairquality.exe’ have been running for about 30 minutes without ‘infestation’. :wink:

One thing I have noticed is that the setting for the option to ‘Use local data (for 1.0 and 10.0 PM size data)’ does not remain set - if, on the ‘Purpleair Air Quality Sensor’ screen, I set the option to ‘Use local data (for 1.0 and 10.0 PM size data)’, clicked the ‘OK’ button to save the setting and exit the window and then, a few minutes later, I go again on the ‘Purpleair Air Quality Sensor’ screen, the check mark in front of the option to ‘Use local data (for 1.0 and 10.0 PM size data)’ is gone.

ops
try downloading again , same url, re test .zip update, to fix that setting

Brian, can both downloads (ie: from the Thingspeak cloud storage and the local network) be done or is it one or the other but not both?

Might be practical if both downloads could simultaneously be done (take place), if technically possible - both ‘airquality.txt’ (from the local network download) and ‘airquality2.txt’ (from the Thingspeak cloud storage download) could be created/produced at regular intervals and possibly uploaded to the same directory where Weather Display normally uploads its data files (such as for example, ‘clientraw.txt’, etc.).

Having both PurpleAir data files produced and uploaded would allow PHP script developers to process that data and use it on web pages.

they can be both done (they are one at the same time, by the cronairquality.exe)
(one is airquality.txt the other is airquality2.txt)
that is how I have it now, with the latest .zip update

Brian, I just installed/updated the files (‘cronairquality.exe’ and ‘weatherdisplay.exe’) from the latest ZIP (2017-08-22 @ 02:11).

I think you might have misunderstood my previous message. What I was suggesting was that both PurpleAir data files (both ‘airquality.txt’ and ‘airquality2.txt’) be created simultaneously (at the same time) when a check mark is placed in front of the ‘Use local data (for 1.0 and 10.0 PM size data)’.

As I tried to explain, it is my thinking that the priority should be given to the PurpleAir data file downloaded from the Thingspeak cloud storage (the data file might only contain values for the PM2.5, but the data file also contains the PM2.5 values for both channels, so we have data backup for the PM2.5 in case something goes wrong with one of the channels of the PurpleAir unit) - this should be the default download when there is no check mark in front of the ‘Use local data (for 1.0 and 10.0 PM size data)’ - this mean that only the ‘airquality2.txt’ data file is created (this would become the default PurpleAir data file).

When there is a check mark in front of the ‘Use local data (for 1.0 and 10.0 PM size data)’, then, first, the PurpleAir data file is downloaded from the Thingspeak cloud storage, and then, second, the PurpleAir data file is downloaded from the local networked PurpleAir unit - this mean that both the ‘airquality.txt’ and ‘airquality2.txt’ data files are created.

If the weather station operator enters only the basic setting (ie: just the sensor ID and nothing else), then, by default, the PurpleAir data is downloaded from the Thingspeak cloud storage - this would create only the ‘airquality2.txt’ data file.

If the weather station operator enters additional settings (ie: the sensor ID + URL to local networked PurpleAir unit + check mark in from of ‘Use local data (for 1.0 and 10.0 PM size data)’), then, by default, the PurpleAir data would first be downloaded from the Thingspeak cloud storage and then, the PurpleAir data wouldl (second) be downloaded from the local networked PurpleAir unit - this would create both the ‘airquality.txt’ and ‘airquality2.txt’ data files.