YTD sum values in Seasons report

48 views
Skip to first unread message

Tom D

unread,
Apr 1, 2026, 9:16:25 PM (2 days ago) Apr 1
to weewx-user
I am trying to add a column to the seasons report to show accumulated year to date values for heating degree days but it is showing the current year to date sum for each line.  For example in the following excerpt for january it is showing the total through April 1 (3247.5) instead of 48.2 on Jan 1 and (48.2+47.3) for Jan 2, and so on.   I have added the  tag $year.heatdeg.sum.format($Temp,$NONE,add_label=False) 
to the loop in the /etc/weewx/skins/Seasons/NOAA/NOAA-%Y-%m.txt.tmpl file.
How might I get it to show the accumulated ytd value for each line?

TEMPERATURE (F), RAIN (in), WIND SPEED (mph) HEAT COOL AVG MEAN DEG DEG WIND DOM DAY TEMP HIGH TIME LOW TIME DAYS DAYS RAIN SPEED HIGH TIME DIR --------------------------------------------------------------------------------------- 01 16.8 27.3 03:44 2.7 22:10 48.2 0.0 0.00 0.0 1.1 05:03 270 3247.5 02 17.7 27.5 14:24 8.2 01:00 47.3 0.0 0.00 0.0 0.0 01:00 N/A 3247.5 03 24.0 31.6 13:57 16.3 01:00 41.0 0.0 0.00 0.0 0.0 01:00 N/A 3247.5 04 23.7 28.6 12:59 18.1 08:39 41.3 0.0 0.00 0.0 0.0 01:00 N/A 3247.5 05 24.2 30.7 22:56 17.2 07:31 40.8 0.0 0.00 0.0 0.0 01:00 N/A 3247.5 06 32.0 38.3 14:34 27.3 08:05 33.0 0.0 0.04 0.0 0.0 01:00 N/A 3247.5 07 34.6 36.7 12:49 32.7 04:55 30.4 0.0 0.22 0.0 0.0 01:00 N/A 3247.5 08 34.6 44.2 14:33 24.3 00:03 30.4 0.0 0.00 0.0 0.0 01:00 N/A 3247.5

Tom D

unread,
Apr 1, 2026, 10:32:24 PM (2 days ago) Apr 1
to weewx-user

sorry about the bad formatting in the table above

John Smith

unread,
Apr 2, 2026, 1:11:32 AM (yesterday) Apr 2
to weewx...@googlegroups.com
I don't have that skin installed but it should be pretty straight forward. Start above the table loop and add

#set $running_total = 0

and where the value is being output, add something like

#set $running_total += $value

The degree day value probably won't be called $value but that's the idea.

Then at the end of the loop where you want the running total displayed you can do

#echo $running_total

or simply just the variable itself on it's own line, eg

$running_total

On Thu, 2 Apr 2026 at 13:32, Tom D <tomde...@gmail.com> wrote:

sorry about the bad formatting in the table above

TEMPERATURE (F), RAIN (in), WIND SPEED (mph) HEAT COOL AVG MEAN DEG DEG WIND DOM DAY TEMP HIGH TIME LOW TIME DAYS DAYS RAIN SPEED HIGH TIME DIR --------------------------------------------------------------------------------------- 01 16.8 27.3 03:44 2.7 22:10 48.2 0.0 0.00 0.0 1.1 05:03 270 3247.5 02 17.7 27.5 14:24 8.2 01:00 47.3 0.0 0.00 0.0 0.0 01:00 N/A 3247.5 03 24.0 31.6 13:57 16.3 01:00 41.0 0.0 0.00 0.0 0.0 01:00 N/A 3247.5 04 23.7 28.6 12:59 18.1 08:39 41.3 0.0 0.00 0.0 0.0 01:00 N/A 3247.5 05 24.2 30.7 22:56 17.2 07:31 40.8 0.0 0.00 0.0 0.0 01:00 N/A 3247.5 06 32.0 38.3 14:34 27.3 08:05 33.0 0.0 0.04 0.0 0.0 01:00 N/A 3247.5 07 34.6 36.7 12:49 32.7 04:55 30.4 0.0 0.22 0.0 0.0 01:00 N/A 3247.5

--
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+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-user/35c2fb8d-4328-4bd0-8e17-9b8b5efa6f9an%40googlegroups.com.

Tom D

unread,
Apr 2, 2026, 10:47:05 AM (yesterday) Apr 2
to weewx-user
Thanks John, your solution worked great.
Reply all
Reply to author
Forward
0 new messages