cloudy cloudy

Author Topic: Post data to wunderground from terminal  (Read 2283 times)

0 Members and 1 Guest are viewing this topic.

Offline mihec

  • Posts: 167
  • OS/Browser:
  • Mac OS X 10.12.6
  • Safari 10.1.2
Post data to wunderground from terminal
« on: September 15, 2017, 12:47:49 PM »
I'm collection air quality data with my Raspberry Pi and would like to do uploads directly from it. I went through instructions in the WU but it's not clear to me how could I send data to WU. Does anyone has an example for it? Ideally I'd do it with a bash script.
Thanks.

Offline mihec

  • Posts: 167
  • OS/Browser:
  • Mac OS X 10.12.6
  • Safari 10.1.2
Re: Post data to wunderground from terminal
« Reply #1 on: September 15, 2017, 01:41:45 PM »
Found a solution, it's pretty easy. Here is a sample code if anyone finds it useful:

Code: [Select]
curl "https://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?ID=<station_id>&PASSWORD=<password>&dateutc=now&AqOZONE=11&AqPM2.5=8&action=updateraw"
Check WU's wiki for other fields.

Offline Weather Display

  • Posts: 83,413
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 60.0.3112.113
    • Weather Display
Re: Post data to wunderground from terminal
« Reply #2 on: September 15, 2017, 06:30:41 PM »
now that WD supports the purpleair sensor, I can send that data (the PM2.5 data)
does it then show up on your wunderground data?

Offline mihec

  • Posts: 167
  • OS/Browser:
  • Mac OS X 10.12.6
  • Safari 10.1.2
Re: Post data to wunderground from terminal
« Reply #3 on: September 15, 2017, 07:03:00 PM »
I have my own sensors (PM2.5 and O3) not the purpleair. I'd be interested if WD could read my textfile with air quality data and post it for me :-) (Same for the lightning)
I only did 2 uploads so far to test it. When I have more time, I'll write a script. I just don't have a measure to say what is 20 ppb or 10 ug/m3 . I want to let it run for a while to see if the sensors read reliably.

Offline Weather Display

  • Posts: 83,413
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 60.0.3112.113
    • Weather Display
Re: Post data to wunderground from terminal
« Reply #4 on: September 15, 2017, 07:21:08 PM »
does your PM2.5 data actually show on your WU data ?

Offline mihec

  • Posts: 167
  • OS/Browser:
  • Mac OS X 10.12.6
  • Safari 10.1.2
Re: Post data to wunderground from terminal
« Reply #5 on: September 15, 2017, 07:27:54 PM »
No, not yet. I only tested for 2 uploads in the afternoon. When I set up a script to do 5 min uploads, I'll tell you.

Offline mihec

  • Posts: 167
  • OS/Browser:
  • (Linux Mint)
  • Firefox 53.0
Re: Post data to wunderground from terminal
« Reply #6 on: September 15, 2017, 08:07:25 PM »
OK, the script is posting the data now. It calculates the average of last 300 seconds and pushes the PM2.5 and ozone data to my WU. It is not calibrated but it should show a trend. We're going into Autumn/Winter so the PM should increase gradually.
You can check my WU ID if you want but I don't know when they accept my source. I'm ITOLMINT6
Thanks.

Offline Weather Display

  • Posts: 83,413
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 60.0.3112.113
    • Weather Display
Re: Post data to wunderground from terminal
« Reply #7 on: September 15, 2017, 09:37:54 PM »
https://www.wunderground.com/personal-weather-station/dashboard?ID=ITOLMINT6

its not obvious where they will show that PM2.5 data?

Offline mihec

  • Posts: 167
  • OS/Browser:
  • (Linux Mint)
  • Firefox 55.0
Re: Post data to wunderground from terminal
« Reply #8 on: September 16, 2017, 05:12:06 AM »
I think (?) it shows only when selecting a city, not exact ID (correct me if I'm wrong). There is a field "Air Quality"

https://www.wunderground.com/weather/si/tolmin/ITOLMINT6?cm_ven=pwsdash_cityforecast

Does anyone send the air quality data to WU already (with purpleair)? What does it look like on the WU?

Offline Weather Display

  • Posts: 83,413
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 60.0.3112.113
    • Weather Display
Re: Post data to wunderground from terminal
« Reply #9 on: September 16, 2017, 06:27:04 AM »

Offline mihec

  • Posts: 167
  • OS/Browser:
  • Mac OS X 10.12.6
  • Safari 10.1.2
Re: Post data to wunderground from terminal
« Reply #10 on: September 16, 2017, 08:04:31 AM »
I've noticed my WU data is blanked out because it's being uploaded from 2 different sources. WD uploads weather values, a bash script uploads OZONE and PM2.5 fields only.
Hmm ... could WD read my OZONE and PM2.5 text files? I can adapt the content to any format required.

Offline Weather Display

  • Posts: 83,413
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 60.0.3112.113
    • Weather Display
Re: Post data to wunderground from terminal
« Reply #11 on: September 16, 2017, 08:37:44 AM »
WD does currently read data from a purple air sensor
via a text file
if you have the PM2.5 data in that file in the same format that WD will read it in

Offline mihec

  • Posts: 167
  • OS/Browser:
  • Mac OS X 10.12.6
  • Safari 10.1.2
Re: Post data to wunderground from terminal
« Reply #12 on: September 16, 2017, 09:32:34 AM »
Downloaded and installed. I see the PurpleAir tab. Could you please advise where should the file be placed to? What is the file format and name? Could I upload the O3 data as well?

Offline Weather Display

  • Posts: 83,413
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 60.0.3112.113
    • Weather Display
Re: Post data to wunderground from terminal
« Reply #13 on: September 16, 2017, 06:55:46 PM »
there is a thread about the purpleair sensor in WD
there are 2 files
airquality.txt and airquality2.txt
that thread has examples of what is in those files  :wink:

Offline Weather Display

  • Posts: 83,413
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 60.0.3112.113
    • Weather Display
Re: Post data to wunderground from terminal
« Reply #14 on: September 16, 2017, 08:49:55 PM »
if you can create a file called airquality2.txt, where WD is installed, and have in it format like
"PM2_5Value":"2.5"
then WD will pick up that value

I could also make WD look for a ozone value in that file
e.g use format
"OZONEValue":"2.5"

 

cumulus