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

0 Members and 1 Guest are viewing this topic.

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #25 on: October 31, 2018, 08:17:09 AM »
I was pointed in this direction from uk.sci.weather after I was asking a few questions after my VP2 WeatherLink had been migrated from V.1 to V.2. I like the old display they previously used and see that someone has found a way of maintaining this.

I have downloaded the WL.zip from this thread but need a bit of advice from here.

I have tinkered with Pearl so not a complete novice, but just wondered what I need to do from here. I assume I will need to download and install PHP? Is there a particular version?

Any help would be very much appreciated.

Many thanks

Keith (Southend)

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #26 on: October 31, 2018, 08:35:35 AM »
I was pointed in this direction from uk.sci.weather after I was asking a few questions after my VP2 WeatherLink had been migrated from V.1 to V.2. I like the old display they previously used and see that someone has found a way of maintaining this.

I have downloaded the WL.zip from this thread but need a bit of advice from here.

I have tinkered with Pearl so not a complete novice, but just wondered what I need to do from here. I assume I will need to download and install PHP? Is there a particular version?

Any help would be very much appreciated.

Many thanks

Keith (Southend)
These scripts can only be used on your own website.
And that website must support PHP. At least 5.3.xx, preferably 7.1

If you have a website you can mail me the ftp userid/passw and I can install the script for you if you have no experience with that.

Wim

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #27 on: October 31, 2018, 09:29:11 AM »
Hi Wim,

Thank you for your quick reply.

I need to get the ok from the person who hosts my webspace, but will get back to you. Just off on a late shift at work so it maybe tomorrow morning when I next reply.

Many thanks

Keith (Southend)

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #28 on: October 31, 2018, 05:53:15 PM »
Hi Wim,

Thank you for your quick reply.

I need to get the ok from the person who hosts my webspace, but will get back to you. Just off on a late shift at work so it maybe tomorrow morning when I next reply.

Many thanks

Keith (Southend)

Hi Wim,

Apparently I have PHP version 5.6 on the shared server where my website is hosted.

Just looked at the files in 'wl2' zip folder and I imagine it is the '_your_keys.php' I need to modify and subsequently upload, I just tried to view using Notepad, but I guess this isn't the right way.

Hopefully with a little help I should be able to do this  :?

Keith (Southend)

Online PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #29 on: October 31, 2018, 06:03:29 PM »
Quote
I just tried to view using Notepad
Notepad++ is the one to use!  It is free.
You need to edit two files, load_wl2.php and _your_keys.php
and load_wl2-blue.php if you want this as well.

Enjoy,
Paul

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #30 on: November 01, 2018, 05:06:04 AM »
Quote
I just tried to view using Notepad
Notepad++ is the one to use!  It is free.
You need to edit two files, load_wl2.php and _your_keys.php
and load_wl2-blue.php if you want this as well.

Enjoy,
Paul

Ah yes, I have that, just updated my version.

Right I've extracted all the component into it's own folder and opened up on Notepad++:
1. _your_keys.php
I've edited the DID and Password for my system, but what is the API Token?
2. load_wl2.php
What do I need to edit for this one?

And then assuming I have all my correct settings what elements need uploading to my webspace and what do I look for to see the display. Let me know if there's anything else I've forgotten?

**PHP Version 5.6 is on the shared webserver I have been told.**

This is the screen I want to get, incase I've chosen the wrong file:
http://www.weatherlink.com/user/keithharris1960/index.php?view=summary&headers=0

Many thanks for all the help.

Ps: A thoroughly wet morning here at Southend-on-Sea.

Keith (Southend)

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #31 on: November 01, 2018, 05:23:25 AM »
The procedure to generate your API-token (key)  is down here in the screenshot:

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #32 on: November 01, 2018, 05:40:10 AM »
. . . shortened  . . .

