As a general rule if you are working with averages you should be using
wsum and
sumtime, but it really depends on what you are calculating. To understand you need to know what the daily summary
wsum field contains and how it is different to the
sum field. I have no idea what the time field is, do you perhaps mean the
sumtime field?
WeeWX v3.0.0 introduced support for different archive interval values within a single database, hand in glove with this change was the introduction of weighting of archive record values used in the daily summaries. This was done to ensure that archive records with long archive intervals did not skew certain aggregates. For example, if a database contained archive records with a five minute interval during the night and archive records with a 30 minute archive interval during the day, when the average temperature was calculated for the entire day the resulting calculated value would be low due to there being up to six times more nighttime temperature values than there are daytime values. So a temperature of 15C at 11pm that 'applied' for five minutes would carry the same weight in the day average temperature as a 30C temperature at 11am that 'applied' for 30 minutes.
The solution is to weight the archive record values by the archive interval. This is what is stored in the daily summary wsum field (the sum field is retained as an unweighted sum). Archive interval weighting was not properly implemented in v3.0.0 resulting in all archive records being weighted equally irrespective of archive interval. This was fixed variously in v3.7.0, v4.2.0, v4.3.0 and v4.4.0 (as an aside, users with a homogeneous archive interval value in their database still use archive record weighting, but each archive record is weighted equally).
For obs where you are interested in the average value for the day, such as temperature, wind speed etc, the correct daily average value is the
wsum value divided by the
sumtime value. If you look in the WeeWX
xtypes module you will see the queries used for daily summary based averages use the
wsum and
sumtime fields. However, for
rain there is little sense in 'averaging' the day rain total as is done with say temperature. Typically for rain we are interested in the daily total or the
sum field. You will see in the xtypes module the queries for the daily summary based sums use the
sum field (you can still calculate the 'day average rain' using
$day.rain.avg, which will use the rain daily summary
wsum value, but it is a fairly meaningless aggregate).
In your case, if what you refer to as 'monthly averages for rainfall' is the average monthly rainfall (ie average July rainfall, average August rainfall etc), I expect you would be wanting the sum of the rainfall for the month (eg the sum of the rainfall for each July or the sum of the sum fields for each day in each July) and average that over the number of those months in your data (ie the number of 'Julys'). I wouldn't see you using wsum or sumtime.
Gary