Author Topic: Weatherlink.com 2.0 Summary replacement script  (Read 7869 times)

0 Members and 1 Guest are viewing this topic.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Weatherlink.com 2.0 Summary replacement script
« on: October 03, 2018, 08:14:33 AM »
At September 28 my weatherlink-ip uploads were moved to the version 2 weatherlink.com site.
As with all others I lost my "blue-page" and "summary page". They  are still there but are not updated.

So I wrote a stand-alone PHP script to "mimic" the summary page using the API.
You can check how it looks at https://www.weerstation-herent.be/load_wl2.php?lang=nl

I added translation of the sensor names for English and Dutch using the standard "langlookup". Other languages will follow. At least we can now give those sensors a more meaningful name, just translate  "Extra Temp1" => "Swimming pool". Or "Soil Temp1" => "Soil temp at -5"

I do not have those extra sensors. If you have multiple extra sensors I would like to get your xml file to test with. 
As the files are identical in version 1 or 2 you can use the old xml.php or the new API
Code: [Select]
http://www.weatherlink.com/xml.php?user=USERNAME&pass=PASSWORD
Code: [Select]
http://api.weatherlink.com/v1/NoaaExt.xml?user=DID&pass=PASSWORD&apiToken=APIKEYIf you downloaded that file once, please zip it and sent it by PM.

I attached the current version of the script. The first 50 lines are settings. Do not change below line 50 yet, as it is still in beta. Just post your remarks here and I will try to adapt the script for you.
EDIT 2018-10-06
Attached new version 1 of the script.
Thanks for the remarks and the xml files to test with.
Changes:
Removed key/password/api settings from the script and moved them to a separate file
Added another script to generate the "blue page" as used in  WeatherLink.com v1
Add 'fr' and 'de' languages besides 'en' and 'nl'
Added optional enclosing html for stand-alone use
Added more comments for the settings

Wim
« Last Edit: October 08, 2018, 03:07:57 AM by wvdkuil »

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #1 on: October 03, 2018, 09:22:52 AM »
Thanks Wim,

Looks good http://www.komokaweather.com/weatherlink/load_wl2.php
I do not have extra sensors

Enjoy,
Paul

Offline catdon

  • Senior Contributor
  • ****
  • Posts: 159
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #2 on: October 03, 2018, 12:56:16 PM »
Seeing the old summary page again, I realize how much easier  it is on the eyes than the 2.0 version. The new version text is too gray, doesn't stand out like the black.
Don
Staten Island, NY

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4107
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #3 on: October 03, 2018, 02:41:37 PM »
I have it running at http://www.rogerscityweather.com/load_wl2.php

It is working well. I have multiple sensors, but I am OK with the "Extra Temp" nomenclature.

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline Brientim

  • Contributor
  • ***
  • Posts: 123
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #4 on: October 03, 2018, 07:08:07 PM »
PM sent with XML

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 724
    • Lake Huron Weather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #5 on: October 04, 2018, 05:40:30 AM »
I just don't know php very well yet, working on it.

Anyway, I can't find where/how to change some of the commas to decimal points.  Such as those under the rainfall amounts, temp., heat index.  My page https://lakehuronweather.org/wxWeatherLinkSummary.php

Greg, I see you have changed yours, any hints?  :-)

CW3699

Offline Brientim

  • Contributor
  • ***
  • Posts: 123
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #6 on: October 04, 2018, 05:57:44 AM »

I can't find where/how to change some of the commas to decimal points. 

Line 40 $wl_comma_dec   = false;         # false = 5.40          true =  5,40   

Also, just put this up and it contains the extra sensors for the Leaf/Soil Sensors
http://weather.brien.com.au/summary.php

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 724
    • Lake Huron Weather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #7 on: October 04, 2018, 07:55:02 AM »

I can't find where/how to change some of the commas to decimal points. 

Line 40 $wl_comma_dec   = false;         # false = 5.40          true =  5,40   

Oh just perfect, thanks a lot for the prompt reply.

CW3699

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #8 on: October 04, 2018, 09:21:56 AM »
 :oops: I hasn't even noticed the comma decimal... need to get replacement for my new glasses :(
Thanks Paul

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4107
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #9 on: October 04, 2018, 09:32:57 AM »
I just don't know php very well yet, working on it.

