Author Topic: How to post air quality data?  (Read 1484 times)

0 Members and 1 Guest are viewing this topic.

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
How to post air quality data?
« on: September 30, 2020, 01:34:48 PM »
I have an Airlink, and I made a little Python script that builds the AQI that I'm interested in (the 10 minute average of the US EPA PM2.5 AQI). If anyone is interested in that script, it's here:

https://www.wxforum.net/index.php?topic=40489

Now I'd like to post it to our webpage, with a history graph, a way to help people interpret it, and a little eye candy.

Does anyone know of a service that does all that, in a way that lets me embed the data on my site?

I"m trying to avoid reinventing the wheel.
« Last Edit: September 30, 2020, 02:18:41 PM by wrybread »

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #1 on: September 30, 2020, 07:31:39 PM »
Can see the work in progress at the bottom of this page:

https://www.lawsonslanding.com/webcam.html

« Last Edit: September 30, 2020, 08:34:39 PM by wrybread »

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6447
    • Lee's Summit, MO
Re: How to post air quality data?
« Reply #2 on: September 30, 2020, 07:42:26 PM »
Who currently maintains "your webpage"?

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #3 on: September 30, 2020, 07:45:36 PM »
A few different people, including myself. I didn't set it up initially, but I contribute to it. On that page I built the live updating wind gauge, the Python script that builds the tide chart, and now the air quality measurement system. The wind and weather data come from a Davis Vantage Pro that interfaces with a Raspberry Pi using weeWx.

And I maintain the webcam. Which is fun, it's pretty active, here's a timelapse of a full year:



Sadly the pier was just taken down.

Why do you ask?
« Last Edit: September 30, 2020, 08:14:15 PM by wrybread »

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: How to post air quality data?
« Reply #4 on: September 30, 2020, 08:38:24 PM »
Weeeeeell .........

The 'Lawsons' site is hosted by weebly who don't allow server side scripting, but an interesting work-around is retrieving dynamic formatted data via 'sinkingsensation' web site !
« Last Edit: September 30, 2020, 08:40:04 PM by the beteljuice »
Imagine what you will KNOW tomorrow !

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #5 on: September 30, 2020, 08:41:40 PM »
Yup, weebly is pretty absurdly restrictive, but nothing a little javascript and duct tape can't fix.

I wasn't involved (or around) during the choice to host this website on Weebly of course.

« Last Edit: September 30, 2020, 09:00:47 PM by wrybread »

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6447
    • Lee's Summit, MO
Re: How to post air quality data?
« Reply #6 on: September 30, 2020, 09:03:38 PM »
A few different people, including myself. ....

Why do you ask?

So, none of those different people can (or are willing to) help you.  OK

Just find a local highschool studant geek to figure out how to do what you want done. 

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #7 on: September 30, 2020, 09:04:40 PM »
Quote
So, none of those different people can (or are willing to) help you.  OK

Just find a local highschool studant geek to figure out how to do what you want done.

[deleted, with apologies]





« Last Edit: October 01, 2020, 06:29:24 PM by wrybread »

Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6447
    • Lee's Summit, MO
Re: How to post air quality data?
« Reply #8 on: September 30, 2020, 09:13:01 PM »
Quote
So, none of those different people can (or are willing to) help you.  OK

Just find a local highschool studant geek to figure out how to do what you want done.

Huh? Are you having a bad day?

Why on earth would I want the help of a "highschool studant"? Hopefully your other 6000+ posts here are more constructive.

Well, thanks for the insulting comment.

You asked "I"m trying to avoid reinventing the wheel."

I was attempting to help.  If nobody who is "in charge of" the site will help you, then you don't really need a "service".  There are plenty of highschool students who are completely capable of doing what you DESCRIBED that you want to do.

But nevermind - I'm out of this discussion.

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #9 on: September 30, 2020, 09:19:25 PM »
Apologies, I deleted the comment about your other posts right away. I guess I misread your intention with that post.

Anyway, thanks for your advice.




Offline dalecoy

  • Forecaster
  • *****
  • Posts: 6447
    • Lee's Summit, MO
Re: How to post air quality data?
« Reply #10 on: September 30, 2020, 09:33:11 PM »
Apologies, I deleted the comment about your other posts right away. I guess I misread your intention with that post.

Anyway, thanks for your advice.

Apology accepted, of course.  And I hope that someone else will suggest a solution that will be more acceptable.

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: How to post air quality data?
« Reply #11 on: September 30, 2020, 11:17:13 PM »
You still are not completely describing the situation.

