After some more digging I have advanced:
my 2nd issue, that the monthly and weekly data is not shown seems to be
solved:
while in the imagegenerator the week/month means 7 days back and 30 days
back from the current date,
$week and $month seem to mean the calender week and calender month - a
few tests with fake rain data in the database confirmed that
remains the issue how to show the values from the remote database in the
High/Low portion of the High/Low table
at http://www.weewx.com/docs/customizing.htm#Using_multiple_bindings
the example goes:
<table> <tr> <td class="stats_label">Inside Temperature, Vantage</td>
<td class="stats_data">$current.inTemp</td> </tr> <tr> <td
class="stats_label">Inside Temperature, WMR100</td> <td
class="stats_data">$latest/*($data_binding='wmr100_binding')*/.inTemp</td>
</tr> </table>
this translated into my hilo.inc code
<tr>
<td class="label">$obs.label.rain</td>
#for $archive in $archive_data
<td class="data new_row hilo_$archive[0]">
$archive[1].rain.sum.format(add_label=False)</td>
#end for
<td class="units">$unit.label.rain</td>
</tr>
<tr>
<td class="label">$obs.label.rainRate</td>
#for $archive in $archive_data
<td class="data new_row hilo_$archive[0]">
<span title="$archive[1].rainRate.maxtime">
$archive[1].rainRate.max.format(add_label=False)</span>
</td>
#end for
<td class="units">$unit.label.rainRate</td>
</tr>
should in my understanding then be:
<td class="data new_row hilo_$archive[0]">/*
*/$archive[1]/*($data_binding='rpi24-binding')*/.rain.sum.format(add_label=False)</td>
resp.
<td class="data new_row hilo_$archive[0]">
<span title="$archive[1].rainRate.maxtime">
$archive[1]/*($data_binding='rpi24-binding')*/.rainRate.max.format(add_label=False)</span>
</td>
where "rpi24-binding" is my database binding of the remote database
however, this produces a Cheetah Syntax error
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
Evaluation of template /etc/weewx/skins/Seasons/index.html.tmpl failed
with exception '<class 'SyntaxError'>'
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** Ignoring template /etc/weewx/skins/Seasons/index.html.tmpl
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** Reason: keyword can't be an expression (<string>, line 1)
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** Traceback (most recent call last):
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** File "/usr/share/weewx/weewx/cheetahgenerator.py", line 348, in
generate
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** unicode_string = compiled_template.respond()
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** File
"cheetah__etc_weewx_skins_Seasons_index_html_tmpl_1657056374_3328836_74907.py",
line 287, in respond
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line
1707, in _handleCheetahInclude
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** File
"cheetah__etc_weewx_skins_Seasons_hilo_inc_1657056374_7626543_30080.py",
line 1744, in respond
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** File
"cheetah__etc_weewx_skins_Seasons_hilo_inc_1657056374_7626543_30080.py",
line 386, in __errorCatcher46
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** File "<string>", line 1
Jul 5 23:26:15 raspberrypi weewx[31166] ERROR weewx.cheetahgenerator:
**** SyntaxError: keyword can't be an expression
what am I missing ?? - it's definitely the
/*($data_binding='rpi24-binding')*/ which causes the error - when I
remove it, no error is shown - but then I don't get my data from the
remote database ...
Am 05.07.2022 um 12:32 schrieb Rainer Lang:
the background which made me run into the issue(s) which I couldn't
find a solution for yet -
nothing found in the WiKi either
2 Ecowitt stations - one has the WS90 and a WH40 rain gauge connected,
one the rain gauge from the WS69 array
2 weewx instances - one receiving the WS90/WH40 data, one receiving
the WS69 data
the instances run on different servers, but that was only an
additional challenge to figure out where to put the data_binding
information - maybe not yet completely solved - we'll see later
running weewx 4.8.0 - but with my old skin.conf - not (yet) with the
skin.conf which comes with the 4.8.0 install
I have added the following entries to my skin.conf - and the plots of
all three are properly shown - as desired
(for that I repurposed the wsview_extended database field "hail" for
the WS90 piezo rain)
####### excerpt skin.conf start ##########
[[[dayrain]]]
# Make sure the y-axis increment is at least 0.02 for the
rain plot
yscale = None, None, 0.02
plot_type = bar
[[[[rain]]]]
aggregate_type = sum
aggregate_interval = 3600
label = Rain (hourly total) (WH40)
[[[dayrain2]]]
# Make sure the y-axis increment is at least 0.02 for the
rain plot
yscale = None, None, 0.02
plot_type = bar
fill_color = "#ff4500"
[[[[hail]]]] #WS90 piezo rain
aggregate_type = sum
aggregate_interval = 3600
label = Rain (hourly total) (WS90)
[[[dayrain3]]]
# Make sure the y-axis increment is at least 0.02 for the
rain plot
data_binding = rpi24-binding
yscale = None, None, 0.02
plot_type = bar
fill_color = "#32cd32"
[[[[rain]]]] #WH65 rain
aggregate_type = sum
aggregate_interval = 3600
label = Rain (hourly total) (WS69)
############ excerpt skin.conf end ##############
HOWEVER, I couldn't manage to get the data from the external database
[[[dayrain3]] into the current data table - nor into the High/Low table
_I couldn't figure out how to address the external database field in
current.inc and in hilo.inc to be shown in the table here._
Any advise how to manage that highly appreciated !
SECOND ISSUE: into which I ran while experimenting with the hilo.inc
file to get my values displayed
I found that even though the syntax seems to be correct, I only get
the current (that's current.inc) data displayed (for "rain" and "hail")
but _I wouldn't get the weekly and monthly rain sums displayed - only
the yearly_.😮 - the others simply remain "0.0"
(it does the same in my other weewx installations too !)
excerpt below - what's wrong here and, also, referring back to the
first question, how would the code look like for the external database
field "rain" to be inserted to be displayed in that table ?
########### excerpt hilo.inc start ###########
#set $archive_data = [('day', $day), ('week', $week), ('month',
$month), ('year', $year), ('rainyear', $rainyear)]
<div id='hilo_widget' class="widget">
<div class="widget_title">
<a href="statistics.html">High/Low</a>
<a class="widget_control"
onclick="toggle_widget('hilo')">♦</a>
</div>
<div class="widget_contents">
<table>
<tbody>
....................
<tr>
<td class="label">$obs.label.rain</td>
#for $archive in $archive_data
<td class="data new_row hilo_$archive[0]">
$archive[1].rain.sum.format(add_label=False)</td>
#end for
<td class="units">$unit.label.rain</td>
</tr>
<tr>
<td class="label">$obs.label.rainRate</td>
#for $archive in $archive_data
<td class="data new_row hilo_$archive[0]">
<span title="$archive[1].rainRate.maxtime">
$archive[1].rainRate.max.format(add_label=False)</span>
</td>
#end for
<td class="units">$unit.label.rainRate</td>
</tr>
<tr>
<td class="label">$obs.label.piezorain</td>
#for $archive in $archive_data
<td class="data new_row hilo_$archive[0]">
$archive[1].hail.sum.format(add_label=False)</td>
#end for
<td class="units">$unit.label.rain</td>
</tr>
<tr>
<td class="label">$obs.label.piezorainRate</td>
#for $archive in $archive_data
<td class="data new_row hilo_$archive[0]">
<span title="$archive[1].hailRate.maxtime">
$archive[1].hailRate.max.format(add_label=False)</span>
</td>
#end for
<td class="units">$unit.label.rainRate</td>
</tr>
.................
############ excedrpt hilo.inc end #############
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/d083069b-51b0-7201-2e16-3e7f24422410%40gmail.com.