Anyway, I can't find where/how to change some of the commas to decimal points.  Such as those under the rainfall amounts, temp., heat index.  My page https://lakehuronweather.org/wxWeatherLinkSummary.php

Greg, I see you have changed yours, any hints?  :-)

Sorry I saw this too late to help. I see that others stepped in with the correct answer.

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 724
    • Lake Huron Weather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #10 on: October 04, 2018, 11:16:56 AM »
I just don't know php very well yet, working on it.

Anyway, I can't find where/how to change some of the commas to decimal points.  Such as those under the rainfall amounts, temp., heat index.  My page https://lakehuronweather.org/wxWeatherLinkSummary.php

Greg, I see you have changed yours, any hints?  :-)

No worries Greg, thanks.


Sorry I saw this too late to help. I see that others stepped in with the correct answer.

Greg H.

CW3699

Offline drew

  • Senior Member
  • **
  • Posts: 77
    • Shoals Weather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #11 on: October 04, 2018, 11:40:20 PM »
-Drew Richards

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #12 on: October 06, 2018, 12:20:10 PM »
Added the first "official" version of the two scripts.
One for the summary page, one for the "blue" page.
Check the first post for the download.

Summary demo: www.weerstation-herent.be/wl2/load_wl2.php
Blue clouds demo: www.weerstation-herent.be/wl2/load_wl2-blue.php
For this demo I "upped" the cache time from 5 minutes to 15 minutes.  Less loads for the Davis server.

Wim
« Last Edit: October 06, 2018, 12:39:55 PM by wvdkuil »

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4107
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #14 on: October 07, 2018, 12:31:41 PM »
I like the new "blue" one. I have made it my starting page for Firefox.

Also, thanks for removing the key, DID and PW to a separate file.

Users may also want to change the permissions of the _your_keys.php file to eliminate "public" access (0640) or check the permissions boxes as required in FileZilla.

UPDATE: (maybe not, I re-enabled the public permission and I could not see it then either...) I am leaving it as above in an abundance of caution.

Greg H.
« Last Edit: October 07, 2018, 12:38:39 PM by miraculon »


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 724
    • Lake Huron Weather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #15 on: October 07, 2018, 05:16:45 PM »
Agree with Greg, thanks for the update removing the "access" data to a separate file.
Also, I have tried several ways to view the new _your_keys file but have not been able to do so through a browser (FF).  I was also concerned about public eyes on that file.  Are there other ways the public can view it?

One other, I like to have an "icon" associated with my site so I added the necessary info down between line 96 and 99.  I also changed the page title here to reflect my site.  Yes I know - it said not to modify below line 66 but could not restrain my self, and it works. https://lakehuronweather.org/wxWeatherLinkSummary.php

Thanks a lot Wim (and others) this is a great go-to page.

CW3699

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #16 on: October 08, 2018, 03:19:48 AM »
Agree with Greg, thanks for the update removing the "access" data to a separate file.
Also, I have tried several ways to view the new _your_keys file but have not been able to do so through a browser (FF).  I was also concerned about public eyes on that file.  Are there other ways the public can view it?

One other, I like to have an "icon" associated with my site so I added the necessary info down between line 96 and 99.  I also changed the page title here to reflect my site.  Yes I know - it said not to modify below line 66 but could not restrain my self, and it works. https://lakehuronweather.org/wxWeatherLinkSummary.php

Thanks a lot Wim (and others) this is a great go-to page.
It is a fully supported release, so you can change and move around as you wish.   There is that warning, but just to make sure that one uses a little extra precaution. The language lines and the enclosing html is also below that line and changing those takes a little more "know-how" than changing a setting from true to false.

_your_keys file
As far as I know there is no way for a website-visitor to inspect php scripts. As soon as the webserver loads a script it is parsed. Script authors therefor nearly always include a "sce=view" facility in the scripts to check scripts for support.
That your_keys file has no "sce=view" and therefore can only be viewed when there is no PHP support at your webserver.

Wim

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4107
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #17 on: October 08, 2018, 08:22:00 AM »
Agree with Greg, thanks for the update removing the "access" data to a separate file.
Also, I have tried several ways to view the new _your_keys file but have not been able to do so through a browser (FF).  I was also concerned about public eyes on that file.  Are there other ways the public can view it?

