Handle delta rain in fileparse driver

174 views
Skip to first unread message

Cyril D

unread,
Jul 26, 2017, 4:24:20 AM7/26/17
to weewx-development
Hello,

I am a new user of weewx, I use the fileparse driver to get the data into weewx.

Has someone already added the management of rain_total to get the rain_delta within the fileparse driver and could share it?
Or could someone add it to the official release of that driver?

Thanks in advance for that, and thank you for providing weewx!

gjr80

unread,
Jul 27, 2017, 9:06:18 PM7/27/17
to weewx-development
Hi,

I am not aware of anyone having changed the fileparse driver to handle cumualtive rain values. Try the attached fileparse driver, I have only given it some limited testing but believe it works. To use:

1. rename your existing fileparse.py to fileparse_orig.py
2. download the attached file to the bin/user directory on your weeWX system
3. edit weewx.conf and under [FileParse] add the config option cumualtive_rain as follows:
    cumulative_rain = True
4. save weewx.conf
5. stop/start weeWX
6. if it doesn't work or otherwise does bad things revert to the original fileparse.py by renaming fileparse.py to fileparse_new.py, renaming fileparse_orig.py to fileparse.py and finally stop/start weeWX

There are instructions for use of the cumulative_rain option in the comments up front in the attached fileparse.py.

Let us know how it goes.

Gary
fileparse.py

Cyril D

unread,
Jul 28, 2017, 5:38:46 AM7/28/17
to weewx-development
Thank you.
There is a typo in the description:
"Setting cumulative_rain = True will result in the rain field being
# interpreted as a cumulative value, omitting the cumulative_rain config option
# or setting it to True will result in the rain field being interpreted as an
# incremental value."

I guess we should read "or setting to False will result [...] incremental.

gjr80

unread,
Jul 28, 2017, 5:43:58 AM7/28/17
to weewx-development
Ah, my mistake, I originally started with an incremental_rain option and then changed to cumulative_rain. Should only be a description issue, the logic in the code should work.

Gary

Cyril D

unread,
Jul 28, 2017, 6:18:16 AM7/28/17
to weewx-development
No problem for the typo, I just reported it so you can correct it.

For the test, there is an error somewhere.
I had 33.12mm
from the log: new=33.12 old=None
then I put water to get an update.
I now have 34.11.

In the report, it counts 25,1 mm

Cyril D

unread,
Jul 28, 2017, 6:22:38 AM7/28/17
to weewx-development
Probably my fault, did not check the units, I had to change it to 'METRICWX'

gjr80

unread,
Jul 28, 2017, 6:23:40 AM7/28/17
to weewx-development
Correct.

Cyril D

unread,
Jul 28, 2017, 6:46:12 AM7/28/17
to weewx-development
So it works!

Thank you :)
Reply all
Reply to author
Forward
0 new messages