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

0 Members and 1 Guest are viewing this topic.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1282
    • 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 »
Development and maintenance of Leuven-Template&Scripts  at: https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 4130
    • 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
Davis Vantage Pro 2 Plus 24-FARS Wireless
Envoy/USB DataLogger/Cumulus v.1.9.4   -   Vue Console/WiFiLogger
Komoka, ON  Canada
www.komokaweather.ca   www.komokaweather.com   www.komokaweather.com/weather28/   www.komokaweather.com/pws/index.php
Blitzortung Station #1076 www.lightningmaps.org/blitzortung7/america/index.php?bo_page=statistics&bo_show=network&lang=en&bo_station_id=969

Offline catdon

  • Senior Member
  • **
  • Posts: 76
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: 3206
  • 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

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

Online Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 514
    • 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?  :-)

Davis Vantage Pro2, Serial Data Logger
WD 10.37S-(b60), VWS V15.00p03, Weatherlink 6.0.3,  Fling 2.35, Broadwave 2.0, Win 7 Pro 64Bit
KMICHEBO10 - CW3699 - Cheboygan, MI

Offline Brientim

  • Member
  • *
  • Posts: 24
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

Online Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 514
    • 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.

Davis Vantage Pro2, Serial Data Logger
WD 10.37S-(b60), VWS V15.00p03, Weatherlink 6.0.3,  Fling 2.35, Broadwave 2.0, Win 7 Pro 64Bit
KMICHEBO10 - CW3699 - Cheboygan, MI

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 4130
    • 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
Davis Vantage Pro 2 Plus 24-FARS Wireless
Envoy/USB DataLogger/Cumulus v.1.9.4   -   Vue Console/WiFiLogger
Komoka, ON  Canada
www.komokaweather.ca   www.komokaweather.com   www.komokaweather.com/weather28/   www.komokaweather.com/pws/index.php
Blitzortung Station #1076 www.lightningmaps.org/blitzortung7/america/index.php?bo_page=statistics&bo_show=network&lang=en&bo_station_id=969

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 3206
  • 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

Online Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 514
    • 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.

Davis Vantage Pro2, Serial Data Logger
WD 10.37S-(b60), VWS V15.00p03, Weatherlink 6.0.3,  Fling 2.35, Broadwave 2.0, Win 7 Pro 64Bit
KMICHEBO10 - CW3699 - Cheboygan, MI

Offline drew

  • Senior Member
  • **
  • Posts: 62
    • Florence AL Conditions
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #11 on: October 04, 2018, 11:40:20 PM »
-Drew Richards
Davis Vantage Vue
Win 7
http://shoalsweather.net/

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1282
    • 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 »
Development and maintenance of Leuven-Template&Scripts  at: https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 4130
    • KomokaWeather
Davis Vantage Pro 2 Plus 24-FARS Wireless
Envoy/USB DataLogger/Cumulus v.1.9.4   -   Vue Console/WiFiLogger
Komoka, ON  Canada
www.komokaweather.ca   www.komokaweather.com   www.komokaweather.com/weather28/   www.komokaweather.com/pws/index.php
Blitzortung Station #1076 www.lightningmaps.org/blitzortung7/america/index.php?bo_page=statistics&bo_show=network&lang=en&bo_station_id=969

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 3206
  • 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

Online Otis

  • (aka Paul)
  • Forecaster
  • *****
  • Posts: 514
    • 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.

Davis Vantage Pro2, Serial Data Logger
WD 10.37S-(b60), VWS V15.00p03, Weatherlink 6.0.3,  Fling 2.35, Broadwave 2.0, Win 7 Pro 64Bit
KMICHEBO10 - CW3699 - Cheboygan, MI

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1282
    • 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
Development and maintenance of Leuven-Template&Scripts  at: https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 3206
  • 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

  • Member
  • *
  • Posts: 40
    • 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: 62
    • Florence AL Conditions
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
Davis Vantage Vue
Win 7
http://shoalsweather.net/

Offline mjc775

  • Member
  • *
  • Posts: 40
    • 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: 1282
    • 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
Development and maintenance of Leuven-Template&Scripts  at: https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline zmarfak

  • Member
  • *
  • Posts: 38
    • 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 WLIP logger, Intel NUC with WL6.0.4 https://www.matar.be

Offline Mchd17

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