No, you've got it. And ah, I see what I was missing. I was thinking of "week" as in the last seven days, and so expected the rain total to be higher. It was a coincidence that I started windrun on Sunday and that was also the last day we had rain, otherwise maybe I would have caught it.
And you're correct, 'maxsum' works as you described! Thanks a lot for your help :) On Tuesday, November 26, 2019 at 9:35:26 PM UTC-5, gjr80 wrote: > > Hi, > > I am not sure I am seeing anything unexpected in your data/output. You > mention 'max sum' but I don't see 'max' anywhere in the code, only 'sum'. > The Seasons skin statistics module gives statistics over various periods. > By default it is day, week, month and year. For rainfall this is the total > rainfall for the current day, current week, current month and current year. > If you have duplicated the statistics.inc rain code substituting windrun > for rain then you will have the total windrun for the current day, current > week etc. From the data you show and code you are using the output is > exactly that. If you are seeking to display the highest daily windrun for > the current week, current month and current year then you need to change > your windrun code to use the appropriate aggregate. Changing > $archive.windrun.sum.format(add_label=False) to (untested) > $archive.windrun.maxsum.format(add_label=False) should work. > > Or have I missed the issue you are having? > > Gary > > On Wednesday, 27 November 2019 12:09:05 UTC+10, Jared wrote: >> >> Hi, >> >> I've enabled windrun, and it seems to be writing to the database and >> functioning normally. For my skin I'm running Seasons but adding a couple >> of data points. I now want to add windrun to my statistics page, and it >> seemed like it should function exactly like rain would, since the both >> aggregate on a daily basis. >> >> Rain <tr> looks like: >> >> <tr> >> <td class="label">$obs.label.rain</td> >> <td class="units">$unit.label.rain</td> >> #for $archive in $archive_data >> <td class="data >> new_row">$archive.rain.sum.format(add_label=False)</td> >> #end for >> </tr> >> >> My new windrun <tr> looks like: >> >> <tr> >> <td class="label">$obs.label.windrun</td> >> <td class="units">$unit.label.windrun</td> >> #for $archive in $archive_data >> <td class="data >> new_row">$archive.windrun.sum.format(add_label=False)</td> >> #end for >> </tr> >> >> >> But for some reason this isn't taking the "max sum" for the day like Rain >> does, it's adding it for the whole week. Here's the HTML output for both >> (Today in column 1 and Week in column 2) and the last 10 archive_day >> records for both from the database. There's the 0.76 for rain. But it's >> adding the windrun all together to make 66.7 for the week, rather than >> taking 31, the highest value so far for the week. 8.75 + 27.0 + 31.0 = >> 66.75. Why are they behaving differently? >> >> >> >> >> >> >> >> -- 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/4a2857c1-7ec3-477b-882a-a41ce45daf7a%40googlegroups.com.