Re: [pywws] pwsweather.com script?

321 views
Skip to first unread message

Jim Easterbrook

unread,
Oct 31, 2012, 4:46:54 PM10/31/12
to py...@googlegroups.com
On 31/10/12 20:30, Darren Enns wrote:
> Just got my new WH2081 the other day and installed/configured PYWWS over
> the past few days. Managed to get scripts written to supply weather data
> to all my previous sites *except* for "pwsweather.com".
>
> Google doesn't show anyone talking about that site in the context of
> PYWWS. Any help/comments?

Well, until I read your message I'd never heard of pwsweather.com. I
couldn't find any details of the API on their website, but if it's
similar to the other 'services' supported by toservice.py then it should
be easy to add.
--
Jim Easterbrook <http://www.jim-easterbrook.me.uk/>

Darren Enns

unread,
Oct 31, 2012, 6:28:20 PM10/31/12
to py...@googlegroups.com
It is difficult to find a good description of the API, but I found this today:

http://macweather.net/viewtopic.php?f=12&t=398

I think the idea is that one does a 'POST' to a particular web address with account/password and weather data embedded in the URL, similar to this:

http://www.pwsweather.com/pwsupdate/pwsupdate.php?ID=STATIONID&PASSWORD=password&dateutc=2000-12-01+15%3A20%3A01&winddir=225&windspeedmph=0.0&windgustmph=0.0&tempf=34.88&rainin=0.06&dailyrainin=0.06&monthrainin=1.02&yearrainin=18.26&baromin=29.49&dewptf=30.16&humidity=83&weather=OVC&solarradiation=183&UV=5.28&softwaretype=Examplever1.1&action=updateraw

My own experience with 'talking' to these weather sites has been very primitive i.e. creating a text file and FTPing it to a site.  Although I understand the concept of a 'POST', I have no idea if this is more 'typical' a way to do this. 

Jim Easterbrook

unread,
Nov 1, 2012, 1:17:38 PM11/1/12
to py...@googlegroups.com
This looks *very* similar to Weather Underground's upload syntax, which
seems to have a lot of imitators. I suspect all you need to do is copy
the Weather Underground files (in pywws/services). You might need to set
'rapidfire' to False in the .ini file.

Darren Enns

unread,
Nov 1, 2012, 3:54:58 PM11/1/12
to py...@googlegroups.com
I think you are correct!

Initially I got some confusing results, but after deactivating my old PWSWeather station and creating a new one, I think it is working with minimal fuss:

Dare's WH2081 Station on PWSWeather

Hopefully it will help others to see this thread and wish to connect to their services as well :)

Thanks!

Darren Enns

unread,
Dec 5, 2012, 8:30:52 AM12/5/12
to py...@googlegroups.com
Well, I think there were just two parts to getting my pywws system to work with the PWS service (which I had already been using with my previous station/software).  This really isn't a 'tutorial', since I am assuming that you already have pywws up-and-running and just want to add the 'PWS' service to the other services you already use.

1) Make an 'ini' file for PWS service (i.e. 'pwsweather.ini'), modelled after 'underground.ini':

[config]
url        = http://www.pwsweather.com/pwsupdate/pwsupdate.php
#url-rf        = http://rtupdate.wunderground.com/weatherstation/updateweatherstation.php
catchup        = 0
rapidfire    = False
use get        = True
result        = ['success$']

[fixed]
action        = updateraw
softwaretype    = pywws
ID        = mystationid
PASSWORD    = mypassword

[fixed-rf]
realtime    = 1
rtfreq        = 48

2) Create a 'template' file for PWS service (i.e. 'pwsweather_template_1080.txt'), modelled after 'underground_template_1080.txt':

#live#
{
#idx          "'dateutc'      : '%Y-%m-%d %H:%M:%S',"#
#wind_dir     "'winddir'      : '%.0f'," "" "winddir_degrees(x)"#
#wind_ave     "'windspeedmph' : '%.2f'," "" "wind_mph(x)"#
#wind_gust    "'windgustmph'  : '%.2f'," "" "wind_mph(x)"#
#hum_out      "'humidity'     : '%.d',"#
#temp_out     "'tempf'        : '%.1f'," "" "temp_f(x)"#
#rel_pressure "'baromin'      : '%.4f'," "" "pressure_inhg(x)"#
#calc "temp_f(dew_point(data['temp_out'], data['hum_out']))" "'dewptf' : '%.1f',"#
#calc "rain_inch(rain_hour(data))" "'rainin' : '%g',"#
#calc "rain_inch(rain_day(data))" "'dailyrainin' : '%g',"#
}

3) Add an entry to the 'weather.ini' file:

[live]
services = [...', 'pwsweather', ...']
...

Let us know if it works out for you too :)

On Tuesday, 4 December 2012 21:06:10 UTC-6, Karl Hircock wrote:
I would like a copy or tutorial on how you did this, i run PWS weather too. If thats ok :)

Reply all
Reply to author
Forward
0 new messages