WeeWX uses a SQL statement to calculate the averages. SQL ignores any nulls in an aggregate interval. So, if there is nothing but nulls in an interval, the result will be null, not zero.
Null values signify unknown values, not zero. I didn't follow the discussion of your service, but if you can't change it to store zero when the value is, well, zero, then you'll have to define your own specialty xtype aggregations, which treats null as a zero, perhaps by using the SQL function IFNULL(). Instructions on defining custom xtype aggregations: https://github.com/weewx/weewx/wiki/xtypes#calculating-aggregates On Sat, Jun 3, 2023 at 4:39 PM 'Peter Fletcher' via weewx-user < [email protected]> wrote: > For reasons discussed elsewhere, I have a user service which saves nulls. > rather than zeros to the archive records for UV and solar radiation values > during the night. Daily and weekly graphs continue to look as they should > (with the daytime tracings arising from at or very near to the zero axis). > On the monthly graphs, however, the tracings do not touch the zero axis at > either end of the daytime peak, I am guessing that, in calculating averaged > data points for the longer term graphs, weewx is treating the average of > any group of values that contains a null value as null. There is some logic > to this, but the results are unhelpful in this case. Am I right about the > cause of the problem, and is there a workaround for it? > > -- > 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/aff03e49-1c45-4383-bc80-a3db9425ac8fn%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-user/aff03e49-1c45-4383-bc80-a3db9425ac8fn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAPq0zEDfVrShawZHLmCn0Jgcyph6xCBzo-aC8p%2B8r%3DHX5byvdg%40mail.gmail.com.