2. load_wl2.php
What do I need to edit for this one?
check the lines 7 - 66 in load_wl2.php
You have to change
line 12 => your time zone as "Europe/London"
line 19 => you want to use " Mph" for wind
line 39 => change  to true only if you want to show your inside temperature, nice feature for burglars
line 50 => as you have extra temp it must be changed to true
Quote
And then assuming I have all my correct settings what elements need uploading to my webspace and what do I look for to see the display.
. . .
First test with
http://www.southendweather.net/wl2/load_wl2.php
If all is OK, you have to "include" it on your website.
Your main page is http://www.southendweather.net/index.html
If you want it on your main page you have to use an iFrame  check here https://www.w3schools.com/tags/tag_iframe.asp
If you want it in the menu, a link to http://www.southendweather.net/wl2/load_wl2.php is all you need
Quote
This is the screen I want to get, incase I've chosen the wrong file:
http://www.weatherlink.com/user/keithharris1960/index.php?view=summary&headers=0
. . . .
Keith (Southend)
Success, Wim

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #33 on: November 01, 2018, 06:00:26 AM »
The procedure to generate your API-token (key)  is down here in the screenshot:

Got the token, thanks for pointing me in the right direction.

So that's the _your_keys.php sorted.

Lot's of stuff on the load_wl2.php file. I've changed Km/h Mph. Now I have an extra sensor that I use for my grass minimum 'Extra Temp 2' I read somewhere this can read Grass minimum on the script. I'm guessing another array needs adding somewhere?

Keith (Southend)
http://www.southendweather.net/

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #34 on: November 01, 2018, 06:04:27 AM »
The procedure to generate your API-token (key)  is down here in the screenshot:

Got the token, thanks for pointing me in the right direction.

So that's the _your_keys.php sorted.

Lot's of stuff on the load_wl2.php file. I've changed Km/h Mph. Now I have an extra sensor that I use for my grass minimum 'Extra Temp 2' I read somewhere this can read Grass minimum on the script. I'm guessing another array needs adding somewhere?

Keith (Southend)
http://www.southendweather.net/
PLEASE go step by step.
First make sure that all keys are set
AND TEST  http://www.southendweather.net/wl2/load_wl2.php
If the test is OK, change one or two lines in load_wl2.php 
AND TEST  http://www.southendweather.net/wl2/load_wl2.php

Doing multiple / a lot of changes
and
the first test at the end 
EQUALS to disaster

Wim

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #35 on: November 01, 2018, 06:17:44 AM »
The procedure to generate your API-token (key)  is down here in the screenshot:

Got the token, thanks for pointing me in the right direction.

So that's the _your_keys.php sorted.

Lot's of stuff on the load_wl2.php file. I've changed Km/h Mph. Now I have an extra sensor that I use for my grass minimum 'Extra Temp 2' I read somewhere this can read Grass minimum on the script. I'm guessing another array needs adding somewhere?

Keith (Southend)
http://www.southendweather.net/
PLEASE go step by step.
First make sure that all keys are set
AND TEST  http://www.southendweather.net/wl2/load_wl2.php
If the test is OK, change one or two lines in load_wl2.php 
AND TEST  http://www.southendweather.net/wl2/load_wl2.php

Doing multiple / a lot of changes
and
the first test at the end 
EQUALS to disaster

Wim

Nearly there, view link...

http://www.southendweather.net/wl2/load_wl2.php

Many thanks Wim

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #36 on: November 01, 2018, 06:32:33 AM »
Warning: file_put_contents(./cache/001D0A00C313.xml): failed to open stream: No such file or directory in /mounted-storage/home117a/sub001/sc47724-APCU/southendweatherdotnet/wl2/load_wl2.php on line 179
Script load_wl2.php could not save file to cache => check settings

