-
Notifications
You must be signed in to change notification settings - Fork 0
`history` observation type
roe-dl edited this page May 10, 2023
·
7 revisions
The observation type history
(with prefix typically ottHistory
or thiesHistory
) provides a list of the weather conditions reported within the last hour. This list is internally used to determine derived weather codes like 20 to 29 (means: some weather condition within the last hour but not now). It is provided as an observation type for debugging purposes especially.
Each element of the list is also a list, which contains of the following elements:
Element | Description |
---|---|
[0] | start timestamp of the weather condition |
[1] | end timestamp of the weather condition (updated each time, the same weather condition is reported as before) |
[2] | ww value of the weather condition |
[3] | wawa value of the weather condition |
[4] | If this weather condition is precipitation this is the start timestamp of the precipitation. If the weather condition changes during precipitation in intensity or kind, this value is not the same as [0]. If this weather condition is no precipitation the value is None . |
[5] |
intsum , an internal value to calculate average intensity of precipitation |
[6] |
dursum , an internal value to calculate average intensity of precipitation |
[7] | w'w' METAR value of the weather condition |
If you want to display this list within a skin, you can use the following code:
#from weewx.units import ValueTuple, ValueHelper
...
#if $len($current.ottHistory.raw)>1
<p>Wetterzustände der letzten Stunde:</p>
<table class="table-striped">
<tr>
<th>Beginn</th>
<th>Ende</th>
<th>Dauer</th>
<th>ww</th>
<th>w<sub>a</sub>w<sub>a</sub></th>
<th>w'w'</th>
<th>Niederschlagsbeginn</th>
</tr>
#for $ii in reversed($current.ottHistory.raw)
#set $start=ValueHelper(ValueTuple($ii[0],'unix_epoch','group_time'),formatter=$station.formatter)
#set $stop=ValueHelper(ValueTuple($ii[1],'unix_epoch','group_time'),formatter=$station.formatter)
#set $precipstart=ValueHelper(ValueTuple($ii[4],'unix_epoch','group_time'),formatter=$station.formatter)
#set $duration=ValueHelper(ValueTuple($ii[1]-$ii[0],'second','group_deltatime'),formatter=$station.formatter)
<tr>
<td>$start</td>
<td>$stop</td>
<td>
#if $duration.raw>3600
$duration.hour
#else
$duration.minute
#end if
</td>
<td>
$('%02d' % ii[2])
<span style="position:relative;top:4px">$presentweather(ww=$ii[2]).wmo_symbol(width=22)</span>
</td>
<td>
$('%02d' % ii[3])
<span style="position:relative;top:4px">$presentweather(wawa=$ii[3]).wmo_symbol(width=22)</span>
</td>
<td>$ii[7]</td>
<td>$precipstart</td>
</tr>
#end for
</table>
<p></p>
#end if