how to change mm rain /day to mm rain the last 24 hours

352 views
Skip to first unread message

ysinhbi...@gmail.com

unread,
Apr 9, 2013, 9:34:57 AM4/9/13
to weewx...@googlegroups.com
Sir, I'm wondering if it is possible to get some values in a format like :last 24hr, last 7 days, last 4 weeks.... As i try to use the RPi, and weewx to control the irrigation of my vegetables garden (hobby)
I'm using a vantage pro plus and simply connected the rx,tx,gnd of the vantage pro2 console straight to the gpio connector of the RPi

best regards


Thomas Keffer

unread,
Apr 9, 2013, 9:48:40 AM4/9/13
to weewx-user
Not sure what you're asking. Weewx includes an extensive templating system that allows variables such as rain today, this week, this month, etc., to be expressed. If you want quantities over the last 24 hours that can be done with a simple reporting extension, described in the manual.

-tk





--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Tom Keffer
kef...@threefools.org
+1 541-386-8891 (h)
+1 541-490-9507 (c)
Skype: tkeffer

ysinhbi...@gmail.com

unread,
Apr 9, 2013, 11:19:21 AM4/9/13
to weewx...@googlegroups.com
example when it rains during the night from 23:00 to 01:00 the total rain is 4 mm, then at  00:00 all counters are reset so next morning it reports 2mm for today and 2mm for yesterday but for the last 24 hours its 4mm.
in the user manual i found this:

Aggregation periods $day, $week, $month, $year, $rainyear

The other time periods represent an aggregation over time. In addition to the time period over which the aggregation will occur, they also require an aggregation type. An example would be the week's total precipitation (where the aggregation type is sum):

$week.rain.sum

but i not understand how to convert it for "last 24hr","last 7 days"
As I try to use the weather data for optimum growth, I follow the lunar calendar, this is why values as "last month" in Gregorian calendar are pointless in my case : example today 09 april 2013 == 29 february lunar calendar .

I don't ask for a complete solution, but a little guide of how and where in all the lines of code i can adjust without breaking things

Collecting weather data is interesting, and its even more interesting when you can really do something with that data and see the progress

best regards

Thomas Keffer

unread,
Apr 9, 2013, 11:24:49 AM4/9/13
to weewx-user
OK, now I get it!

One can easily add extensions such as this. There are examples in the Customizing manual for adding statistics for "all time" and for "last 7 days." An extension for "last 24 hours" or "last 28 days" would be similar. See the section Writing a custom generator.

-tk


--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ysinh biomedical equipment

unread,
Apr 9, 2013, 9:50:17 PM4/9/13
to weewx...@googlegroups.com
Thank you Sir for your for your suggestion, with the given information i will be able to figure it out. I never say "easy" :) but sure its doable ... nice challenge for me

Thank you for the great software and all your efforts of support.

Greetings from Vietnam 


--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/vddddEX6s-Y/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Thomas Keffer

unread,
Apr 9, 2013, 9:55:08 PM4/9/13
to weewx-user
Well, I'll admit that if you're not facile with Python it can seem pretty opaque. But, consider what you just did: you effectively added a new database query type to the system, all without ever seeing any SQL!

Send us the URL to your site when you're ready. It would be great to get a Vietnam link!

-tk

Ysinh biomedical equipment

unread,
Apr 11, 2013, 6:15:13 AM4/11/13
to weewx...@googlegroups.com
Today i have my RPi connected to my vp2+ console, very simple , no data logger, no serial cable to usb or whatever, just straight :
console expansion connector pin 5 to rpi gpio pin 8
console expansion connector pin 6 to rpi gpio pin 10
console expansion connector pin 15 & 16 to rpi gpio pin 6 (gnd)
and i use /dev/ttyAMA0   ,<--zero at the end, as serial device in weewx.conf

before you can use ttyAMA0 as its in use for kernel logging output, i have disabled this by:
Edit the /boot/cmdline.txt
sudo nano /boot/cmdline.txt — the file should look like this:
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
edit the  /etc/inittab
sudo nano /etc/inittab
and  put a # in front of line T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

as i run the RPi headless, only use ssh to connect to it (4..5 sessions at the same time)
so that i can see the syslog, the output from weewx looks good:

