A lot of these customizations, but not all, are already "in the box." Take
a look through the Customizing Guide
<http://www.weewx.com/docs/customizing.htm>.

For example, $yesterday.dateTime will give you the start of the day
yesterday.

$current.windSpeed.mile_per_hour will always give the wind speed in mph.
Same with the other conversions you are doing.

$current.windSpeed.beaufort will give you the Beaufort number (V4.2.0 or
later)

$current.humidex will give the current humidex (no need to calculate it).

The one thing WeeWX does not do much for you is working with UTC.

In general, it is bad practice to mix look and feel with data manipulation.
You're better off doing the data calculations in search list extensions,
which can then be used in other skins.

On Mon, Mar 29, 2021 at 10:54 AM WindnFog <[email protected]> wrote:

> Here it is:
>
> #errorCatcher Echo
> ##
>
> #####################################################################################################################################
> ## This template is a modified version of the one distributed with the
> weewx software system written by Dr Tom Keffer.              #
> ##
> #
>
> #####################################################################################################################################
> ##
> ##
> ## 2018-02-02 - Some monkeying around here converting from STRICT to
> TRANSITIONAL by me (PMD)
> ##
> #encoding utf-8
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <head profile="http://www.w3.org/2005/10/profile";>
>
>     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>
>
>     <title>$station.location Current Weather Conditions</title>
>     <link rel="stylesheet" type="text/css" href="weewx.css"/>
>     <link rel="icon" type="image/png" href="favicon.ico" />
>     <script type="text/javascript">
>       function openURL(urlname)
>       {
>         window.location=urlname;
>       }
>       function openNoaaFile(date)
>       {
>         var url = "NOAA/NOAA-";
>         url = url + date;
>         url = url + ".txt";
>         window.location=url;
>       }
>     </script>
>   </head>
>
> ## Calculate UTC date and time
>
>   #import math
>   #import time
>   #import datetime
>
> ##
> ## Figure out yesterday's date and format as a DD-MMM-YYYY string
> ##
>   #from datetime import date, timedelta
>   #set $today = date.today()
>   #set $yesterday = today - timedelta(days = 1)
>   #set $yesterday_st = yesterday.strftime("%d %b %Y")
>
>   #from dateutil import relativedelta
>   #set $gmt_date_st = time.gmtime($current.dateTime.raw)
>   #set $gmt_date = time.strftime("%d %b %Y", $gmt_date_st)
>   #set $gmt_day = time.strftime("%A", $gmt_date_st)
>   #set $gmt_st = time.gmtime($current.dateTime.raw)
>   #set $gmt = time.strftime("%H:%M", $gmt_st)
>
>   #set $my_tz = 'ADT'
>
> ## Format local date
>
>   #set $local_st = time.localtime($current.dateTime.raw)
>   #set $local_date = time.strftime("%d %b %Y", $local_st)
>   #set $local = time.strftime("%H:%M", $local_st)
>   #set $local_day = time.strftime("%A", $local_st)
>
> ## Construct tide URL
>
>   #set $part_1="\"https://tides.gc.ca/eng/station?type=0&date=";
>   #set $part_2=time.strftime("%Y/%m/%d")
>   #set $part_3="&sid=490&tz=$my_tz&pres=0\""
>   #set $tide_URL=$part_1+$part_2+$part_3
>
>   <body>
>     <div id="container">
>       <div id="masthead">
>         <h1>$station.location, Canada</h1>
>         <h2>Current Weather Conditions at Amateur Radio Station VE1DX</h2>
>         <h2>$local_day, $local_date - $local $my_tz<br/>$gmt_day,
> $gmt_date - $gmt UTC</h2>
>       </div>
>
>       <div id="stats_group">
>
>         <div class="stats">
>           <div class="stats_header">
>             Current Conditions
>           </div>
>
> ##        Derive Imperial values for the current conditions table
>
>           #set $f_outTemp       = ( $current.outTemp.raw * 1.8 ) + 32.0
>           #set string_outTemp   = "%6.1f" % $f_outTemp
>
>           #set $f_windchill     = ( $current.windchill.raw * 1.8 ) + 32.0
>           #set string_chill     = "%6.1f" % $f_windchill
>
>           #set $f_heatindex      = ( $current.heatindex.raw * 1.8 ) + 32.0
>           #set string_heat_index = "%6.1f" % $f_heatindex
>
>           #set $f_dewpoint      = ( $current.dewpoint.raw * 1.8 ) + 32.0
>           #set string_dew       = "%6.1f" % $f_dewpoint
>
>           #set $inHg            = ( $current.barometer.raw * 0.0295300 )
>           #set string_inHg      = "%6.2f" % $inHg
>
>           #set $bar_trend       = ( $trend.barometer.raw * 0.0295300 )
>           #set string_bar_trend = "%6.2f" % $bar_trend
>
>           #set $w_mph           = ( $current.windSpeed.raw *
> 0.62137119223733 )
>           #set string_w_mph     = "%6.1f" % $w_mph
>
>           #set $in_h            = ( $current.rainRate.raw / 25.4 )
>           #set string_in_h      = "%6.1f" % $in_h
>
> ##        Calculate the Canadian humidex parameter
>
>           #import math
>           #set $kelvin = 273.15
>           #set $temperature = ( $current.outTemp.raw + $kelvin )
>           #set $dewpoint = ( $current.dewpoint.raw + $kelvin )
>           #set $e = ( 6.11 * math.exp(5417.7530 * ((1 / $kelvin) - (1 /
> $dewpoint))) )
>           #set $es = ( 6.11 * math.exp(5417.7530 * ((1 / $kelvin) - (1 /
> $temperature))) )
>           #set $humidity = ( $e / $es )
>           #set $h = ( 0.5555 * ($e - 10.0) )
>           #set $humidex = ( $temperature + $h - $kelvin )
>           #set $f_humidex = ( $humidex * 1.8 ) + 32.0
>           #set string_humidex = "%6.1f" % $humidex
>           #set f_string_humidex = "%6.1f" % $f_humidex
>
> ##        Calculate today's current Beaufort based on wind speed in knots
>
>           #set $current_kts = 0
>           #if $varExists('day.windSpeed') and $current.windSpeed.raw is
> not None
>           #if $unit.unit_type.windSpeed == 'mile_per_hour'
>           #set $current_kts = $current.windSpeed.raw * 0.8689762
>           #elif $unit.unit_type.windSpeed == 'km_per_hour'
>             #set $current_kts = $current.windSpeed.raw * 0.539956
>           #elif $unit.unit_type.windSpeed == 'meter_per_second'
>             #set $current_kts = $current.windSpeed.raw * 1.943844
>           #elif $unit.unit_type.windSpeed == 'knot'
>             #set $current_kts = $current.windSpeed.raw
>           #else
>             #set $current_kts = 0
>           #end if
>           #if $current_kts < 1
>             #set $current_beaufort = 0
>             #set $word_current_beaufort = 'Calm'
>           #elif $current_kts < 4
>             #set $current_beaufort = 1
>             #set $word_current_beaufort = 'Light air'
>           #elif $current_kts < 7
>             #set $current_beaufort = 2
>             #set $word_current_beaufort = 'Light breeze'
>           #elif $current_kts < 11
>             #set $current_beaufort = 3
>             #set $word_current_beaufort = 'Gentle breeze'
>           #elif $current_kts < 17
>             #set $current_beaufort = 4
>             #set $word_current_beaufort = 'Moderate breeze'
>           #elif $current_kts < 22
>             #set $current_beaufort = 5
>             #set $word_current_beaufort = 'Fresh breeze'
>           #elif $current_kts < 28
>             #set $current_beaufort = 6
>             #set $word_current_beaufort = 'Strong breeze'
>           #elif $current_kts < 34
>             #set $current_beaufort = 7
>             #set $word_current_beaufort = 'High wind'
>           #elif $current_kts < 41
>             #set $current_beaufort = 8
>             #set $word_current_beaufort = 'Gale'
>           #elif $current_kts < 48
>             #set $current_beaufort = 9
>             #set $word_current_beaufort = 'Strong gale'
>           #elif $current_kts < 56
>             #set $current_beaufort = 10
>             #set $word_current_beaufort = 'Storm'
>           #elif $current_kts < 64
>             #set $current_beaufort = 11
>             #set $word_current_beaufort = 'Violent storm'
>           #else
>             #set $current_beaufort = 12
>             #set $word_current_beaufort = 'Hurricane'
>           #end if
>           #else
>             #set $current_beaufort = 'N/A'
>           #end if
>
>           <table>
>             <tbody>
>               <tr>
>                 <td class="stats_label"><b><font size="4">Outside
> Temp</font></b></td>
>                 <td class="stats_data"><b><font
> size="4">$current.outTemp</font></b></td>
>                 <td class="stats_data"><b><font
> size="4">$string_outTemp&#8457;</font></b></td>
>               </tr>
>               <tr>
>                 <td class="stats_label">Wind Chill</td>
>                 <td class="stats_data">$current.windchill</td>
>                 <td class="stats_data">$string_chill&#8457;</td>
>               </tr>##
>               <tr>
>                 <td class="stats_label">Humidex (Canadian "feels like"
> scale)
>                 <td class="stats_data"/>$string_humidex&#8451</td>
>                 <td class="stats_data">$f_string_humidex&#8457;</td>
>               </tr>
>               <tr>
>                 <td class="stats_label">Heat Index (US "feels like"
> scale)</td>
>                 <td class="stats_data">$current.heatindex</td>
>                 <td class="stats_data">$string_heat_index&#8457;</td>
>               </tr>
>               <tr>
>                 <td class="stats_label">Dewpoint</td>
>                 <td class="stats_data">$current.dewpoint</td>
>                 <td class="stats_data">$string_dew&#8457;</td>
>               </tr>
>               <tr>
>                 <td class="stats_label">Humidity</td>
>                 <td class="stats_data">$current.outHumidity</td>
>                 <td class="stats_data">$current.outHumidity</td>
>               </tr>
>               <tr>
>                 <td class="stats_label">Barometer</td>
>                 <td class="stats_data">$current.barometer</td>
>                 <td class="stats_data">$string_inHg inHg</td>
>               </tr>
>               <tr>
>                 <td class="stats_label">Barometer Trend
> ($trend.time_delta.hour.format("%.0f"))</td>
>                 <td class="stats_data">$trend.barometer</td>
>                 <td class="stats_data">$string_bar_trend inHg</td>
>               </tr>
>               <tr>
>                 <td class="stats_label">
>
>                   Wind<br/>
>                  Beaufort Scale
>                 </td>
>                   <td class="stats_data">$current.windSpeed from
> $current.windDir ($current.windDir.ordinal_compass) <br/>
>                       Force $current_beaufort ($word_current_beaufort)</td>
>                      <td class="stats_data">$string_w_mph mph <br/>
> $("%.1f knots"% $current_kts) </td>
>               </tr>
>               <tr>
>                 <td class="stats_label">Rain Rate</td>
>                 <td class="stats_data">$current.rainRate</td>
>                 <td class="stats_data">$string_in_h in/hr</td>
>               </tr>
>             </tbody>
>           </table>
>         </div>
>
> ##       Obtain yesterday's values. (This method of obtaining yesterday's
> values is not documented or
> ##                                   officially supported, so I might have
> to alter it in the future.)
>
>          #set $yesterday=$current.dateTime.raw - 86400
>          <p><font color="red"><b>24 hours ago:&nbsp; </font> <font
> color="black">
>          Temp was $current(timestamp=$yesterday,
> max_delta=600).outTemp</b> </br>
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
>          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
>          (Max: $span(hour_delta = 24).outTemp.max on $span(hour_delta =
> 24).outTemp.maxtime.format("%A at %k:%M"))<br/>
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
>          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
>          (Min: $span(hour_delta = 24).outTemp.min on $span(hour_delta =
> 24).outTemp.mintime.format("%A at %k:%M"))<br/>
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
>          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
>          Wind Chill was $current(timestamp=$yesterday,
> max_delta=600).windchill<br/>
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
>          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
>          Heat Index was $current(timestamp=$yesterday,
> max_delta=600).heatindex<br/>
>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
>          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
>          Rain Rate was $current(timestamp=$yesterday,
> max_delta=600).rainRate.
>          </p>
>
>          <p>&nbsp;</p>
>
> ##        Calculate today's highest Beaufort based on wind speed in knots
>
>           #set $max_kts = 0
>           #if $varExists('day.windSpeed') and $day.windSpeed.max.raw is
> not None
>           #if $unit.unit_type.windSpeed == 'mile_per_hour'
>           #set $max_kts = $day.windSpeed.max.raw * 0.8689762
>           #elif $unit.unit_type.windSpeed == 'km_per_hour'
>             #set $max_kts = $day.windSpeed.max.raw * 0.539956
>           #elif $unit.unit_type.windSpeed == 'meter_per_second'
>             #set $max_kts = $day.windSpeed.max.raw * 1.943844
>           #elif $unit.unit_type.windSpeed == 'knot'
>             #set $max_kts = $day.windSpeed.max.raw
>           #else
>             #set $max_kts = 0
>           #end if
>           #if $max_kts < 1
>             #set $beaufort = 0
>             #set $word_beaufort = 'Calm'
>           #elif $max_kts < 4
>             #set $beaufort = 1
>             #set $word_beaufort = 'Light air'
>           #elif $max_kts < 7
>             #set $beaufort = 2
>             #set $word_beaufort = 'Light breeze'
>           #elif $max_kts < 11
>             #set $beaufort = 3
>             #set $word_beaufort = 'Gentle breeze'
>           #elif $max_kts < 17
>             #set $beaufort = 4
>             #set $word_beaufort = 'Moderate breeze'
>           #elif $max_kts < 22
>             #set $beaufort = 5
>             #set $word_beaufort = 'Fresh breeze'
>           #elif $max_kts < 28
>             #set $beaufort = 6
>             #set $word_beaufort = 'Strong breeze'
>           #elif $max_kts < 34
>             #set $beaufort = 7
>             #set $word_beaufort = 'High wind'
>           #elif $max_kts < 41
>             #set $beaufort = 8
>             #set $word_beaufort = 'Gale'
>           #elif $max_kts < 48
>             #set $beaufort = 9
>             #set $word_beaufort = 'Strong gale'
>           #elif $max_kts < 56
>             #set $beaufort = 10
>             #set $word_beaufort = 'Storm'
>           #elif $max_kts < 64
>             #set $beaufort = 11
>             #set $word_beaufort = 'Violent storm'
>           #else
>             #set $beaufort = 12
>             #set $word_beaufort = 'Hurricane'
>           #end if
>           #else
>             #set $beaufort = 'N/A'
>           #end if
>
>
> ##        Convert the maximum wind speed to mph
>
>           #set $day_w_mph = ( $day.windSpeed.max.raw * 0.62137119223733 )
>
>
>         <div class="stats">
>           <div class="stats_header">
>             Since Midnight
>           </div>
>
>           <table>
>             <tbody>
>               <tr>
>                 <td class="stats_label">
>                   High Temperature<br/>
>                   Low Temperature
>                 </td>
>                 <td class="stats_data">
>                   $day.outTemp.max at $day.outTemp.maxtime<br/>
>                   $day.outTemp.min at $day.outTemp.mintime<br/>
>                 </td>
>               </tr>
>               <tr>
>                 <td class="stats_label">
>                   High Heat Index<br/>
>                   Low Wind Chill
>                 </td>
>                 <td class="stats_data">
>                   $day.heatindex.max at $day.heatindex.maxtime<br/>
>                   $day.windchill.min at $day.windchill.mintime
>                 </td>
>               </tr>
>               <tr>
>                 <td class="stats_label">##
>                   High Humidity<br/>
>                   Low Humidity
>                 </td>
>                 <td class="stats_data">
>                   $day.outHumidity.max at $day.outHumidity.maxtime<br/>
>                   $day.outHumidity.min at $day.outHumidity.mintime
>                 </td>
>               </tr>
>               <tr>
>                 <td class="stats_label">
>                   High Dewpoint<br/>
>                   Low Dewpoint
>                 </td>
>                 <td class="stats_data">
>                   $day.dewpoint.max at $day.dewpoint.maxtime<br/>
>                   $day.dewpoint.min at $day.dewpoint.mintime
>                 </td>
>               </tr>
>               <tr>
>                 <td class="stats_label">
>                   High Barometer<br/>
>
>                   Low Barometer
>                 </td>
>                 <td class="stats_data">
>                   $day.barometer.max at $day.barometer.maxtime<br/>
>                   $day.barometer.min at $day.barometer.mintime
>
>                 </td>
>               </tr>
>               <tr>
>                 <td class="stats_label">Today's Rain</td>
>                 <td class="stats_data">$day.rain.sum</td>
>               </tr>
>               <tr>
>                 <td class="stats_label">High Rain Rate</td>
>                 <td class="stats_data">$day.rainRate.max at
> $day.rainRate.maxtime</td>
>               </tr>
>               <tr>
>                 <td class="stats_label">
>                   High Wind<br/>
>                   High Beaufort Scale
>                 </td>
>                 <td class="stats_data">
>                   $day.wind.max from $day.wind.gustdir at
> $day.wind.maxtime<br/>
>                   Force $beaufort ($word_beaufort) $("%.1f knots"%
> $max_kts) or $("%.1f mph"% $day_w_mph)
>                 </td>
>               </tr>
>               <tr>
>                 <td class="stats_label">
>                   Average Wind
>                 </td>
>                 <td class="stats_data">
>                   $day.wind.avg
>                 </td>
>               </tr>
>               <tr>
>                 <td class="stats_label">
>                   RMS Wind
>                 </td>
>                 <td class="stats_data">
>                   $day.wind.rms
>                 </td>
>               </tr>
>
>               <tr>
>                 <td class="stats_label">
>                   Vector Average Speed<br/>
>                   Vector Average Direction
>                 </td>
>                 <td class="stats_data">
>                   $day.wind.vecavg<br/>
>                   $day.wind.vecdir
>                 </td>
>               </tr>
>             </tbody>
>           </table>
>         </div> <!--End class "stats" -->
>
>         <p>&nbsp;</p>
>
>         #if $Extras.has_key('radar_img')
>         <div id="radar_img">
>           #if $Extras.has_key('radar_url')
>           <a  href="$Extras.radar_url">
>           #end if
>             <img src="$Extras.radar_img" alt="Radar" />
>           #if $Extras.has_key('radar_url')
>           </a>
>           <p>Click image for expanded radar loop</p>
>           #end if
>         </div>
>
>         <p>This webcam generates a still photo every 5 minutes during
> daylight hours.</p>
>         <div id="wx_pix_img">
>           <a  href="wx_pix.jpg">
>             <img src="wx_pix_small.jpg" alt="Webcam" width="420px"
> height="310px"
>             style="border:1px solid black"/>
>           </a>
>           <p>Click image for larger picture</p>
>         </div>
>
>           <br/>
>           <br/>
>
>           <br/>
>           <br/>
>           <br/>
>
>           #set $vtoday = datetime.date.today
>           #set $vbegin = datetime.date(2017,1,1)
>           #set $vyesterday = $vtoday - datetime.timedelta(days=1)
>           #set $vdelta = relativedelta.relativedelta($vyesterday,$vbegin)
>           #set $vyears = $vdelta.years
>           #set $vmonths = $vdelta.months
>           #set $vdays = $vdelta.days
>
>           #set $vday_str = 'days'
>           #if  $vdays == 1
>             #set $vday_str = 'day'
>           #end if
>
>           #set $vmnth_str = 'months'
>           #if  $vmonths == 1
>             #set $vmnth_str = 'month'
>           #end if
>
>        <p>This is a time lapse video from 1 Jan 2017 to $yesterday_st
> ($vyears years, $vmonths $vmnth_str, and $vdays $vday_str.)</p>
>         <div id="mov_pix_img">
> ##          <a  href="video.mp4">
>             <a  href="https://ve1dx.net/video.mp4";>
>             <img src="https://ve1dx.net/smaller_daily_frame.jpg";
> alt="Time Lapse" width="420px" height="310px"
>             style="border:1px solid black"/>
>           </a>
>          <br/>
>          <br/>
>          Click the image above to play the 3 to 4 minute video
>          <br/>
>         </div>
>         #end if
>       </div> <!--End class "stats_group" -->
>
>
>       <div id="content">
>         <div id="about">
>           <div class="header">
>             About this weather station:
>           #set $today = datetime.date.today
>           #set $begin = datetime.date(2015,9,27)
>           #set $delta = relativedelta.relativedelta($today,$begin)
>           #set $years = $delta.years
>           #set $months = $delta.months
>           #set $days = $delta.days
>
>           <br/>
>           <br/>
>
>           #set $day_str = 'days'
>           #if  $days == 1
>             #set $day_str = 'day'
>           #end if
>
>           #set $mnth_str = 'months'
>           #if  $months == 1
>             #set $mnth_str = 'month'
>           #end if
>
>           <font size="2">Collecting weather data since 27 Sept 2015
> ($years years, $months $mnth_str, and $days $day_str)
>           </div>
>           <table>
>             <caption class="caption">Location</caption>
>             <tr>
>               <td class="label">Latitude:</td>
>               <td class="data">$station.latitude[0]&deg;
> $station.latitude[1]' $station.latitude[2]</td>
>             </tr>
>             <tr>
>               <td class="label">Longitude:</td>
>               <td class="data">$station.longitude[0]&deg;
> $station.longitude[1]' $station.longitude[2]</td>
>             </tr>
>             <tr>
>               <td class="label">Ground ASL:</td>
>               <td class="data"> 19 meters</td>
>               </tr>
>               <tr>
>               <td class="label">Sensor Suite Above Ground:</td>
>               <td class="data"> 7 meters</td>
>               </tr>
>               <tr>
>               <td class="label">Sensor Suite ASL:</td>
>               <td class="data">$station.altitude</td>
>             </tr>
>           </table>
>
>              <br/>
>               <a  href="wx_station.gif">
>                <img src="wx_station.gif" alt="Station" width="263px"
> height="350px"
>                style="border:1px solid black"/>
>              </a>##            #set $creation = $initial.dateTime.raw
>              <br/>
>
>           <p>
>             This station uses a <a href="
> https://www.davisinstruments.com/product/vantage-vue-wireless-weather-station/
> ">
>             Davis $station.hardware VUE</a>, controlled by
>             <a href="http://www.weewx.com";>weewx</a>, an experimental
> weather software system written in Python
>             #import sys
>             #set $ver_maj = sys.version_info[0]
>             #set $ver_min = sys.version_info[1]
>             #set $ver_mic = sys.version_info[2]
>             $ver_maj.$ver_min.$ver_mic.
>             <br/>
>             Weewx was designed to be simple, fast, and easy to understand
> by leveraging modern software concepts.
>             <br/>
>             This software is running on a
>             <a href="
> https://www.raspberrypi.org/products/raspberry-pi-4-model-b/";>Raspberry
> Pi 4
>             </a>
>             equipped with a V2 8MP camera, using the Debian-based
>             <a href="https://www.raspbian.org/";>Raspbian GNU/Linux 10</a>
> operating system.
>             <br/>
>             <br/>
>                <a  href="
> https://www.davisinstruments.com/product/vantage-vue-wireless-weather-station/
> ">
>                <img src="weather_thing.gif" hspace="40" alt="Davis Vantage
> VUE" width="225px" height="225px"/>
>               </a>
>               <a  href="
> https://www.raspberrypi.org/products/raspberry-pi-4-model-b/";>
>                <img src="pi4_small.jpg" alt="Raspberry Pi 4 Model B"
> width="282px" height="209px"/>
>               </a>
>
>             <br/>
>             <br/>The Integrated Sensor Suite (ISS) transmits sensor data
> to the base station every 2.5 seconds at
>             a rate of 19.2 kbps.
>             <br/>These data are archived, which enables weewx to perform
> analytics and update the
>             website accordingly every 5 minutes.
>             <br/>This station's implementation of <a href="
> http://www.weewx.com";>weewx</a> does not perform forecasts.
>
>
>           </p>
>           <p>
>           </p>
> ##          <p><a href="RSS/weewx_rss.xml">RSS feed</a></p>
>           <p><a href="mobile.html">Mobile formatted</a></p>
>           <p><a href="smartphone/index.html">Smartphone formatted</a></p>
>           <p>Weewx uptime:  $station.uptime<br/>
>              Server uptime: $station.os_uptime<br/>
>              weewx v$station.version<br/>
>              Console battery: $current.consBatteryVoltage<br/>
>              Remote sensor signal strength:
> $current.rxCheckPercent</p>
>         </div> <!-- End id "about" -->
>
>         <div id="almanac">
>           <div class="header">
>             Today's Almanac
>             <br/>
>           </div>
>           <div class="celestial_group">
>             #if $almanac.hasExtras
>             ## Extended almanac information is available. Do the full set
> of tables.
>             #set $sun_altitude = $almanac.sun.alt
>             #if $sun_altitude < 0
>             #set $sun_None="<i>(Always down)</i>"
>             #else
>             #set $sun_None="<i>(Always up)</i>"
>             #end if
>             <div class="celestial_body">
>               <table>
>                 <caption class="caption">Sun</caption>
>                 <tr>
>                   <td class="label">Start civil twilight:</td>
>                   <td
> class="data">$almanac(horizon=-6).sun(use_center=1).rise</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Sunrise:</td>
>                   <td class="data">$almanac.sun.rise.string($sun_None)</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Transit:</td>
>                   <td class="data">$almanac.sun.transit</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Sunset:</td>
>                   <td class="data">$almanac.sun.set.string($sun_None)</td>
>                 </tr>
>                 <tr>
>                   <td class="label">End civil twilight:</td>
>                   <td
> class="data">$almanac(horizon=-6).sun(use_center=1).set</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Azimuth:</td>
>                   <td class="data">$("%.1f&deg;" % $almanac.sun.az)</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Altitude:</td>
>                   <td class="data">$("%.1f&deg;" % $sun_altitude)</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Right ascension:</td>
>                   <td class="data">$("%.1f&deg;" % $almanac.sun.ra)</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Declination:</td>
>                   <td class="data">$("%.1f&deg;" % $almanac.sun.dec)</td>
>                 </tr>
>                 #if $almanac.next_equinox.raw < $almanac.next_solstice.raw
>                 ## The equinox is before the solstice. Display them in
> order.
>                 <tr>
>                   <td class="label">Equinox:</td>
>                   <td class="data">$almanac.next_equinox.format("%d-%b-%Y
> %H:%M")</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Solstice:</td>
>                   <td class="data">$almanac.next_solstice.format("%d-%b-%Y
> %H:%M")</td>
>                 </tr>
>                 #else
>                 ## The solstice is before the equinox. Display them in
> order.
>                 <tr>
>                   <td class="label">Solstice:</td>
>                   <td class="data">$almanac.next_solstice.format("%d-%b-%Y
> %H:%M")</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Equinox:</td>
>                   <td class="data">$almanac.next_equinox.format("%d-%b-%Y
> %H:%M")</td>
>                 </tr>
>                 #end if
>               </table>
>             </div> <!-- end class "celestial_body" -->
>             <div class="celestial_body">
>               <table>
>                 <caption class="caption">Moon</caption>
>                 <tr>
>                   <td class="label">Rise:</td>
>                   <td class="data">$almanac.moon.rise</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Transit:</td>
>                   <td class="data">$almanac.moon.transit</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Set:</td>
>                   <td class="data">$almanac.moon.set</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Azimuth:</td>
>                   <td class="data">$("%.1f&deg;" % $almanac.moon.az)</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Altitude:</td>
>                   <td class="data">$("%.1f&deg;" % $almanac.moon.alt)</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Right ascension:</td>
>                   <td class="data">$("%.1f&deg;" % $almanac.moon.ra)</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Declination:</td>
>                   <td class="data">$("%.1f&deg;" % $almanac.moon.dec)</td>
>                 </tr>
>                 #if $almanac.next_full_moon.raw <
> $almanac.next_new_moon.raw
>                 <tr>
>                   <td class="label">Full moon:</td>
>                   <td
> class="data">$almanac.next_full_moon.format("%d-%b-%Y %H:%M")</td>
>                 </tr>
>                 <tr>
>                   <td class="label">New moon:</td>
>                   <td class="data">$almanac.next_new_moon.format("%d-%b-%Y
> %H:%M")</td>
>                 </tr>
>                 #else
>                 <tr>
>                   <td class="label">New moon:</td>
>                   <td class="data">$almanac.next_new_moon.format("%d-%b-%Y
> %H:%M")</td>
>                 </tr>
>                 <tr>
>                   <td class="label">Full moon:</td>
>                   <td
> class="data">$almanac.next_full_moon.format("%d-%b-%Y %H:%M")</td>
>                 </tr>
>                 #end if
>                 <tr>
>                   <td class="label">Phase:</td>
>                   <td
> class="data">$almanac.moon_phase<br/>($almanac.moon_fullness% full)</td>
>                  </tr>
>                 </table>
>              </div> <!-- end class "celestial_body" -->
>             #else
>             ## No extended almanac information available. Fall back to a
> simple table.
>             <table>
>               <tr>
>                 <td class="label">Sunrise:</td>
>                 <td class="data">$almanac.sunrise</td>
>               </tr>
>               <tr>
>                 <td class="label">Sunset:</td>
>                 <td class="data">$almanac.sunset</td>
>               </tr>
>               <tr>
>                 <td class="label">Moon Phase:</td>
>                 <td
> class="data">$almanac.moon_phase<br/>($almanac.moon_fullness% full)</td>
>               </tr>
>             </table>
>             #end if
>
> ##        Plot day / night showing sun and moon
>
>            <br/>
>            <br/>
>            #set $str_plot_time = $current.dateTime.format("%Y%mT%H%M")
>              <img src="
> https://www.timeanddate.com/scripts/sunmap.php?iso=$str_plot_time";
> width="448px" height="224px" style="border:1px solid black"
>              alt=""/>
> ##             alt="Terminator map offline"/>
>            <br/>
>
> ## Backup URL for terminator map
> ##
> ##        <img src="
> https://www.fourmilab.ch/cgi-bin/Earth?img=learth.evif&imgsize=128&dynimg=y&opt=-p&lat=44.4&lon=63.3&ew=West&alt=&tle=&date=0
> ##                alt="Daylight" style="border:1px solid black">
>
>             #set $now = $current.dateTime.raw
>             #set $yesterday = $now - 24*3600
>             #set $today_daylight = $almanac.sun.set.raw -
> $almanac.sun.rise.raw
>             #set $yesterday_daylight =
> $almanac($almanac_time=$yesterday).sun.set.raw -
> $almanac($almanac_time=$yesterday).sun.rise.raw
>             #set $difference = $today_daylight - $yesterday_daylight
>             #set $difference_min = abs($difference) //60
>             #set $seconds = $almanac.sun.set.raw - $almanac.sun.rise.raw
>             #set $difference_sec = $almanac.sun.set.raw -
> $almanac.sun.rise.raw
>             #set $hours = $seconds //3600
>             #set $seconds %= 3600
>             #set $minutes = $seconds//60
>             #set $seconds %= 60
>
>
>           #set $hr_str = 'hours'
>           #if  $hours == 1
>             #set $hr_str = 'hour'
>           #end if
>
>           #set $min_str = 'minutes'
>           #if  $minutes == 1
>             #set $min_str = 'minute'
>           #end if
>
>           #set $sec_str = 'seconds'
>           #if  $seconds == 1
>             #set $sec_str = 'second'
>           #end if
>
>            <p>$("Today has %d %s, %d %s, and %d %s of daylight."% ($hours,
> $hr_str, $minutes, $min_str, $seconds, $sec_str))
>            <br/> <br/>
>             #if $difference > 0
>               $("%d seconds more than yesterday"% $difference)
>               #if $difference_min > 0
>                  #set $difference_sec = $difference % 60
>                  #if $difference_min == 1
>                    $("-- %d minute and"% $difference_min)
>                  #else
>                    $("-- %d minutes and"% $difference_min)
>                  #end if
>                  #if (math.trunc($difference_sec) == 1)
>                    $("%d second."% $difference_sec)
>                  #else
>                    $("%d seconds."% $difference_sec)
>                  #end if
>               #end if
>               </p>
>             #else
>                $("%d seconds less than yesterday" % -$difference)
>                #if abs($difference_min) > 0
>                  #set $difference = abs($difference)
>                  #set $difference_sec = $difference % 60
>                  #if $difference_min == 1
>                    $("-- %d minute and"% $difference_min)
>                  #else
>                    $("-- %d minutes and"% $difference_min)
>                  #end if
>                  #if (math.trunc($difference_sec) == 1)
>                    $("%d second."% $difference_sec)
>                  #else
>                    $("%d seconds."% $difference_sec)
>                  #end if
>                #end if
>                </p>
>             #end if
>
>
>           </div> <!-- end class "celestial_group" -->
>         </div> <!-- end id "almanac" -->
>
> ## To here begin
>
>         <div id="plots">
>           <img src="daytempdew.png"   alt="temperatures" />
>           <img src="daytempchill.png" alt="heatchill" />
>           <img src="dayrain.png"      alt="rain" />
>           <img src="dayhumidity.png"   alt="Outside humidity" />
>           <img src="daywind.png"      alt="wind" />
>           <img src="daywinddir.png"   alt="Hi Wind" />
>           <img src="daywindvec.png"   alt="Wind Vector" />
>           <img src="daybarometer.png" alt="barometer"/>
>           #if $day.rxCheckPercent.has_data
>           <img src="dayrx.png"        alt="day rx percent"/>
>           #end if
>           <br/>
>           <br/>
>           <p>This webcam updates every 30 to 40 minutes.</p>
>           <img src="
> https://novascotia.ca/tran/webcam/secure/images/rwis_cam/Lake%20Echo_1.jpg";
>
>                alt="
> https://novascotia.ca/tran/webcam/secure/images/rwis_cam/Lake%20Echo_1.jpg";
> width="420px" height="310px"
>                style="border:1px solid black"/>
>
> ##          <b><font size="4"><font color="black">Highway Web Cam
> temporarily out of service.</font></font></b>
>
>             <br/>
>           <br/>
>           <div class="header">
>           <p> Click <a href=$tide_URL>here</a> for nearby tide data. </p>
>           </div>
>         </div> <!-- End id "plots" -->
>       </div> <!-- End id "content" -->
>
>
>       <div id="navbar">
>         <input type="button" value="   Current   "
> onclick="openURL('index.html')" />
>         <input type="button" value="    Week     "
> onclick="openURL('week.html')" />
>         <input type="button" value="    Month    "
> onclick="openURL('month.html')" />
>         <input type="button" value="    Year     "
> onclick="openURL('year.html')" />
>         <p>Monthly summary:&nbsp;
>         <select name="noaaselect" onchange="openNoaaFile(value)">
>         #for $monthYear in $SummaryByMonth
>             <option value="$monthYear">$monthYear</option>
>         #end for
>         <option selected="selected">-Select month-</option>
>         </select>
>         <br/>
>         Yearly summary:&nbsp;
>         <select name="noaaselect" onchange="openNoaaFile(value)">
>         #for $yr in $SummaryByYear
>             <option value="$yr">$yr</option>
>         #end for
>         <option selected="selected">-Select year-</option>
>         </select>
>         </p>
> ##       #set $today = datetime.date.today
> ##       #set $begin = datetime.date(2015,9,1)
> ##       #set $delta = $today - $begin
> ##       $begin
> ##       $delta.days
> ##       Collecting weather data since $begin ($delta.days days)
>       </div>
>     </div>
>
>
> </body>
>
> </html>
>
> On Monday, March 29, 2021 at 2:50:35 PM UTC-3 [email protected] wrote:
>
>> Perhaps you could post your index.html.tmpl file? There may be other
>> places where tag shortcuts could be used. Or, maybe not...
>>
>> On Mon, Mar 29, 2021 at 10:47 AM Paul Dunphy <[email protected]> wrote:
>>
>>> I only have 19 multiplies (occurrences of the '*' character.)  4 of them
>>> are C to F that I'll replace with the tag, so that narrows it down to 15.
>>> I'll get it!
>>>
>>> - Paul VE1DX
>>>
>>> https://ve1dx.net/
>>>
>>>
>>> On 2021-03-29 2:41 p.m., Tom Keffer wrote:
>>>
>>> It shouldn't be hard to find at all. The version of index.html.tmpl that
>>> comes with the Standard skin has no  multiplies at all. It must be
>>> something you added. Just search for '*' and think about if there is any
>>> reason that the left hand side would be None.
>>>
>>> Also, why the C to F conversions? This can be done with the tag system.
>>>
>>> $current.outTemp.degree_F
>>>
>>> -tk
>>>
>>> On Mon, Mar 29, 2021 at 10:29 AM Paul Dunphy <[email protected]> wrote:
>>>
>>>> Thanks, Tom.  Unfortunately, I went to have lunch, and when I came
>>>> back, it was working.  This tells me it's dependent on something in the
>>>> input data that changed.  I'm calculating Beaufort Scale, doing C to F
>>>> conversions, for example.  It's windier now than it was at 6 AM.  Or the
>>>> sun angle is different.  Or a dozen other things.  Bugs that "fix
>>>> themselves" are the worst kind.  Look at that website now, and it's working
>>>> like it was all along.
>>>>
>>>> I will scour my index.html.tmpl file for multiplies to see if I can
>>>> find the "None," but no doubt there's an if statement or the like that
>>>> isn't true (or false) most of the time.  Talk about your needle in a
>>>> haystack.
>>>>
>>>> Regardless, when it occurs again (should I not find it by looking
>>>> today), I can start commenting out chunks of code like a binary search and
>>>> narrowing it down in short order.
>>>>
>>>> On 2021-03-29 1:32 p.m., Tom Keffer wrote:
>>>>
>>>>       >snipped for brevity<
>>>>
>>>>
>>>> Mar 29 11:30:20 rhubarb python3[2322]: weewx[2322] ERROR
>>>> weewx.cheetahgenerator: ****  TypeError: unsupported operand type(s)
>>>> for *: 'NoneType' and 'float'
>>>>
>>>> Somewhere in /etc/weewx/skins/Standard/index.html.tmpl you are trying
>>>> to multiply two numbers together, and one of them (the first one) is
>>>> 'None'.
>>>>
>>>> Scan the file and see where the multiplication is occurring. Then check
>>>> the value for None before multiplying.
>>>>
>>>> -tk
>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "weewx-user" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/weewx-user/ae25429e-d310-03e0-6b07-4a197bcb8e2b%40gmail.com
>>>> <https://groups.google.com/d/msgid/weewx-user/ae25429e-d310-03e0-6b07-4a197bcb8e2b%40gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "weewx-user" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/weewx-user/G2yZaS-jqWI/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEARBEPdejMJ_3a-AC0XWAjrVhTpsV-3wPKTfqqX8h6nzA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/weewx-user/CAPq0zEARBEPdejMJ_3a-AC0XWAjrVhTpsV-3wPKTfqqX8h6nzA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "weewx-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/0adcc7d9-13bb-97de-8e10-56583366df3e%40gmail.com
>>> <https://groups.google.com/d/msgid/weewx-user/0adcc7d9-13bb-97de-8e10-56583366df3e%40gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/7377529a-e9f8-4c95-b809-9e81cc4878d6n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/7377529a-e9f8-4c95-b809-9e81cc4878d6n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEADuocM57rSKSAjQVx4Bp6AOJmP%2B%3DgqXyNP43m-9Zhscg%40mail.gmail.com.

Reply via email to