Is the 'Lawsons' weebly hosted site yours, or do you intended only to provide possible content ?

Do YOU have any webspace that is NOT weebly hosted ?

You obviously have coding experience, but suggest you are ignorant of ftp (or restricted by weebly ?)

If we don't know the problem, then we can only second guess solutions  #-o

Certainly the owner of 'Lawsons' should think about getting some cheap, unrestricted webspace !!!!
Imagine what you will KNOW tomorrow !

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #12 on: September 30, 2020, 11:28:00 PM »
> suggest you are ignorant of ftp (or restricted by weebly ?)

I guess it was too distracting to post the full link to the website. I'm restricted by Weebly, it's not my website (I only work on it sometimes), and not my decision to change hosting. They like the CMS, etc.

But I guess I wasn't clear. I'm just wondering about any existing embedable AQI widgets, especially one that shows a map like the PurpleAir map. The widget part is mostly irrelevant now since I'm almost done with that, but still curious about a map of AQI's that is embeddable and that I can post to without a paid service, if anyone has any info there.

« Last Edit: October 07, 2020, 02:03:18 AM by wrybread »

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #13 on: September 30, 2020, 11:48:59 PM »
And oof, AQI here just north of San Francisco is pushing into the hazardous zone!

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: How to post air quality data?
« Reply #14 on: October 01, 2020, 12:25:19 AM »
Quote
But I guess I wasn't clear.
... about as clear as a presidential debate.

Any graphic should, for the most part, be able to be 'lifted' using the techniques already employed in the page  ;)
Imagine what you will KNOW tomorrow !

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #15 on: October 01, 2020, 12:32:51 AM »
Quote
Any graphic should, for the most part, be able to be 'lifted' using the techniques already employed in the page

