cannot find 'raw' while searching for 'lasttime.raw'

75 views
Skip to first unread message

Werner Krenn

unread,
Sep 27, 2024, 3:10:39 PM9/27/24
to weewx-user
LOG:
raspi5-rt weewxd[505937]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/Seasons/index.html.tmpl failed.
raspi5-rt weewxd[505937]: ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/Seasons/index.html.tmpl
raspi5-rt weewxd[505937]: ERROR weewx.cheetahgenerator: **** Reason: cannot find 'raw' while searching for 'lasttime.raw'
raspi5-rt weewxd[505937]: ERROR weewx.cheetahgenerator: **** To debug, try inserting '#errorCatcher Echo' at top of template

How can I "catch" this error "cannot find 'raw' while searching for 'lasttime.raw'"

vince

unread,
Sep 27, 2024, 3:46:32 PM9/27/24
to weewx-user
I would try inserting '#errorCatcher Echo' at top of template

Tom Keffer

unread,
Sep 27, 2024, 3:57:04 PM9/27/24
to weewx...@googlegroups.com
"lasttime" is an aggregation type, not an observation type. It chooses the time of the last non-null value for an observation type.

For example, $month.outTemp.lasttime would be the time of the last non-null temperature for the month. 

$month.outTemp.lasttime.raw would be that time as a pure number (unix epoch time).

Hope that answers your question. 

--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/e8ecb90e-681d-46d9-bb59-416f09c99d02n%40googlegroups.com.

Werner Krenn

unread,
Sep 28, 2024, 1:03:51 PM9/28/24
to weewx-user
I have now tried to reproduce the error, but was unsuccessful.

"I would try inserting '#errorCatcher Echo' at top of template"
This is a default setting in the original WeeWx 5.1.0 sensors.inc

I have hidden this error so far:
-----------------------------------------------------------------------------------------
#if $have_voltage
    <tr><th>$gettext("Voltage")</th><th></th></tr>
#for $x in $sensor_voltages
  #if $getattr($recent, $x).has_data
    <tr>
      <td class="label">$obs.label[$x]</td>
      <td class="data">$getVar('current.' + $x)</td>
##set $lasttime = $getattr($recent, $x).lasttime.raw
##     <td class="timestamp">$get_time_delta($lasttime, $now)</td>
    </tr>
  #end if
#end for
#end if
-----------------------------------------------------------------------------------------------------

vince

unread,
Sep 28, 2024, 2:07:12 PM9/28/24
to weewx-user
The code that you said is failing seems to be from the Seasons skin sensors.inc file (???) which gets its list of $sensor_voltages to report on from skin.conf, with a hardcoded fallback value in sensors.inc itself. Is it possible you are trying to look up a sensor that does not exist or that has recently failed or been undefined in skin.conf ?

(in Seasons skin.conf)
sensor_voltages = consBatteryVoltage, heatingVoltage, supplyVoltage, referenceVoltage

(in Seasons sensors.inc)
#set $sensor_voltages = $to_list($DisplayOptions.get('sensor_voltages', ['consBatteryVoltage', 'heatingVoltage', 'supplyVoltage', 'referenceVoltage']))

[...]

###### (to me, this says if there are 'any' readings in the last month from 'any' sensor)
#set $have_voltage = 0

#for $x in $sensor_voltages
  #if $getattr($recent, $x).has_data
    #set $have_voltage = 1
  #end if
#end for

[...]

###### up above in the file it defines 'recent' as $recent=$span($day_delta=30, boundary='midnight')

#if $have_voltage
    <tr><th>$gettext("Voltage")</th><th></th></tr>
#for $x in $sensor_voltages
  #if $getattr($recent, $x).has_data
    <tr>
      <td class="label">$obs.label[$x]</td>
      <td class="data">$getVar('current.' + $x)</td>
#set $lasttime = $getattr($recent, $x).lasttime.raw

      <td class="timestamp">$get_time_delta($lasttime, $now)</td>
    </tr>
  #end if
#end for
#end if


I'd suggest trying to add some debugging print statements to see what's in there for each sensor (?)

#if $have_voltage
    <tr><th>$gettext("Voltage")</th><th></th></tr>
#for $x in $sensor_voltages
  #if $getattr($recent, $x).has_data
    <tr>
      <td class="label">$obs.label[$x]</td>
      <td class="data">$getVar('current.' + $x)</td>
      <td class="data">$getattr($recent, $x)</td>
    </tr>
  #end if
#end for
#end if



Werner Krenn

unread,
Sep 28, 2024, 3:42:03 PM9/28/24
to weewx-user
I now have a solution for myself:
if current data is available, it is displayed and if the data is not current, it is shown how old it is.

With the original code of "sensors.inc" the data is not displayed immediately when new observations are added.

#if $have_voltage
    <tr><th>$gettext("Voltage")</th><th></th></tr>
#for $x in $sensor_voltages
  #if $getattr($recent, $x).has_data or $getattr($current, $x).has_data

    <tr>
      <td class="label">$obs.label[$x]</td>
      <td class="data">$getVar('current.' + $x)</td>
      #if $getattr($recent, $x).has_data

       #set $lasttime = $getattr($recent, $x).lasttime.raw
       <td class="timestamp">$get_time_delta($lasttime, $now)</td>
      #end if

    </tr>
  #end if
#end for
#end if
Reply all
Reply to author
Forward
0 new messages