As LOOP packets arrive, they are accumulated in "accumulators." When it's
time to generate a new archive record, the value are "extracted." As you
note, the default is to take the average value over the interval, but there
are alternatives, which can be changed in weewx.conf. The drivers are not
involved.

For example, say you have a type, which you want to treat similarly to rain.
Call it "rainish". Here's how you could extract a value that is the sum
from all LOOP packets.

[Accumulator]
  [[rainish]]
    extractor = sum

Other types of extraction are possible, such as "min", "max", "last",
"count", and "noop" (extract nothing).

-tk

On Sun, Sep 1, 2019 at 2:20 PM Thomas Carlin <thomascarl...@gmail.com>
wrote:

> Good afternoon, I hope everyone is enjoying their labor day weekend!
>
> I have a custom data source that I wrote a driver for, and have recently
> changed it from pulling data when the archive packet is created, to when
> the loop packet is received.  This is working well, and everything is
> pulling correctly, but now I have an issue with the creation of the archive
> packet.  Previously, the device that I received the data from performed the
> aggregation, but now it is producing much more frequent information, and
> the driver/weewx service needs to handle the aggregation.
>
> Several of my data sources are similar to 'rain' where I want to count the
> total of something used or collected, and it looks like the archive packet
> is created using the average.  Based on the documentation, I need to
> implement genArchiveRecords() for these to specify how the data is
> aggregated, but I can't find any example code of how this is done.  Could
> you please point me in the correct direction for modifying this, or to a
> driver with some example code that I can modify for my needs?
>
> If this is more fitting for the development group, please move it there.
>
> Many thanks,
>
> Thomas
>
> --
> 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/bf7d69e5-7c93-438d-846d-279667f0299d%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/bf7d69e5-7c93-438d-846d-279667f0299d%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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zECO8-g_z_ZwNiDfGwFqVDfnLdyucU%2BG9RLw-RjW9AmFzQ%40mail.gmail.com.

Reply via email to