Line 179   {  $return = file_put_contents ($cachefile_wl,$string);

Looking at the files uploaded on the webserver the new ones are in their own folder e.g.
/wl2/load_wl2.php  and  _your_keys.php
I don't think it's anything I have changed on the php files.

Does the message mean more to you?

Thanks

Keith (Southend)

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #37 on: November 01, 2018, 06:36:21 AM »
. . . shortened . . .
Nearly there, view link...

http://www.southendweather.net/wl2/load_wl2.php

Many thanks Wim
This message:
file_put_contents(./cache/001D0A00C313.xml . . . .
Script load_wl2.php could not save file to cache => check settings


It seems you removed the cache/ folder from the wl2/ folder.
1. make sure that the folder is there

if the folder wl2/cache/  exists
2. make sure it is writable and use your ftp program to set it at 755

AND do not run the script without cache as the Weatherlink API does not allow frequent loads of the data.

Wim


Offline Icemannapoli

  • Member
  • *
  • Posts: 1
    • Campanialive.it
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #38 on: November 01, 2018, 06:55:40 AM »
Good job  =D>

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #39 on: November 01, 2018, 07:01:40 AM »
. . . shortened . . .
Nearly there, view link...

http://www.southendweather.net/wl2/load_wl2.php

Many thanks Wim
This message:
file_put_contents(./cache/001D0A00C313.xml . . . .
Script load_wl2.php could not save file to cache => check settings


It seems you removed the cache/ folder from the wl2/ folder.
1. make sure that the folder is there

if the folder wl2/cache/  exists
2. make sure it is writable and use your ftp program to set it at 755

AND do not run the script without cache as the Weatherlink API does not allow frequent loads of the data.

Wim

Thank you, I hadn't copied the that over, so atm I don't have the other contents clouds1.jpg, spacer.gif etc, should I put those in as well?

Keith (Southend)

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #40 on: November 01, 2018, 08:34:10 AM »
This may answer the question:

$cache_age_OK   = 300;          //  in seconds   , 300 = Davis minimum allowed value

The page can only update every 5 minutes due to Davis constraints?

I kept going backwards and forwards with Europe/London and the changing the comma to a point thinking what I had done was stopping it updating.  :lol:

Keith (Southend)

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #41 on: November 01, 2018, 08:56:21 AM »
This may answer the question:

$cache_age_OK   = 300;          //  in seconds   , 300 = Davis minimum allowed value

The page can only update every 5 minutes due to Davis constraints?
Yes
Quote
I kept going backwards and forwards with Europe/London and the changing the comma to a point thinking what I had done was stopping it updating.  :lol:

Keith (Southend)
The scripts-output always immediately reflects the changes such as comma/decimal you made. But the data from weatherlink.com is retrieved only when it is older than the set 5 minutes.

Wim

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #42 on: November 02, 2018, 04:14:37 AM »
All seems to be working fine and looks good.

The last thing that I need a little help with is I have a. 'Extra Temp 2' sensor, which I use for grass minimum.
Old version:
http://www.weatherlink.com/user/keithharris1960/index.php?view=summary&headers=1

Just want to be sure I am changing/adding the correct bits.

$wl_is_t_extra1 = false;        // extra temp 1 set to true or false
$wl_is_t_extra2 = false;        // add more lines if you have more then 2, max = 7

extra2 = true?

Then I'm a bit lost as I imagine I need to add another array or two lower down.

Many thanks

Keith (Southend)

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #43 on: November 02, 2018, 04:37:20 AM »
All seems to be working fine and looks good.

The last thing that I need a little help with is I have a. 'Extra Temp 2' sensor, which I use for grass minimum.
Old version:
http://www.weatherlink.com/user/keithharris1960/index.php?view=summary&headers=1

Just want to be sure I am changing/adding the correct bits.

$wl_is_t_extra1 = false;        // extra temp 1 set to true or false
$wl_is_t_extra2 = false;        // add more lines if you have more then 2, max = 7

extra2 = true?

Then I'm a bit lost as I imagine I need to add another array or two lower down.

Many thanks

Keith (Southend)
You only have extra temp 2, so there is already a line for that sensor. As from a previous post
Quote
line 50 => as you have extra temp it must be changed to true
so change that line 50 from
Code: [Select]
$wl_is_t_extra2 = false;        // add more lines if you have more then 2, max = 7to
Code: [Select]
$wl_is_t_extra2 = true;        // add more lines if you have more then 2, max = 7
After you tested it and all is OK, we need to change  the default description "Extra Temp2" to the description you want.
We do that by using the built-in translate code and adding for the English language the needed translation:
As the de fault english words need no translation, line 793 now reads
Code: [Select]
elseif ($wl_lang == 'en') {$string      = '';}Change that line tho these lines
Code: [Select]
elseif ($wl_lang == 'en') {$string      = '
langlookup|Extra Temp2|Grass minimum|
';}
Every translation line you want to add should contain three parts divided by the | character..
The second part is the string to translate.
The translation is the third part. I used Grass minimum in the example.

Wim
« Last Edit: November 02, 2018, 04:39:12 AM by wvdkuil »

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #44 on: November 02, 2018, 12:44:43 PM »
Hi Wim,

I've been at work all day, so just home and made the changes.

http://www.southendweather.net/wl2/load_wl2.php

Displays good, but getting 'n/a' as values atm, any ideas what I've missed?

Many thanks

Keith (Southend)

Offline Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #45 on: November 02, 2018, 01:45:01 PM »
Hi Wim,

I've been at work all day, so just home and made the changes.

http://www.southendweather.net/wl2/load_wl2.php

Displays good, but getting 'n/a' as values atm, any ideas what I've missed?

Many thanks

Keith (Southend)

I think I've sorted it. I changed the two bits to Extra temp 1. Logically I only have one extra temperature setting, even though Davis originally always listed it as 2?

http://www.weatherlink.com/user/keithharris1960/index.php?view=summary&headers=1

Just in time for the grass frost  =D>

Keith (Southend)

Offline anto_laois

  • Member
  • *
  • Posts: 1
    • North Laois Weather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #46 on: November 14, 2018, 04:25:43 PM »
Hi,
First of all I'd like to compliment you on your replacement script, your expertise is very much appreciated.
 I've uploaded your script to my website
www.northlaoiswr.info/wl2/load_wl2.php

One thing I have noticed that the 10 minute max gust seems to be the same as the 10 minute average wind speed . It's not a criticism, I just thought I'd let you know.
  Thanks again,
    Anthony.
« Last Edit: November 14, 2018, 04:28:11 PM by anto_laois »

Offline mjc775

  • Senior Member
  • **
  • Posts: 58
    • Reno NW Weather
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #47 on: November 24, 2018, 02:19:29 AM »
...One thing I have noticed that the 10 minute max gust seems to be the same as the 10 minute average wind speed...

Change line 375 to read:
Code: [Select]
$wl_lines[]     = 'detail|Wind Gust Speed| |wl_wind_gust_10m| | | |';
Also, I noticed than the rain totals were showing 3 decimals (thousandths of an inch, instead of hundredths). Therefore I changed line 272 to:
Code: [Select]
{  $value  = wl_number ($value,2).$uomRain;}
Here's a link to my WL2 scripts https://wx.ctreno.com

What I haven't been able to figure out is to change the Barometer inHg from 3 to 2 decimals (thousandths of an inch to hundredths). If anyone knows how to change that, please advise.
I figured it out. I changed line 309 to:
Code: [Select]
$value  = wl_number ($value,2).$uomBaro;
« Last Edit: November 24, 2018, 02:46:09 AM by mjc775 »
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 Keith (Southend)

  • Member
  • *
  • Posts: 16
    • Weather Home & Abroad
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #48 on: November 24, 2018, 04:05:25 AM »
Just made the change to the 10 minute gust, works fine now.

I don't think I need to change the 'rain total' or 'barometer' as I use 'mm' and 'mb' and it looks fine for me atm.

http://www.southendweather.net/wl2/load_wl2.php

I do so much like that format to what Davis now have with the upgrade, which is not so easy on the eye.

Many thanks

Keith (Southend)

Offline andlil

  • Member
  • *
  • Posts: 1
Re: Weatherlink.com 2.0 Summary replacement script
« Reply #49 on: November 25, 2018, 06:56:44 AM »
Love the script, any thought of placing it on GitHub for easier collaboration?

Another thing, anyone know why I'm not seeing 'wind_ten_min_gust_mph' in the XML?

Best regards
//Anders
« Last Edit: November 25, 2018, 06:59:54 AM by andlil »

 

anything