I've put together a search list extension that should do what you want. You 
will find the code here 
<https://raw.githubusercontent.com/gjr80/weewx_utilities/master/search%20list%20extensions/this/bin/user/this.py>.
 
The SLE is based on the existing WeeWX tag machinery that enables iteration 
<http://weewx.com/docs/customizing.htm#Iteration> over periods. So with the 
SLE installed you can do something like:

#for $day in this_span.this
$day.outTemp.max at $day.outTemp.maxtime
#end for

to display the maximum daily temperature and the time it occurred on this 
day in all years in the archive. The output would be something like:

24.5°C at 11 May 2017 12:51:00
26.7°C at 11 May 2018 13:31:00
23.4°C at 11 May 2019 13:15:00

There are various parameters that can be set against $this_span to limit 
the period covered (the default is all records but you can limit it to the 
last x years, months etc as with the existing $span tag). There are various 
parameters that can be applied to .this to set the day to be used, for 
example, .this($period='week') and .this($period='month') will provide 
stats for this week and this month respectively over all years. There are 
many variations and permutations, I have tried to capture a variety of use 
cases in the up front comment in this.py 
<https://raw.githubusercontent.com/gjr80/weewx_utilities/master/search%20list%20extensions/this/bin/user/this.py>
.

To install/use:

1. Download the file this.py to the WeeWX machine and save to the 
$BIN_ROOT/user directory:

    for a setup.py install:
    
$ wget -P /home/weewx/bin/user https:
//raw.githubusercontent.com/gjr80/weewx_utilities/master/search%20list%20extensions/this/bin/user/this.py

    otherwise:

$ wget -P /usr/share/weewx/user https:
//raw.githubusercontent.com/gjr80/weewx_utilities/master/search%20list%20extensions/this/bin/user/this.py

2.  Add the following line to the skin config file [CheetahGenerator] 
stanza for the skin in which the SLE is to be used:
    
search_list_extensions = user.this.ThisSLE

    if the search_list_extensions config option already exists add 
user.this.ThisSLE to the end of the option using a comma as a separator, eg:
    
search_list_extensions = user,another.SLE, user.this.ThisSLE

3.  Add the required $this_span.this code to the template concerned.

4.  After the next report cycle is complete confirm there are no errors in 
the log and the report has been generated as expected.

Gary

On Saturday, 11 May 2019 23:30:47 UTC+10, Robin wrote:
>
> I apologise if this has been asked before or if there is a simple and 
> obvious way to do this, but I can't see it.
>
> I want to display the temperature (min,max) for today's date for each year 
> since we started keeping records.
>
> Can somebody point me in the right direction?
>
> Thanks people.
>

-- 
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/1e76ccf7-8b01-42f4-b918-d3b9d7fa6be8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to