Below, is the full template file as google does not seem to allow me to attach a file to a post.
## template for json data to feed the steel series gauges
## $Id: gauge-data.txt.tmpl 1279 2015-03-01 15:49:03Z mwall $
## by Matthew Wall on flight 868 ;)
## 31dec2014
## Updated 25jan2015 by M Crossley, changed cloudbase: to cloudbasevalue:
## Updated 12mar2016 by M Crossley, force pressure UoM mbar to mb.
## added UoM consitency from unit_type rather than labels which can be localised
## force rain in cm to mm as gauges do not currently handle cm's.
## Updated 04oct2016 by M Crossley, added changes from PR4
## Updated 3Jun2020 by G Roderick, rain calculations now tolerate a station that does not provide rain data
## (as distinct from rain data that is 0)
## definitions for the tags can be found here:
##
## the following fields are not directly available from weewx:
##
## ver:10?
## apptemp - calculated in this template
## apptempTL
## apptempTH
## TapptempTL
## TapptempTH
## humidex - calculated in this template
## forecast - calculated by forecasting module
## LastRainTipISO
## Tbeaufort - calculated by this template
## BearingRangeFrom10 - lowest clockwise bearing in last 10 minutes
## BearingRangeTo10 - highest clockwise bearing in last 10 minutes
## CurrentSolarMax - calculated in this template
## WindRoseData
## windrun - calculated in this template
##
## ver:12
## cloudbasevalue - calculated in this template in feet
## cloudbaseunit - defined in this template as ft
##
## ver:13
## changed UoMs
##
#import math
#import time
##
## get the time in formats that we need later
#set $ts=float($current.dateTime.raw)
#set $timeutc=time.strftime("%Y,%m,%d,%H,%M,%S", time.gmtime($ts))
##
## get some formats for calculated obs
#set $temp_format = $unit.format.outTemp
#set $press_format = $unit.format.pressure
#set $rain_format = $unit.format.rain
#set $rainrate_format = $unit.format.rainRate
#set $cloudbase_format = $unit.format.cloudbase
#set $windrun_format = $unit.format.windrun
#set $radiation_format = $unit.format.radiation
##
## see if the station has contact with the sensor
#set $sensorContactLost = 0
#set $rxchk = $getVar('current.rxCheckPercent.raw', 100)
#if $rxchk is not None and $rxchk == 0
#set $sensorContactLost = 1
#end if
##
## calculate humidex
#if $varExists('current.outTemp') and $current.outTemp.raw is not None and $varExists('current.dewpoint') and $current.dewpoint.raw is not None
#set $oT_C = $current.outTemp.degree_C.raw
#set $dp_K = $current.dewpoint.degree_C.raw + 273.16
#set $e = 6.11 * math.exp(5417.7530 * ((1/273.16) - 1/$dp_K))
#set $h = 0.5555 * ($e - 10.0)
#if $h > 0
#set $humidex = $oT_C + $h
#else
#set $humidex = $oT_C
#end if
#if $unit.unit_type.outTemp == 'degree_F'
#set $humidex = 32.0 + 1.8 * $humidex
#end if
#set $humidex = $temp_format % $humidex
#else
#set $humidex = 'N/A'
#end if
##
## calculate apparent temperature
##
## AT = Ta + 0.33*e - 0.70*ws - 4.00
## where AT and Ta (air temperature) are deg-C,
## e is water vapor pressure
## ws is wind speed (m/s) at elevation of 10 meters
## e = rh / 100 * 6.105 * exp(17.27 * Ta / (237.7 + Ta))
## rh is relative humidity
##
## AT = -2.7 + 1.04*T + 2.0*e -0.65*v
## where AT and T (air temperature) are deg-C,
## e is vapor pressure in kPa,
## and v is 10m wind speed in m/sec
##
#if $varExists('current.outTemp') and $current.outTemp.raw is not None and $varExists('current.outHumidity') and $current.outHumidity.raw is not None and $varExists('current.windSpeed') and $current.windSpeed.raw is not None
#set $oT_C = $current.outTemp.degree_C.raw
#set $rh = $current.outHumidity.raw
#set $ws = $current.windSpeed.meter_per_second.raw
#set $e = ($rh / 100) * 6.105 * math.exp(17.27 * $oT_C / (237.7 + $oT_C))
#set $apptemp = $oT_C + 0.33 * $e - 0.7 * $ws - 4.0
#if $unit.unit_type.outTemp == 'degree_F'
#set $apptemp = 32.0 + 1.8 * $apptemp
#end if
#set $apptemp = $temp_format % $apptemp
#else
#set $apptemp = 'N/A'
#end if
##
## calculate the cloud base in feet
#if $varExists('current.outTemp') and $current.outTemp.raw is not None and $varExists('current.dewpoint') and $current.dewpoint.raw is not None
#set $oT_F = $current.outTemp.degree_F.raw
#set $dp_F = $current.dewpoint.degree_F.raw
#set $a_f = $station.altitude.foot.raw
#set $cloudbase = (($oT_F - $dp_F) / 4.4 * 1000) + $a_f
#set $cloudbase = $cloudbase_format % $cloudbase
#else
#set $cloudbase = 'N/A'
#end if
##
## calculate the wind run for the day
## FIXME: this is an approximation since averages are per-hour
#set $t = time.localtime($ts)
#set $windrun = 0
#for $n in range($t[3])
#set $ago = $hours_ago(hours_ago=$n).windSpeed.avg.raw
#if $ago is not None
#set $windrun = $windrun + $ago
#end if
#end for
#if $unit.unit_type.windSpeed == 'meter_per_second'
#set $windrun = $windrun / 3.6
#end if
#set $windrun = $windrun_format % $windrun
##
## calulate solar max
## Ryan-Stolzenbach, MIT 1972 formula
##
## el - solar elevation in decimal degrees
## R - distance from earth to sun in AU
## atc - atmospheric transmission coefficient (0.70-0.91)
## z - elevation in meters
##
#if $almanac.hasExtras
#set $rs_el = $almanac.sun.alt
#set $rs_R = $almanac.sun.earth_distance
#set $rs_atc = 0.8
#set $rs_z = $station.altitude.meter.raw
#set $rs_nrel = 1367.0
#set $rs_sinel = math.sin($rs_el * math.pi / 180.0)
#if $rs_z is not None and $rs_R is not None
#if $rs_sinel < 0
#set $solarMax = 0
#else
#set $rs_rm = math.pow((288.0-0.0065*$rs_z)/288.0,5.256)/($rs_sinel+0.15*math.pow($rs_el+3.885,-1.253))
#set $rs_toa = $rs_nrel * $rs_sinel / ($rs_R * $rs_R)
#set $solarMax = $rs_toa * math.pow($rs_atc, $rs_rm)
#end if
#set $solarMax = $radiation_format % $solarMax
#else
#set $solarMax = 'N/A'
#end if
#else
#set $solarMax = 'N/A'
#end if
##
## calculate today's highest beaufort based on wind speed in knots
#if $varExists('day.windSpeed') and $day.windSpeed.max.raw is not None
#if $unit.unit_type.windSpeed == 'mile_per_hour'
#set $kts = $day.windSpeed.max.raw * 0.8689762
#elif $unit.unit_type.windSpeed == 'km_per_hour'
#set $kts = $day.windSpeed.max.raw * 0.539956
#elif $unit.unit_type.windSpeed == 'meter_per_second'
#set $kts = $day.windSpeed.max.raw * 1.943844
#elif $unit.unit_type.windSpeed == 'knot'
#set $kts = $day.windSpeed.max.raw
#else
#set $kts = 0
#end if
#if $kts < 1
#set $beaufort = 0
#elif $kts < 4
#set $beaufort = 1
#elif $kts < 7
#set $beaufort = 2
#elif $kts < 11
#set $beaufort = 3
#elif $kts < 17
#set $beaufort = 4
#elif $kts < 22
#set $beaufort = 5
#elif $kts < 28
#set $beaufort = 6
#elif $kts < 34
#set $beaufort = 7
#elif $kts < 41
#set $beaufort = 8
#elif $kts < 48
#set $beaufort = 9
#elif $kts < 56
#set $beaufort = 10
#elif $kts < 64
#set $beaufort = 11
#else
#set $beaufort = 12
#end if
#else
#set $beaufort = 'N/A'
#end if
##
## if forecasting is installed, report the Zambretti forecast
#if $varExists('forecast.zambretti')
#set $fc = $forecast.label('Zambretti', $forecast.zambretti.code)
#else
#set $fc = 'forecast is not available'
#end if
##
#set $periods = $forecast.weather_periods('WU')
#set $WU_ICON_LABELS = ["Tornado","Tropical Storm","Hurricane","Strong Storms","Thunderstorms","Rain / Snow","Rain / Sleet","Wintry Mix","Freezing Drizzle","Drizzle","Freezing Rain","Showers","Rain","Flurries","Snow Showers","Blowing / Drifting Snow","Snow","Hail","Sleet","Blowing Dust / Sandstorm","Foggy","Haze","Smoke","Breezy","Windy","Frigid / Ice Crystals","Cloudy","Mostly Cloudy","Mostly Cloudy","Partly Cloudy","Partly Cloudy","Clear","Sunny","Fair / Mostly Clear","Fair / Mostly Sunny","Mixed Rain and Hail","Hot","Isolated Thunderstorms","Scattered Thunderstorms","Scattered Showers","Heavy Rain","Scattered Snow Showers","Heavy Snow","Blizzard","Not Available (N/A)","Scattered Showers","Scattered Snow Showers","Scattered Thunderstorms"]
#if len($periods) > 0
#set $wts = ''
#set $wloc = ''
#set $fc = ''
#set $Loops = 0
#for $period in $periods
#set $wts = $period.issued_ts
#set $wloc = $period.location
#if $period.event_ts is not None
#set $fc +=$period.event_ts.string('') + ' '
#end if
#if $period.temp is not None
#set $fc += $period.temp.string('') + ' '
#end if
#if $period.clouds is None
#set $fc += 'N/A'
#else
#set $fc += $WU_ICON_LABELS[int($period.clouds)]
##set $fc += $period.clouds
#end if
#set $fc += ' '
#if $Loops > 10
#break
#else
#set $Loops += 1
#end if
#end for
#else
#set $fc='No forecast available'
#end if
##
#set $_trend = $trend(time_delta=3600).outTemp.raw
#if $_trend is None
#set $_trend = 0
#end if
#set $t_trend = $temp_format % $_trend
##
#set $_trend = $trend(time_delta=10800).barometer.raw
#if $_trend is None
#set $_trend = 0
#end if
#set $p_trend = $press_format % $_trend
##
## Set consistent units of measure
## Pressure UoM
#set $UOM_bar = $unit.unit_type.barometer
#if $UOM_bar == 'mbar'
#set $UOM_bar = 'mb'
#end if
##
## Temperature UoM
#if $unit.unit_type.outTemp == 'degree_F'
#set $UOM_temp = 'F'
#else
#set $UOM_temp = 'C'
#end if
##
## Windspeed UoM
#if $unit.unit_type.windSpeed == 'mile_per_hour'
#set $UOM_wind = 'mph'
#elif $unit.unit_type.windSpeed == 'km_per_hour'
#set $UOM_wind = 'km/h'
#elif $unit.unit_type.windSpeed == 'knot'
#set $UOM_wind = 'kts'
#elif $unit.unit_type.windSpeed == 'meter_per_second'
#set $UOM_wind = 'm/s'
#end if
##
## Rain UoM
#set $rain_mult = 1
#set $UOM_rain = $unit.unit_type.rain
#if $unit.unit_type.rain == 'inch'
#set $UOM_rain = 'in'
#elif $unit.unit_type.rain == 'cm'
## Gauges do not handle cm, convert to mm
#set $UOM_rain = 'mm'
#set $rain_mult = 10
#end if
#if $day.rain.sum.has_data
#set $day_rain = $rain_format % ($day.rain.sum.raw * $rain_mult)
#else
#set $day_rain = 0.0
#end if
#if $current.rainRate.raw is not None
#set $current_rainrate = $rainrate_format % ($current.rainRate.raw * $rain_mult)
#else
#set $current_rainrate = 0.0
#end if
#if $day.rainRate.max.has_data
#set $day_rainrate_max = $rainrate_format % ($day.rainRate.max.raw * $rain_mult)
#else
#set $day_rainrate_max = 0.0
#end if
##
## Today's High Hourly Rain
#set $hourlyrainTH = 0
#set $ThourlyrainTH = ''
#for $hour in $day.hours
#if $hour.rain.sum.has_data and $hour.rain.sum.raw > $hourlyrainTH
#set $hourlyrainTH = $hour.rain.sum.raw
#set $ThourlyrainTH = $hour.dateTime.format("%H:%M")
#end if
#end for
#set $hourlyrainTH = $hourlyrainTH * $rain_mult
#set $hourlyrainTH = $rain_format % $hourlyrainTH
"SensorContactLost":"$sensorContactLost",
"tempunit":"$UOM_temp",
"windunit":"$UOM_wind",
"pressunit":"$UOM_bar",
"rainunit":"$UOM_rain",
"cloudbaseunit":"ft",
"temp":"$current.outTemp.formatted",
"tempTL":"$day.outTemp.min.formatted",
"tempTH":"$day.outTemp.max.formatted",
"TtempTL":"$day.outTemp.mintime",
"TtempTH":"$day.outTemp.maxtime",
"temptrend":"$t_trend",
"intemp":"$current.inTemp.formatted",
"intempTL":"$day.inTemp.min.formatted",
"intempTH":"$day.inTemp.max.formatted",
"TintempTL":"$day.inTemp.mintime",
"TintempTH":"$day.inTemp.maxtime",
"hum":"$current.outHumidity.formatted",
"humTL":"$day.outHumidity.min.formatted",
"humTH":"$day.outHumidity.max.formatted",
"ThumTL":"$day.outHumidity.mintime",
"ThumTH":"$day.outHumidity.maxtime",
"inhum":"$current.inHumidity.formatted",
"dew":"$current.dewpoint.formatted",
"dewpointTL":"$day.dewpoint.min.formatted",
"dewpointTH":"$day.dewpoint.max.formatted",
"TdewpointTL":"$day.dewpoint.mintime",
"TdewpointTH":"$day.dewpoint.maxtime",
"wchill":"$current.windchill.formatted",
"wchillTL":"$day.windchill.min.formatted",
"TwchillTL":"$day.windchill.mintime",
"heatindex":"$current.heatindex.formatted",
"heatindexTH":"$day.heatindex.max.formatted",
"TheatindexTH":"$day.heatindex.maxtime",
"apptemp":"$apptemp",