I'm working on adding another observation to my solar monitor and I want the same thing Karen
>> I can't think of any way to do that using a simple format string. You'll have to do something like:
>> #set hours_up = $almanac.sun.visible.raw / 3600.0
>> <p>Sun up: $("%.2f" % $hours_up)</p>"
I tried this is current.inc (SKIN_VERSION = 4.10.2):
#elif $x == 'last_runtime'
#set hours_on = $day.last_runtime.raw / 3600.0
<tr>
<td class="label">$obs.label[$x]</td>
<td class="data"><p>$("%.1f" % $hours_on)</p></td>
</tr>
and it failed miserably.
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: Evaluation of template /home/crichmon/weewx/skins/Seasons/index.html.tmpl failed with exception '<class 'TypeError'>'
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: **** Ignoring template /home/crichmon/weewx/skins/Seasons/index.html.tmpl
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: **** Reason: unsupported operand type(s) for /: 'AggTypeBinder' and 'float'
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: **** Traceback (most recent call last):
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: **** File "/home/crichmon/weewx/bin/weewx/cheetahgenerator.py", line 348, in generate
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: **** unicode_string = compiled_template.respond()
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: **** ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: **** File "_home_crichmon_weewx_skins_Seasons_index_html_tmpl.py", line 226, in respond
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: **** File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: **** self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: **** File "cheetah__home_crichmon_weewx_skins_Seasons_current_inc_1753124642_9362485_61563.py", line 251, in respond
Jul 21 13:04:02 router1 weewx[21556] ERROR weewx.cheetahgenerator: **** TypeError: unsupported operand type(s) for /: 'AggTypeBinder' and 'float'
What am I missing? The value is in seconds and coming in via mqtt.