WXforum.net

Weather Station Hardware => Davis Instruments Weather Stations => Topic started by: wrybread on September 30, 2020, 01:34:48 PM

Title: How to post air quality data?
Post by: wrybread 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.
Title: Re: How to post air quality data?
Post by: wrybread 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

Title: Re: How to post air quality data?
Post by: dalecoy on September 30, 2020, 07:42:26 PM
Who currently maintains "your webpage"?
Title: Re: How to post air quality data?
Post by: wrybread 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:

https://vimeo.com/316945847

Sadly the pier was just taken down.

Why do you ask?
Title: Re: How to post air quality data?
Post by: the beteljuice 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 !
Title: Re: How to post air quality data?
Post by: wrybread 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.

Title: Re: How to post air quality data?
Post by: dalecoy 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. 
Title: Re: How to post air quality data?
Post by: wrybread 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]





Title: Re: How to post air quality data?
Post by: dalecoy 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.
Title: Re: How to post air quality data?
Post by: wrybread 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.



Title: Re: How to post air quality data?
Post by: dalecoy 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.
Title: Re: How to post air quality data?
Post by: the beteljuice 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 !!!!
Title: Re: How to post air quality data?
Post by: wrybread 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.

Title: Re: How to post air quality data?
Post by: wrybread on September 30, 2020, 11:48:59 PM
And oof, AQI here just north of San Francisco is pushing into the hazardous zone!
Title: Re: How to post air quality data?
Post by: the beteljuice 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  ;)
Title: Re: How to post air quality data?
Post by: wrybread 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.
Title: Re: How to post air quality data?
Post by: wrybread 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?
Title: Re: How to post air quality data?
Post by: wrybread 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.

Title: Re: How to post air quality data?
Post by: johnd 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>
Title: Re: How to post air quality data?
Post by: wrybread 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.



Title: Re: How to post air quality data?
Post by: wrybread 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.
Title: Re: How to post air quality data?
Post by: johnd 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.
Title: Re: How to post air quality data?
Post by: johnd 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.
Title: Re: How to post air quality data?
Post by: wrybread 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.

Title: Re: How to post air quality data?
Post by: wrybread 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.