LOOP:   2013-04-11 17:07:53 ICT (1365674873) {'leafWet2': None, 'monthET': 2.16, 'heatindex': 37.87037245000005, 'outHumidity': 63.0, 'dayRain': 0.0, 'dayET': 0.09, 'consBatteryVoltage': 1.31, 'extraTemp2': None, 'txBatteryStatus': 0, 'monthRain': 0.16000000003999998, 'insideAlarm': 0, 'extraAlarm4': 0, 'forecastIcon': 7, 'stormRain': 0.0, 'soilLeafAlarm4': 0, 'sunrise': 1365633420, 'extraAlarm5': 0, 'soilMoist3': None, 'leafTemp4': None, 'extraAlarm6': 0, 'soilLeafAlarm3': 0, 'soilMoist2': None, 'outsideAlarm1': 0, 'leafTemp3': None, 'outsideAlarm2': 0, 'radiation': 40.0, 'forecastRule': 172, 'leafTemp2': None, 'rainAlarm': 0, 'stormStart': None, 'inTemp': 32.72222222222223, 'sunset': 1365677880, 'windSpeed10': 1.0, 'yearRain': 14.260000003564999, 'extraAlarm1': 0, 'extraAlarm2': 0, 'extraAlarm3': 0, 'barometer': 1005.37112, 'windchill': 31.944444444444446, 'dewpoint': 24.002033353350427, 'extraAlarm7': 0, 'extraAlarm8': 0, 'soilTemp1': None, 'soilTemp2': None, 'soilTemp3': None, 'soilTemp4': None, 'soilLeafAlarm2': 0, 'extraHumid6': None, 'extraHumid7': None, 'extraHumid4': None, 'extraHumid5': None, 'extraHumid2': None, 'extraHumid3': None, 'extraHumid1': None, 'extraTemp6': None, 'extraTemp7': None, 'extraTemp4': None, 'extraTemp5': None, 'rainRate': 0.0, 'extraTemp3': None, 'leafTemp1': None, 'extraTemp1': None, 'leafWet4': 0.0, 'rain': 0.0, 'soilLeafAlarm1': 0, 'leafWet1': None, 'yearET': 10.25, 'leafWet3': None, 'UV': 0.0, 'dateTime': 1365674873, 'windDir': 87.0, 'outTemp': 31.944444444444446, 'soilMoist1': None, 'inHumidity': 61.0, 'windSpeed': 3.218688, 'soilMoist4': None, 'usUnits': 16}

no problems until weewx starts the report generator: output of syslog

Apr 11 17:00:18 raspberrypi weewx[2233]: reportengine: Caught unrecoverable exception in generator weewx.filegenerator.FileGenerator
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****  unsupported operand type(s) for /: 'NoneType' and 'float'
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****  Traceback (most recent call last):
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 130, in run
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****      obj.start()
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 287, in start
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****      self.run()
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****    File "/home/weewx/bin/weewx/filegenerator.py", line 41, in run
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****      self.setup()
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****    File "/home/weewx/bin/weewx/filegenerator.py", line 52, in setup
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****      self.initAlmanac(self.gen_ts)
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****    File "/home/weewx/bin/weewx/filegenerator.py", line 106, in initAlmanac
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****      formatter=self.formatter)
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****    File "/home/weewx/bin/weewx/almanac.py", line 154, in __init__
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****      self.time_djd     = timestamp_to_djd(time_ts)
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****    File "/home/weewx/bin/weewx/almanac.py", line 364, in timestamp_to_djd
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****      return 25567.5 + time_ts/86400.0
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****  TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
Apr 11 17:00:18 raspberrypi weewx[2233]:         ****  Generator terminated...
Apr 11 17:00:20 raspberrypi weewx[2233]: genimages: Generated 11 images in 2.35 seconds

also when i look in the /home/weewx/public_html there is no index.html generated

I've no clue what is wrong

Thomas Keffer

unread,
Apr 11, 2013, 11:13:34 AM4/11/13
to weewx-user
Try setting record_generation=software in section [StdArchive].

See the manual, section "3rd party Vantage connectors."

-tk

Ysinh biomedical equipment

unread,
Apr 14, 2013, 9:41:51 AM4/14/13
to weewx...@googlegroups.com
As I'm going through all docs and software V2.3.0 , I'm looking at line 430 in vantage.py and see we only send the string "LOOP " +number of loops to the vp2, but it should be that we send 'LPS 3 4' to get both LOOP and LOOP2 packets  see bottom of page 13 davis serial manual
the data received by the LOOP and LOOP2 packets are different with some in common
LPS 3 22 will result in every minute 12 LOOP packets and 12 LOOP2 packets each received alternated

this to get really all data out of the vp2

Best regards from VietNam :)




Thomas Keffer

unread,
Apr 14, 2013, 10:43:22 AM4/14/13
to weewx-user
Yes, that would be nice.

Unfortunately, the LPS command was only introduced a couple of years ago. The vast majority of Davis stations out there do not understand it. Hence, we use the LOOP command.

-tk

Ysinh biomedical equipment

unread,
Apr 14, 2013, 11:36:36 AM4/14/13
to weewx...@googlegroups.com
Ah okay, now that will be a nice challenge for me :)  extending the software for LOOP2 packets, and customizing skins & reports,extending the databases with new fields, i hope i can submit it before weewx version 3.0.0 :)
Of course any hints are helpful

best regards

Lorin Tremblay

unread,
May 12, 2018, 11:07:39 PM5/12/18
to weewx-user
Did you ever get this to work, i'm also looking to add that data to my weewx "rain in the last 24hrs"
Reply all
Reply to author
Forward
0 new messages