Connection between w.l2 and meteotemplate

Post Reply
rimat2
Newbie
Newbie
Posts: 5
Joined: Sun Aug 20, 2017 3:10 pm

Connection between w.l2 and meteotemplate

Post by rimat2 » Tue Jul 17, 2018 11:45 am

I could not figure out how to connect weatherlink 2.0 to meteptemplate. I have api and all the information required. I did not understand what I needed to change and which page. Is it related to w.l plugin?
tamir engel
galilee mountain 770 m israel
http://galilleemountain.com/indexDesktop.php

jntkwx
Newbie
Newbie
Posts: 8
Joined: Mon Oct 16, 2017 6:06 pm
Station model: Davis Pro 2
Software: WL-IP

Re: Connection between w.l2 and meteotemplate

Post by jntkwx » Wed May 29, 2019 6:56 pm

rimat2 wrote: Tue Jul 17, 2018 11:45 am I could not figure out how to connect weatherlink 2.0 to meteptemplate. I have api and all the information required. I did not understand what I needed to change and which page. Is it related to w.l plugin?
I know I am replying to a very old post, but if anyone else has this question/problem, since version 4.0 of the WL-IP Updates plugin has not yet (as of this post) been updated for the new WeatherLink 2.0 API, I had to edit two files to make WeatherLink 2.0 work with Meteotemplate:

1. First, if you have not done so, set up the WL-IP Uploads plugin in your control panel, and click the Save button. Doing this creates or modifies a settings.php file. Manually edit the settings.php file by adding the following two variables to the template_root/plugins/wlIP/settings.php file:

Code: Select all

$DID = 'fill in device ID';
$tokenID = 'fill in new API token';
Notes:
  • the dollar sign $ the single quotes ' and the colon ; are required characters.
  • Ensure that there is no space between the characters in the DID and the tokenID and the single quotes.
  • The $userName variable is no longer required. Therefore, you can keep the $userName line in the settings.php file, or delete that line (I chose to keep it, so I could remember what my WeatherLink username is).
The DID (device ID) can be found by logging into your Weatherlink.com account, click on the wrench icon in the upper righthand corner of the screen, and you'll see your Device Info, including your Device ID (the Device ID is also printed on a sticker on the WeatherLink-IP dongle). To my knowledge, if you previously had a WeatherLink 1.0 account, your data should now have been successfully imported into the new WeatherLink 2.0 website. You should be able to login to weatherlink.com with your existing Weather Link 1.0 username and password (note that this wasn't true in the spring of 2018 when I initially tried this).

To create or view your API Token, while logged into your Weatherlink.com account, click on the person icon in the upper righthand side of the screen. If you have previously requested a WeatherLink 2.0 API token, you'll see it listed on this page. If you have not requested a WeatherLink 2.0 API token, click the link to generate an API token, fill in the requested information (first name, last name, email, phone number, country, state), and an API token will be automatically generated for you. You'll receive an email confirmation almost immediately when this is complete.

2. Edit the line immediately after the "get data" line in the template_root/plugins/wlIP/wlIPupdate.php file so that it matches the new WeatherLink 2.0 API request format:

Code: Select all

$url = "https://api.weatherlink.com/v1/NoaaExt.xml?user=".$DID."&pass=".$WLPass."&apiToken=".$tokenID;
Note that the order of quotation marks " dollar signs $ periods . and the colon ; must match the line above. You could copy the line above and replace the existing line in your wlIPupdate.php file.

After doing this, and setting a CRON job to wlIPupadte.php, using your admin password like this: .../plugins/wlIP/wlIPupdate.php?pass=YOUR_UPDATE_PASSWORD you should see your current data being automatically updated.

Post Reply