--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
user.searchX.lastRainTag to the search_list_extensions = line. Save skin.conf and you should be able to use the tags $last_rain and $last_rain_days in any template controlled by that skin.conf. For example:Using last_rain timestamp from SLE
last rainfall was at $last_rain.format("%d %B %Y %H:%M")
then calculating days ago in template
#set $last_rain_days_ago = ($current.dateTime.raw - $last_rain.raw) / 86400.0
#set $last_rain_days_ago_formatted = "%.0f" % $last_rain_days_ago
last rainfall was $last_rain_days_ago_formatted days ago
Using days calculated in SLE
last rainfall was $last_rain_days_ago days ago
#set $last_rain_days_ago_formatted = "%.0f" % $last_rain_days_ago
last rainfall was $last_rain_days_ago_formatted days ago
Using last_rain timestamp from SLE
last rainfall was at 24 August 2014 11:20
then calculating days ago in template
last rainfall was 1 days ago
Using days calculated in SLE
last rainfall was 1.4 days ago
last rainfall was 1 days ago
Thanks for the help.I have followed your instructions exactly (I think) and it's not working.The log says:Aug 26 07:30:53 PWS weewx[14847]: reportengine: Unable to instantiate generator user.searchX.lastRainTag.Aug 26 07:30:53 PWS weewx[14847]: **** __init__() takes exactly 2 arguments (6 given)Aug 26 07:30:53 PWS weewx[14847]: **** Generator ignored...What have I done wrong?
On Monday, 25 August 2014 04:54:54 UTC+3, gjr80 wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/1vtUflRv5ys/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
--
#set $last_rain_days_ago = ($current.dateTime.raw - $last_rain.raw) / 86400.0
#set $last_rain_days_ago_formatted = "%.0f" % $last_rain_days_ago
<tr>
#if $current.rainRate.raw > 0
<td class="stats_label">Rain Rate</td>
<td class="stats_data">$current.rainRate</td>
#else if $day.rain.sum.raw > 0
<td class="stats_label">Last Rainfall</td>
<td class="stats_data">Today at $last_rain.format("%H:%M")</td>
#else if $yesterday.rain.sum.raw > 0
<td class="stats_label">Last Rainfall</td>
<td class="stats_data">Yesterday at $last_rain.format("%H:%M")</td>
#else
<td class="stats_label">Last Rainfall</td>
<td class="stats_data">$last_rain.format("%d %b") ($last_rain_days_ago_formatted days ago)</td>
#end if
</tr>
Files that must be changed:
1. skin.conf (for the template in which you want to use the tags)
2. the template (xxxxxx.tmpl) that you wish to use the tags in
Files that must be added:
1. lastRainTag.py copied to you $BIN_ROOT/user folder (will vary depending on your install method, for me I use a deb install so it is in /usr/share/weewx/user
Follow the instructions carefully!
search_list_extensions = examples.newxsearch.MyXSearch, user.searchX.lastRainTagsearch_list_extensions = user.newxsearch.MyXSearch, user.searchX.lastRainTag#set $last_rain_days_ago_formatted = "%.0f" % $last_rain_days_ago
#set $last_rain_days_ago = ($current.dateTime.raw - $last_rain.raw) / 86400.0
#set $last_rain_days_ago = ($current.dateTime.raw / 86400 - $last_rain.raw / 86400)I would like to install this, but the stated installation procedure does not appear to follow the new extension protocol, ie...wee_extension --install extensions/basic or wee_extension --install basic.tar.gz