Good point, but it's a commercial website, and I wouldn't want to infringe on anyone else's copyrights. Currently I'm embedding content that I myself am generating and own. (In case it's not clear, sinkingsensation.com is my server.)

And whoo hoo! New-and-improved, now with a graph! That's going to look really nice once I have a few days of uninterrupted data.

Hazardously deteriorating air quality has never looked so pretty to me.
« Last Edit: October 01, 2020, 03:03:59 AM by wrybread »

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #16 on: October 01, 2020, 06:30:48 PM »
I guess another way to put it is, for people who have an AirLink, where do you post your data?

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #17 on: October 04, 2020, 02:08:43 PM »
New and improved again, now everything updates once a minute without having to reload the page.

https://www.lawsonslanding.com/webcam.html

I haven't looked closely but I think I used the same graphing library that PurpleAir does (flot).

Been an interesting time to be working on this project, watching the AQI go from 40 to 170 sometimes over just a couple of hours. Also interesting that when I see a visible haze from the fires the AQI doesn't necessarily go up. Sometimes it's hard to tell the difference between fog and smoke haze here on the northern california coast though.

I'd really like to make a graph showing the air quality versus wind direction, and how the wind affects the air quality here. Once we get the NW winds blowing off the ocean our air quality gets better quickly.


Online johnd

  • Forecaster
  • *****
  • Posts: 4827
    • www.weatherstations.co.uk
Re: How to post air quality data?
« Reply #18 on: October 04, 2020, 02:29:34 PM »
I guess another way to put it is, for people who have an AirLink, where do you post your data?

Aren't most Airlink users simply using the default map at: https://www.weatherlink.com/map

You need to choose the AQ overlay. I think the map only shows AL users who have declared their sensor as outside. The embed is like:

<iframe src='https://www.weatherlink.com/embeddablePage/show/e48e027cec0b4e8b84d02a53ca1c1742/airLink' width='560' height='480' frameborder='0'></iframe>
« Last Edit: October 04, 2020, 02:35:48 PM by johnd »
Prodata Weather Systems
Prodata's FAQ/support site for Davis stations
Includes many details on 6313 Weatherlink console.
UK Davis Premier Dealer - All Davis stations, accessories and spares
Cambridge UK

Sorry, but I don't usually have time to help with individual issues by email unless you are a Prodata customer. Please post your issue in the relevant forum section here & I will comment there if I have anything useful to add.

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #19 on: October 04, 2020, 02:35:23 PM »
I saw that map, but it's pretty barebones.

- doesn't seem to be a way to see the air quality overlay by default (users have to select it)

- doesn't seem to be a way to link to a specific location

- can't see any historical data

All those are deal breakers for my purposes (making an air quality gauge that our customers can easily see from our website). The absence of historical data seems like it would be a dealbreaker for everyone.

It looks to me like AirLink has a bit of catch up work to do with PurpleAir. All easily done of course.



« Last Edit: October 04, 2020, 02:36:58 PM by wrybread »

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #20 on: October 04, 2020, 02:45:22 PM »
And thanks, that Davis widget looks good. For anyone else who comes this way:

- go to weatherlink.com/map and log in

- at top right click "share and uploads"

- it'll give you a link to your widget

Mine had extra data like wind speed, which would be blank, but the one johnd posted is just data that Airlinks post:

https://www.weatherlink.com/embeddablePage/show/0362e50c05e34c9f90c45cd78a3bff3a/airLink

Still no historical data, but I don't pay for their "pro" account. I wonder if the widget gives historical data for pro accounts?

And a minor issue is that it doesn't seem to be averaging out the readings, just posting the pm_2p5_aqi that the AirLink posts. Not even the "nowcast aqi". Would be nice if they posted a 10 minute average like PurpleAir, since my non averaged AQI varies by as much as 20 from minute to minute.
« Last Edit: October 04, 2020, 02:59:21 PM by wrybread »

Online johnd

  • Forecaster
  • *****
  • Posts: 4827
    • www.weatherstations.co.uk
Re: How to post air quality data?
« Reply #21 on: October 04, 2020, 03:07:08 PM »
Mine had extra data like wind speed, which would be blank

Yes, I corrected my example link manually. I'll try and get that issue fixed. Remember AL is a new product and what you're seeing is just v1 of the embed - it's possible that representation to Davis could update exactly what's shown. But pretty sure that you'll only ever get historical data if you have Pro and that wouldn't change the embed anyway.
Prodata Weather Systems
Prodata's FAQ/support site for Davis stations
Includes many details on 6313 Weatherlink console.
UK Davis Premier Dealer - All Davis stations, accessories and spares
Cambridge UK

Sorry, but I don't usually have time to help with individual issues by email unless you are a Prodata customer. Please post your issue in the relevant forum section here & I will comment there if I have anything useful to add.

Online johnd

  • Forecaster
  • *****
  • Posts: 4827
    • www.weatherstations.co.uk
Re: How to post air quality data?
« Reply #22 on: October 06, 2020, 04:01:54 AM »
Mine had extra data like wind speed, which would be blank, but the one johnd posted is just data that Airlinks post:

Davis are now aware of this, acknowledging a probable bug and it's on the list for fixing asap.
« Last Edit: October 06, 2020, 04:17:09 AM by johnd »
Prodata Weather Systems
Prodata's FAQ/support site for Davis stations
Includes many details on 6313 Weatherlink console.
UK Davis Premier Dealer - All Davis stations, accessories and spares
Cambridge UK

Sorry, but I don't usually have time to help with individual issues by email unless you are a Prodata customer. Please post your issue in the relevant forum section here & I will comment there if I have anything useful to add.

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #23 on: October 07, 2020, 01:57:51 AM »
Awesome @johnd!

And for anyone interested in uploading data from the AirLink, I moved the process to an ESP32 (similar to an Arduino) that gets the data from my AirLink and uploads it to my webserver, where a Python script converts the readings to AQI's and enters the values into a database.

For anyone who doesn't know, the ESP32 is a bit like an Arduino, except that it's cheaper (as low as $4) and has onboard wifi and bluetooth. Amazing little gizmos, total workhorses and they do a great job of uploading the AirLink's data. A Raspberry Pi or similar would work too of course but ESP32's don't need to be shutdown, they can just be unplugged, there's no bootup time, and they'll run for years without needing any updates or maintenance. Super low power too.

I'm using my ol reliable:

https://www.amazon.com/gp/product/B07QCP2451/

I'll post all these scripts to github once I test them for a bit, but let me know if anyone is interested sooner.

« Last Edit: October 17, 2020, 12:32:37 AM by wrybread »

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: How to post air quality data?
« Reply #24 on: October 19, 2020, 05:13:54 PM »
FYI I posted my Python script that gets data from my AirLink, and alternatively an ESP32 script that gets the data from my Airlink and then posts it to a remote webserver, here:

https://github.com/wrybread/AirLink-Data-Uploader

Feel free to let me know if any problems implementing.
« Last Edit: October 19, 2020, 05:54:08 PM by wrybread »