One other, I like to have an "icon" associated with my site so I added the necessary info down between line 96 and 99.  I also changed the page title here to reflect my site.  Yes I know - it said not to modify below line 66 but could not restrain my self, and it works. https://lakehuronweather.org/wxWeatherLinkSummary.php

Thanks a lot Wim (and others) this is a great go-to page.
It is a fully supported release, so you can change and move around as you wish.   There is that warning, but just to make sure that one uses a little extra precaution. The language lines and the enclosing html is also below that line and changing those takes a little more "know-how" than changing a setting from true to false.

_your_keys file
As far as I know there is no way for a website-visitor to inspect php scripts. As soon as the webserver loads a script it is parsed. Script authors therefor nearly always include a "sce=view" facility in the scripts to check scripts for support.
That your_keys file has no "sce=view" and therefore can only be viewed when there is no PHP support at your webserver.

Wim

Thanks Wim for the explanation. I have seen the lines that control the "view" option, but I wasn't sure if it precluded anyone from viewing them at all.

It looks like we are safe.

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline makka

  • Member
  • *
  • Posts: 3
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #18 on: October 16, 2018, 04:41:39 AM »
I have had the notification that our data will be moved from 1.0 to 2.0.  I knew nothing about 2.0 and we only use the online data to A) download to weatherlink and B) put on our intranet.  this script is ideal to sort B) out so thank you.  Currently I get "File loaded from wl.com has no valid contents - program ends. Check your key settings." even with my DID, password and freshly generated API key.  Im assuming I need to wait until the transition to 2.0 has completed first (I can log into 1.0 and 2.0 at the moment).

EDIT - nevermind, I used the DID listed in weatherlink 1.0 and it works fine.  The DID listed in my weatherlink 2.0 is wrong (no idea why) so perhaps that will change when the migration happens (I only got the email this morning)
« Last Edit: October 16, 2018, 04:45:05 AM by makka »

Offline mjc775

  • Senior Member
  • **
  • Posts: 58
    • Reno NW Weather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #19 on: October 20, 2018, 12:56:37 AM »
I combined both scripts on one page: https://wx.ctreno.com/

@Wim please provide a link to your tip jar.

Thank you!


Sent from my iPhone using Tapatalk
I had a Heathkit anemometer and barometer in the 1980s.  After a hiatus, in 2014 I purchased a cabled Davis Vantage Pro2.
WeatherLink IP, MeteoBridge, Meteoplug Cloud.
WU: KNVRENO97, CWOP: N7FEQ, MESOWEST/MADIS ID: AU849
Reno NW Weather

Offline drew

  • Senior Member
  • **
  • Posts: 77
    • Shoals Weather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #20 on: October 20, 2018, 11:58:49 PM »
I also combined both scripts into one page. Thank you so much for this! Perfect setup!

http://shoalsweather.net/harbor
http://shoalsweather.net/oaklandvfd
http://shoalsweather.net/northflorence
-Drew Richards

Offline mjc775

  • Senior Member
  • **
  • Posts: 58
    • Reno NW Weather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #21 on: October 26, 2018, 02:55:59 AM »
Do we know if this script will continue to display all information if on the Weatherlink 2.0 Basic/Free tier, or is a Pro or higher subscription required to display all the data displayed in the script?
I had a Heathkit anemometer and barometer in the 1980s.  After a hiatus, in 2014 I purchased a cabled Davis Vantage Pro2.
WeatherLink IP, MeteoBridge, Meteoplug Cloud.
WU: KNVRENO97, CWOP: N7FEQ, MESOWEST/MADIS ID: AU849
Reno NW Weather

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #22 on: October 26, 2018, 03:08:01 AM »
Do we know if this script will continue to display all information if on the Weatherlink 2.0 Basic/Free tier, or is a Pro or higher subscription required to display all the data displayed in the script?
There is no paid-subscription needed. Just the API-token to retrieve your own data.

I do not think that Davis will ever charge you to retrieve your own data.

Wim

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #23 on: October 26, 2018, 09:02:31 AM »
Thanks Wim
works perfectly
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline Mchd17

  • Senior Member
  • **
  • Posts: 99
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #24 on: October 30, 2018, 07:14:49 PM »
 =D> thanks, both work flawlessly

 

anything