They're free, but use at your own risk
The scripts referenced here are used in the operation of this weather station, and may be freely copied and used to support your station. Please note that you use these scripts at your own risk. No warranty is expressed or implied. I accept no liability for any damages that may ensue from their use.
You will need to configure them for your own particular weather station website.
A RSS Feed is available to help keep you informed on updates to the scripts.
Many of these scripts are now available on GitHub at https://github.com/ktrue
A Version History is available -- check back from time to time to see if there are updates to scripts you have downloaded earlier.
Announcements of version updates and new scripts are made on
WXForum.net and
Weather-Watch forums
and saratogaWXPHP Twitter account as they become available.
Note: Twitter widget has been disabled 3-Jul-2023 since it no longer displays the recent update Tweets.
This page was updated
Wednesday, 25-Jan-2012 10:13 AM
PHP/AJAX Website Template Set - Meteohub Setup
Overview
Since Meteohub includes both sensor-id and units in the weather tags, there are multiple setups required in Meteohub for the proper operation of your template set. You will need to configure Meteohub, then generate the necessary template files, and configure Meteohub to process those files.
Please follow the setup instructions in the sections below to have Meteohub upload your files so the template set can display your weather data.
Configure Meteohub Sensors and default Units
Access your Meteohub using the local web address like http://weatherplug/cgi-bin/meteohub.cgi
The home screen on your Meteohub has information you will need in later steps.
Remember your "Workgroup" (mine is "HOME") and "Hostname" (mine is "Weatherplug") values for later steps. Also make sure that "SMB Shares" are running.
Click on the Sensors panel to show your current sensor IDs (highlighted in red outlines below).
Edit the MHconfig/MH-sensors.php page in your editor.
Change the configuration to match the sensor IDs shown in your Sensors display.
Then use the Meteohub Dashboard screen:
Change the Units area to reflect the default units of measure to be used for each sensor, then press Save.
The Dashboard is used to set the default units in the [actual_station_<sensorname>_units] tags which are used in the MH-defs.php for unit conversions as necessary. You don't need to display the Meteohub Dashboard itself, you only need to have it configured as discussed above.
Make the corresponding changes in MHconfig/MH-sensors.php file shown below, save it and upload it to your website.
<?php
#
# Note: the case of all the arguments below must be lower case in order to match the
# MeteoHub variable names exactly. See the examples in the comments after the arguments
# for the proper values to use.
#
# SENSOR specifications:
# // NOTE: use the sensor names from your Meteohub sensors screen here
$MH_OUTSIDE = 'th0'; // sensor for temp/humidity outside
$MH_INSIDE = 'thb1'; // sensor for temp/humidity/barometer inside
$MH_WIND = 'wind0'; // sensor for wind speed/direction
$MH_RAIN = 'rain0'; // sensor for rain
#
$MH_UV = 'uv0'; // sensor for UV index ='uv0' or ='none' if no UV sensor installed
$MH_SOLAR = 'sol0'; // sensor for solar radiation ='sol0' or ='none' if no Solar sensor installed
#
# Units of measure for reporting to website
#
$MH_units = 'E'; // ='E" for f,mph,inhg,in ='M' for c,kmh,hpa,mm
if($MH_units == 'E') { // English/Imperial units:
#
# // NOTE: use ONLY the values listed below for the assignments
$MH_TUOM = 'f'; // ='c' or ='f' for temperature reporting
$MH_PUOM = 'inhg'; // ='hpa' ='inhg', ='mmhg',, ='psi' for pressure reporting
$MH_WUOM = 'mph'; // ='ms', ='kmh', ='mph', ='kn' for wind reporting
$MH_RUOM = 'in'; // ='in', ='mm' for rain reporting
$MH_EUOM = 'inch'; // ='inch', ='mm' for evapotranspiration reporting
$MH_HUOM = 'ft'; // ='ft', ='m' for cloud height reporting
} else { // Metric units:
# // NOTE: use ONLY the values listed below for the assignments
$MH_TUOM = 'c'; // ='c' or ='f' for temperature reporting
$MH_PUOM = 'hpa'; // ='hpa' ='inhg', ='mmhg',, ='psi' for pressure reporting
$MH_WUOM = 'kmh'; // ='ms', ='kmh', ='mph', ='kn' for wind reporting
$MH_RUOM = 'mm'; // ='in', ='mm' for rain reporting
$MH_EUOM = 'mm'; // ='inch', ='mm' for evapotranspiration reporting
$MH_HUOM = 'm'; // ='ft', ='m' for cloud height reporting
}
?>
Note that the allowed values are shown in the comments on each sensor. Changing $MH_units = 'E'; to $MH_units = 'M'; provides a quick way to switch from the default English/Imperial units to the common Metric units.
To change the wind units, be sure to edit the $MH_WUOM line in the correct English or Metric section.
Generate your customized tags and graphics files
Now open your Windows Explorer (the file manager one) and start opening at "My Network Places", "Entire Network", "Microsoft Windows Network", "HOME" (or your Meteohub Workgroup setting), "Weatherplug" (or your Meteohub Hostname setting). Then open the "Public", "Graphs" directory , and that is where you copy the template files to (both html and .mg files) that are generated in the next step. If you're using a MAC, use the Finder for this process instead of Windows Explorer.
Use your browser to access http://your.website.com/MHconfig/index.php configuration utility.
Validate that the sensor-ids and units are correctly specified in the first red-outlined box above. Make any corrections needed to the MHconfig/MH-sensors.php configuration file, upload it, and repeat until the sensor-ids and units match what you have configured in Meteohub.
Then click on each link shown in the lower red-outlined box to generate each file needed for your configuration.
Save each file generated to the location specified on the page, and use the name specified in the Filename column.
Do this for every Filename listed on the page.
When it says 'graphs directory on Meteohub system' it means save the file to the /public/graphs directory using the SMB fileshare on your Meteohub system that you located in the prior step.
Configure Meteohub to process and upload the files
Using the Meteohub web configuration at http://weatherplug/cgi-bin/meteohub.cgi,
open the WD / MW Live screen:
and make sure the correct sensors are set in the outlined area for your sensor configuration.
Put a name for your weather site in the Station Name text field. Do not use a dash (-) in the station name as it will cause the AJAX script to not update your site properly. Press Save to lock in the settings when you are finished with the configuration.
Open the Graph Uploads screen.
Make entries using the web interface so that the template files are uploaded with the schedules listed in the graphic. Press Save after each selection to enable the setting. The order of the settings is not important, only the presence of scheduled uploads in the list is important..
To upload the yesterday template, select 'Individual' schedule and place '59 23 * * *' in the 'Individual Schedule' box, then press Save.
Note: some of the graphics upload selections depend on your station sensors and the presence/absence of Solar and/or UV sensors. All the files shown in the http://your.website.com/MHconfig/index.php page should be available and should be uploaded to make complete display of your available data.
The minimum required files to be uploaded (with schedules) are:
MHtags.php - 5 minute
clientraw.txt - 1 minute
yesterday.php - 59 23 * * *
windrose.png - 5 minute
tdpb2day.png - 5 minute
windrain2day.png - 5 minute
Your configuration for Meteohub is now completed. Please note that the values for yesterday weather conditions will not be displayed until after Meteohub has processed the yesterday.html template file to create yesterday.php and upload it at 1 minute before midnight. The next day, your dashboard and wxtrends page should show the values for yesterday. The other files/graphs should be available on your website within 5 minutes or so.