PLEASE POST YOUR WEBSITE IF YOU ARE USING THIS FORECASTER!
When I ordered a Zambretti Forecaster (the well-known circular one), I also received a Zambretti Weathercard Forecaster. I liked the Weathercard version so much I wanted to try to use it with Cumulus. I tried changing the forecast names Cumulus uses over to the equivalents on the Weathercard, but they were never right. The only thing easily changeable is the forecast that appears on the webpage. So I decided to make my own PHP Scripts (originally JavaScripts) for Cumulus using the Weathercard. I made them early in 2013 and have kept testing and improving them to what they are now.
I have added the ability to use the Zambretti Weathercard Forecaster anywhere on Earth as it is originally meant for use in the Northern Temperate Zone. My modifications should allow accurate forecasts anywhere on Earth.
Prerequisites
Your web server host must support PHP 5.x which most already do.
You must be running at least Cumulus v1.9.4 (1088) or newer.
Cumulus
There are some settings that need to be made to and checked in Cumulus.
Click on CONFIGURATION>STATION. Make sure the boxes in front of "Use bearing zero when calm" and "Cumulus pressure trend names" are checked. Also make sure you have correctly entered your GPS coordinates. Click OK.
Close Cumulus.
Open the Cumulus\web folder and your weather website directory. Delete this file if you have been using a previous version of this forecaster if it exists:
bt-zambrettiwcf-cu.js
When you open the BT's Zambretti Weathercard Forecaster PHP Scripts For Cumulus.zip attachment at the bottom of this long post, you will see 2 PHP files:
bt-zambrettiwcf.php
bt-zambrettiwcf-cu.php
Here is what they do:
bt-zambrettiwcf.php
This file reads data obtained from bt-zambrettiwcf-cu.php and displays it in a useful way. You can access this file by clicking on the forecast on your weather webpage.
bt-zambrettiwcf-cu.php
This file is what Cumulus updates during a web update with the correct variables to determine a forecast.
You will need to upload both files once to your web server in the same directory Cumulus uploads to during web updates. Any FTP program will work. I use Firefox so I use the FireFTP add-on. Once you have the 2 files uploaded, close your FTP program.
You can now re-open Cumulus. Once it finishes reading data, click on CONFIGURATION>INTERNET then click on the FILES tab. You will see a series of boxes. The ones on the left are LOCAL files. The ones on the right are REMOTE files. You will need a blank LOCAL one with a blank REMOTE one to the right of it. Between these two boxes is a BROWSE button. Click it. You need to browse to your Cumulus web folder and select bt-zambrettiwcf-cu.php. This file along with the folder location it is in should now be in the LOCAL box. Now in the REMOTE box, you will need to type in /bt-zambrettiwcf-cu.php or if you are uploading to a folder use the folder name so type in /FOLDER NAME/bt-zambrettiwcf-cu.php. Now to the right of the REMOTE box are some check boxes. You need to check PROCESS? and FTP? so bt-zambrettiwcf-cu.php is updated when Cumulus performs a web update. Click OK.
Now you need to update either the Cumulus indexT.htm file if you are using the default templates from Cumulus on your weather webpage or you will need to update the template files for the template you are using. Usually most folks use the default Cumulus templates, but others use the Saratoga or the Weather by You PHP templates. All of these changes are explained below. You only need to change the ones you are using obviously.
You will need to open the following with a text editor. I HIGHLY RECOMMEND Notepad++ which is free. This is the program I am going to assume you will be using to do all which follows.
indexT.htm
Open this with Notepad++.
CHANGE:
Code: Select all
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<meta name="description" content="<#location> weather data" />
<meta name="keywords" content="Cumulus, <#location> weather data, weather, data, weather station" />
<title><#location> weather</title>
<link href="weatherstyle.css" rel="stylesheet" type="text/css" />
</head>
Code: Select all
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<meta http-equiv="refresh" content="299">
<meta name="description" content="<#location> weather data">
<meta name="keywords" content="Cumulus, <#location> weather data, weather, data, weather station">
<title><#location> weather</title>
<link href="weatherstyle.css" rel="stylesheet" type="text/css">
</head>
Code: Select all
<p>Forecast: <#forecast></p>
Code: Select all
<p align= "center"><b>12-24 Hour Forecast:</b><br>
<a href = "bt-zambrettiwcf.php" style = "text-decoration:none;" target = "_blank"><b><font color = "#FF0000" face = "Tahoma" size = "4"><script src = "bt-zambrettiwcf-cu.php"></script></font></b></a></p>
Code: Select all
<p><b>12-24 Hour Forecast:</b> <a href = "bt-zambrettiwcf.php" style = "text-decoration:none;" target = "_blank"><b><font color = "#FF0000"><script src = "bt-zambrettiwcf-cu.php"></script></font></b></a></p>
That's it! Now when Cumulus updates your website, you will see The Zambretti Weathercard Forecaster forecast on your main weather webpage. If you use Saratoga or Weather by You PHP templates on your website, keep reading.
Saratoga Templates
Open bt-zambrettiwcf-cu.php with Notepad++. Scroll down to the very bottom of the file. Add // to the front of Line 322 so it looks like this:
Code: Select all
// echo "document.write ('$zf');";// This allows displaying the forecast on a HTML webpage. Add // to the front of this line if using a PHP webpage.
ajax-dashboard.php
top.php
Using the 30 Dec 2013 04:31pm PST (31 Dec 2013 00:31 GMT) version of "Base-USA.zip":
For ajax-dashboard.php on Line 971, CHANGE:
Code: Select all
<td class="data1" style="width: 80px;font-size: 8pt;border: none;text-align: center" valign="middle" align="center"><strong><?php echo $forecasticons[0] . "</strong><br />" . $forecasttemp[0]; ?></td>
Code: Select all
<p align = "center" style = "line-height : 1.3"><b><font face = "Tahoma" size = "2">12-24 Hour Forecast:</font></b><br>
<a href = "bt-zambrettiwcf.php" style = "text-decoration:none;" target = "_blank"><b><font color = "#FF0000" face = "Tahoma" size = "4"><?php include "bt-zambrettiwcf-cu.php"; echo "$zf"; ?></font></b></a></p>
<td class="data1" style="width: 80px;font-size: 8pt;border: none;text-align: center" valign="middle" align="center"><strong><?php echo $forecasticons[0] . "</strong><br />" . $forecasttemp[0]; ?></td>
Code: Select all
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
Code: Select all
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<meta http-equiv="refresh" content="299">
Open bt-zambrettiwcf-cu.php with Notepad++. Scroll down to the very bottom of the file. Add // to the front of Line 322 so it looks like this:
Code: Select all
// echo "document.write ('$zf');";// This allows displaying the forecast on a HTML webpage. Add // to the front of this line if using a PHP webpage.
Using the "Weather Blues V2 2a" template as an example:
CHANGE Lines 34-47 FROM:
Code: Select all
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php echo $location.' | '.$TT_now; ?></title>
<meta name="keywords" content="Current, actually, last minute" />
<meta name="description" content="Current weather observations" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />
<script type="text/javascript" src="lib/clock/clockt.js"></script>
<script type="text/javascript" src="lib/clock/clockp.js"></script>
<script type="text/javascript" src="lib/dropmenu/dropdowntabs.js"></script>
<script type="text/javascript">
var dayname = new Array('<?php echo $Tr_sun."', '".$Tr_mon."', '".$Tr_tue."', '".$Tr_wed."', '".$Tr_thu."', '".$Tr_fri."', '".$Tr_sat."', '".$Tr_sun; ?>');
</script>
</head>
Code: Select all
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="299">
<title><?php echo $location.' | '.$TT_now; ?></title>
<meta name="keywords" content="Current, actually, last minute" />
<meta name="description" content="Current weather observations" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />
<script type="text/javascript" src="lib/clock/clockt.js"></script>
<script type="text/javascript" src="lib/clock/clockp.js"></script>
<script type="text/javascript" src="lib/dropmenu/dropdowntabs.js"></script>
<script type="text/javascript">
var dayname = new Array('<?php echo $Tr_sun."', '".$Tr_mon."', '".$Tr_tue."', '".$Tr_wed."', '".$Tr_thu."', '".$Tr_fri."', '".$Tr_sat."', '".$Tr_sun; ?>');
</script>
</head>
Code: Select all
<h1><?php echo $Tr_forecast; ?> : <span style="color: #000"><?php echo $forecast; ?></span></h1><br />
Code: Select all
<p align = "center" style = "line-height : 1.3"><b><font face = "Tahoma" size = "2">12-24 Hour Forecast:</font></b><br>
<a href = "bt-zambrettiwcf.php" style = "text-decoration:none;" target = "_blank"><b><font color = "#FF0000" face = "Tahoma" size = "4"><?php include "bt-zambrettiwcf-cu.php"; echo "$zf"; ?></font></b></a></p><br>
If you use a language other than English, you can customize bt-zambrettiwcf-cu.php after you extract it to the Cumulus web folder to work properly for your location. Open bt-zambrettiwcf-cu.php with Notepad++ and look at Lines 40-56, 62-90, 111-131, and 134-152. These are the lines to be changed to your local language, however, not all of what is in each line needs to be changed.
As you can see, there are Rain/Snow, Forecasts, and Month/Season names. You would have to change Snow and Rain on Lines 40-56 and the Month and Season names on Lines 111-152 to your language. For the forecasts on Lines 62-90, let's assume you are in Spain. Using Line 87 and Spanish as an example, it should be:
Code: Select all
$forecast[5] = "Cambiable, Unos $fp Peor Después";// Lluvia cambió a $fp.
The bt-zambrettiwcf-cu.php file also uses English wind directions for N, NE, E, SE, S, SW, W, NW, and Calm. If you have Cumulus set to use wind directions other than these, you need to change these.
The EASY WAY would be to click on SEARCH>REPLACE in Notepad++. Let's say you need to change NE to NO.
In FIND WHAT, enter with quotes "NE" and in REPLACE WITH, enter with quotes "NO" then click REPLACE ALL. Repeat for the other wind directions you need to change.
Save bt-zambrettiwcf-cu.php and re-upload it to your website.
CHANGE LOG:
2014-02-02
I changed all of the default forecast readings so they are based on a South wind. This way, the barometric pressure offset is an addition to the barometric pressure used. This offset is based on location, time of year, and wind direction.
2014-01-30
The JavaScripts have been converted to PHP Scripts.
Rain has been changed to a variable which is determined by temperature so Rain can be Snow in the forecasts.
2013-06-13
JavaScripts date and time represented in international standard date and time notation.
JavaScripts var bp has been changed from using the <#RCpress> webtag to using the <#altimeterpressure> webtag in order to bypass Davis Vantage Pro/Pro2 calculations of relative barometric pressure which use other factors in addition to altitude which can make the reading too low and result in an erroneous forecast. The <#altimeterpressure> webtag does the exact same thing as the <#press> webtag for non-Davis weather stations. It is represented as:
Code: Select all
var bp = parseFloat("<#altimeterpressure>".replace(",","."));
2013-06-05
Localization directions added to this post.
2013-05-30
Added the longitude to the bt-zambrettiwcf-cu.js file to make finding a location easier.
2013-05-10
Thanks to steve, support for the new Cumulus GPS webtags which convert commas into periods has been added. You must be running Cumulus 1.9.4 beta build 1073 or newer for these to work.
Added directions for other weather templates.
2013-04-25
Fixed an issue with the Calm wind reading.
2013-04-20
Fixed an issue with the barometer reading conversion to hPa not working properly with in/inHg barometric pressure readings.
2013-03-13
Original release.