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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/c50dffdb-9f4d-4176-8b4e-398b385cbc1a%40googlegroups.com.
