Packetsloop aggregation weewx

103 views
Skip to first unread message

Remy Lavabre

unread,
Jan 6, 2024, 10:27:48 AM1/6/24
to weewx-user
Good morning,

Wishing to write a driver for WeeWX in order to automatically retrieve and integrate AWEKAS data into the weewx.sbd database, I have a question regarding the management of "PacketsLoop" data:

The Weewx documentation states that for temperatures, it is an average of the "packetsloop" received during the time period set in weewx.conf (300 seconds for example), that for rain it is the maximum of packetsloop. -> OK

But for the other data? What about it?

If we add personal fields to the database, such as electricity consumption. What will be the value of this field in the database -> An average of packets received, the maximum value, the last?

And is it possible to specify to wewx (and if so where and how...), what type of result we want to have with the aggregation of a field from several loop packets?

thank you

bell...@gmail.com

unread,
Jan 6, 2024, 4:34:41 PM1/6/24
to weewx-user

Remy Lavabre

unread,
Jan 7, 2024, 4:34:28 AM1/7/24
to weewx-user
Thank you for the answer ! Perfect...

Only two questions still bothers me:

- 1/ I added an “XField” field to my weewx.sdb database. This XField corresponds to a simple parameter such as temperature or pressure. It is incorporated into the "PacketsLoop".

Do we absolutely have to declare [Accumulator] in weewx.sdb as follows:

[Accumulator]
     ...
     [[XField]]
         accumulator = scalar
         adder = add
         merger = minmax
         extractor = last


or are there default parameters in weewx in a (new) field of unknown type in a database?


- 2/ Concerning "PacketsLoop": the weewx documentation stipulates that they can be complete (all fields in the database) or partial.

But are the two PacketsLoops below interpreted in the same way?

data1 = {'dateTime': mydatetime, 'usUnits': 'METRIC', 'outTemp': '31', 'outHumidity': None, 'dewpoint': '28'}
data2 = {'dateTime': mydatetime, 'usUnits': 'METRIC', 'outTemp': '31',  'dewpoint': '28'}

Thank you for your help - Kind regards

bell...@gmail.com

unread,
Jan 8, 2024, 3:30:23 PM1/8/24
to weewx-user
1. There are defaults and you only have to configure any settings that you want to be different. So in your example you would only have to override the extractor.
[Accumulator]
     ...
     [[XField]]
         extractor = last

2. I don’t know the answer, but they have a different meaning. See, http://www.weewx.com/docs/4.10/devnotes.htm#value_None.

If you are adding new observations be sure to read up on units and unit_groups, http://www.weewx.com/docs/4.10/customizing.htm#customizing_units.

gjr80

unread,
Jan 8, 2024, 3:51:00 PM1/8/24
to weewx-user
Be careful here, for most observations the default avg extractor function is appropriate (that's why it is the default) as the extracted value is a representation of the observation over the entire archive period. The majority of observations handled by a default WeeWX install (ie outTemp, barometer, radiation etc) use the avg extractor function. The last extractor function is typically used for extensive observations such as day rainfall or perhaps a sensor state observation such as signal level that is either 0 or 1 where the latest value is of interest.

Ultimately though it is personal choice. 

Gary
Reply all
Reply to author
Forward
0 new messages