fileparse rain value

114 views
Skip to first unread message

Ryan Stasel

unread,
May 12, 2020, 5:35:54 PM5/12/20
to weewx-user
Hi All,

So, today is the first day I've had rain since I got fileparse going, and would you believe it thinks I had 283" of rain today. lol. 

I guess I'm curious what the "rain" value should be in the file that it's reading. Right now it reads 0.27, which to me is our total for today. But it seems to be adding this to the total each time it runs. So is that value supposed to be the amount of rain since the file was last generated? 

Once I know I'll see if I can nuke the data for today and re-import from an outside system.

Thanks! 

Ryan Stasel

unread,
May 12, 2020, 5:38:34 PM5/12/20
to weewx-user
btw, here's what's currently in the file that fileparse is parsing: 

dateTime=1589319442
barometer=29.77
pressure=29.28
inTemp=72.7
outTemp=57.7
inHumidity=39
outHumidity=80
windSpeed=0.0
windDir=159
windGust=17.0
windGustDir=0
rainRate=0.00
rain=0.27
dewpoint=51.6
windchill=57.7
heatindex=57.7

My fileparse section in weewx.conf looks like:

[FileParse]
    driver = user.fileparse
    path = /var/tmp/datafile
    poll_interval = 20

gjr80

unread,
May 12, 2020, 5:44:43 PM5/12/20
to weewx-user
WeeWX rainfall is a per period (loop or archive) value rather than as cumulative rainfall. The fileparse driver is very basic and simply saves the rain value from the source file in the WeeWX rain field. So fileparse needs a file with a per period value. Other drivers calculate per period rain from successive rain values, unfortunately fileparse does not.

Gary

Ryan Stasel

unread,
May 12, 2020, 6:06:16 PM5/12/20
to weewx-user
well that's unfortunate. I don't see a way to get that info out of meteobridge (such that it is per 30 seconds). 

hmm. suppose I could have the PHP compare previous and current value, and zero it out if it's equal to previous version. 

Open to other thoughts. 

Ryan Stasel

unread,
May 12, 2020, 6:24:13 PM5/12/20
to weewx-user
alright, made that change easily enough.

how can I easily go about deleting the rain data for today so I can re-import from another system? I'm good deleting everything from today and re-importing. 

Thanks! 

gjr80

unread,
May 12, 2020, 10:04:21 PM5/12/20
to weewx-user
On Wednesday, 13 May 2020 08:24:13 UTC+10, Ryan Stasel wrote:

how can I easily go about deleting the rain data for today so I can re-import from another system? I'm good deleting everything from today and re-importing. 


Really depends on how you are going to 'import'. If you are planning on using wee_import then you need to delete the offending records from the archive as wee_import adds records to the archive it does not update existing records. If you intend manually changing the rain data using some command line SQL or a GUI app of some description then you just need delete/change the rain field data. This wiki entry covers cleaning up 'bad' data but its techniques can be equally applied to updating incorrect rain data. At the end of the day it probably comes down to how many records you have to update and whether you have the complete suite of observations for the archive records you need to alter. Remember also that your rainRate field may have been calculated based upon your bogus rain data so you may need to alter that as well. If you are running WeeWX 4 one solution may be to set any bogus rainRate entries to null/None and then use the wee_database utility with the --calc-missing option to re-calculate your (now missing) rainRate fields.

A couple of other implied tasks, if you update your archive using something other than wee_import once you have updated your archive data you need to rebuild your daily summaries over the period you updated/modified. The wee_database utility will take care of this. Also, if you are generating any NOAA format reports you will need to delete them all so that WeeWX can rebuild them with the updated data.

Gary

gjr80

unread,
May 13, 2020, 12:07:29 AM5/13/20
to weewx-user
One further thing re rain and fileparse. The fileparse driver is very basic, it essentially reads data from a text file, if required maps that data to WeeWX field names and emits the data in a loop packet. Since WeeWX uses per-period rain data the rain data in the fileparse data file must be per-period. This works fine if the generation of the data file and the polling of the data file by the fileparse driver remain in perfect sync; however, if they should vary for any reason and, say, the data file is updated before the fileparse driver reads the data file, rain data can be missed. Continuous obs such as temperature, humidity etc are not effected in the same manner due to their continuous nature.The way around this rain limitation is to have the fileparse driver handle cumulative rain data. I've submitted a PR with the necessary changes, we will see how that goes for inclusion in the 4.1, but in the meantime you might want to revert to your cumulative rain data and try with the attached modified fileparse driver which will handle cumulative rain data. All you need to is replace your existing fileparse.py with the attached version and under [FileParse] in weewx.conf add the following setting:

[FileParse]
   
....    
    cumulative_rain
= true

Then it is just a case of restarting WeeWX. Use of cumulative rain data can be disabled by deleting the cumulative_rain setting or setting it to false.

Gary
fileparse.py

Sébastien F4GQK

unread,
Oct 21, 2020, 1:33:56 AM10/21/20
to weewx-user
Hello,

 for my part, I just want to deactivate the accumulation of rain. I want to retrieve the "daily rain" from my weather station and send it to weewx. With the variable "rain", I will test with this file and this method if it works. if the cumulative increase it takes the new value via the dailyrain. 

 Thanks

 Sebastien  

Reply all
Reply to author
Forward
0 new messages