This is a WeeWX search list extension (SLE) that can calculate when an SQL statement last evaluted true, or how long since it evaluated true.
Example:
<p>It last rained at $time_at('rain>0') ($time_since('rain>0').long_form ago).</p>
would result in
<p>It last rained 20 June 2020 (81 days, 1 hour, 35 minutes ago).</p>
It is possible to use alternative data bindings by specifying it as the second
parameter to the time_since and time_at tags.
<p>It last rained at $time_at('rain>0', 'alt_binding') ($time_since('rain>0', 'alt_binding').long_form ago).</p>
Unfortunately, there is no automated installer for this extension. However, it is very simple to install manually.
-
Put the file
time_since.pyin your WeeWXusersubdirectory. For example, if you used thesetup.pyinstallation method, then you would dohttps://raw.githubusercontent.com/tkeffer/weewx-time_since/master/bin/user/time_since.pyAlternatively, if you used the Debian package installer
cd /usr/share/weewx/user sudo wget https://raw.githubusercontent.com/tkeffer/weewx-time_since/master/bin/user/time_since.py -
Add the extension to option
search_list_extensionsin the skin configuration fileskin.confof whatever skin you are using. When you're done, it will look something like this:[CheetahGenerator] # Possible encodings are 'html_entities', 'utf8', or 'strict_ascii' encoding = html_entities search_list_extensions = user.time_since.TimeSince [[SummaryByMonth]] ... -
You are then free to use the new tag in the skin. For example, in my copy of the
Seasonsskin, I have added it to the table in thecurrent.incmodule.class="data">$time_at('rain>0')<br/>$time_since('rain>0').long_form ago</td> </tr> ```