To answer some of your questions. WeeWX records rain on a per interval basis, so the rain field in an archive record holds the amount of rain that fell in the archive period concerned. Day, week, month, year etc values are calculated from this underlying data. The WU dailyrainin field is the rainfall since midnight in inches. You would need to calculate the difference between consecutive records to get the rain per interval required by weeWX. The WU rainin field is the rainfall in the last hour in inches. You could use this as rainRate or you could have weeWX calculate rainRate from the rain data. There has been a lot of discussion on calculation of rainRate, have a search of the forum if you want. If you have weeWX calculate rainRate then the StdWXCalculate service (http://weewx.com/docs/usersguide.htm#StdWXCalculate) can take care of it. You can ignore weeklyrainin, monthlyrainin and yearlyrainin; weeWX does not store these, rather they are calculated as required.
How you deal with units (not just rain units) will depend on how you get your data into weeWX. Almost all WeeWX records have a field 'usUnits' that stores the unit system (US, METRIC or METRICWX - have a look at bin/weeWX/units.py) used by the observation fields in the record concerned. If you are adding data to a record then you need to observe the records unit system. If you are creating your own record for weeWX to process you can usually use whatever unit system you want as weeWX will take care of any conversions.
It is not clear how you are getting your data into weeWX. If you are inserting directly into the database you are making things tough for yourself, there are a lot of internal goings on that you will need to take care of, certainly more than just inserting data into a table. You are far better if you let weeWX take care of as much as possible. In fact, if there is no weeWX driver for your station you may be best served implementing a driver based on the fileparse driver (/home/weewx/examples/fileparse). The fileparse driver reads data from a formatted text file.
Gary
in my weewx.conf file i specify the driver and parameters.[W8681]
# This section is for the W8681 wifi series of weather stations.
# The driver to use:
driver = weewx.drivers.w8681
[SocketLogger]
# This section is for the SocketLogger driver
# Station info:
hardware = Generic intercept for wunderground urls
# IP address, port number and timeout in seconds of the socket to connect to
mode = sniff # driver mode either sniff of listen
host_ip = XX.XX.XX.XX # in sniff mode ip of weather station else should be localhost for listen
host_iface = eth1 # only required in sniff mode
host_port = 80 # port to listen on or port to sniff
timeout = 320 # timeout in seconds
# this should be greater than the interval set on your pws
# The driver to use
driver = user.socketlogger
I have attached the py script (still work in progress so use at own risk). Passes data to weewex with (for example) _packet['temp']. Not sure if this simply inserts data into the database or whether weewx actually "processes" the data.
I am just trying to figure out how the rainrate is handled.
Is weewx smart enough to know if I provide a rain rate of mm/hr every 5 minutes what the cumulative rainfall is? Just started running my script with a constant rainrate for 24hrs, will see what happens. So far the rain rate on the web interface is correct. Although the "Today's Rain" still says zero. Will let it run for a few days (we should have a total of 48mm tomorrow).
Pete.
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/4MWfKEqNO2A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If you are taking historic data from the WU databases why not use wee_import which does all the rain calculations from wunderground to weewx for you – together with any other conversions as required.
I can understand your position for live data if you are sniffing the data BEFORE it is uploaded to WU, but your last comment implies you are using historic WU data – in which case wee_import does the jobe perfectly AFIK. I certainly used it OK for 3 yrs worth of data.
Sent from Mail for Windows 10
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/4MWfKEqNO2A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
As you can tell I am enthusiastic amateur...!
SOLVED (Hopefully)....
2) Only send this information to weewx, ignore all the other rain parameters, i.e. let weewx handle that.Three steps to get this working.1) As Gary pointed out. Use the cumulative rain (since midnight) to compute the rain since last update.So that the total rain _packet['rain'] is correct for the update period (in my case this is 5min).
3) as per step 2) set in weewx.conf calculations section "rainRate" and "dayRain" to "software".
Initial signs are looking good. Although after 24hrs of heavy rain here in West London we now have blue sky!Thanks for all you help and guidance Gary. Just need to extract my correct rain data from Wunderground and update weewx db...
Pete.
F.Y.I.
here is a link to my PWS on wundergound. I have a webcam attached, note I have overlain with imagemagik output from weewx (info created using cheetah) on the webcam image. Hope you like it.
https://www.wunderground.com/personal-weather-station/dashboard?ID=ILONDON542