Thanks Tom and Matt for your prompt responses.
Apologies - I probably didn't quite make my intention clear.
I'm reading a sensor via OWFS, and am hoping to get weewx to only use the 
maximum value measured during any 5-minute archive interval.
Going on from Tom's post, I want to make sure the value of 
'$' is what goes into the database, rather than an average 
or anything else.
I figure one way is to create/write a new data type in the owfs driver to 
return the max value, or work on Matthew's suggestion above, but I'm hoping 
there's an easy way to do it...

On Sunday, October 16, 2016 at 9:21:28 AM UTC+10:30, mwall wrote:
> hi andrew,
> it is pretty simple, actually.  make a service that is bound to LOOP 
> packets.  on each loop packet, spit the value(s) to file/disk/database.
> create a file in user/ that has something like this:
> import weewx
> from weewx.engine import StdService
> class CaptureLOOP(StdService):
>     def __init__(self, engine, config_dict):
>         super(CaptureLOOP, self).__init__(engine, config_dict)
>         self.filename = config_dict.get('CaptureLOOP', {}).get('filename', 
> '/var/tmp/loop')
>         self.bind(weewx.NEW_LOOP_PACKET, self.save_data)
>     def save_data(self, event):
>         with open(self.filename, "w") as f:
>             f.write("%s" % event.packet)
> then in weewx.conf add user.captureloop.CaptureLoop to the report_services 
> list.
> m

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 
For more options, visit

Reply via email to