Acumulated rain since a date.

117 views
Skip to first unread message

Manuel

unread,
Apr 24, 2021, 12:54:39 PM4/24/21
to weewx-user

Good afternoon. How can I get the accumulated rain from a date . Example from September until now. Thank you.

Tom Keffer

unread,
Apr 24, 2021, 1:04:41 PM4/24/21
to weewx-user
If you know the unix epoch time, it's easy enough. For example, for all the rain since 1-Jan-2021 0000 UTC:

<p>Rain since the start of the year UTC: $current(current_time=1609459200).rain.sum</p>


On Sat, Apr 24, 2021 at 9:54 AM Manuel <nofu...@gmail.com> wrote:

Good afternoon. How can I get the accumulated rain from a date . Example from September until now. Thank you.

--
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 to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/2856f638-d857-4966-94a8-9a1975020e4bn%40googlegroups.com.

Manuel

unread,
Apr 24, 2021, 4:05:02 PM4/24/21
to weewx-user
Hi Tom I have put that in the index.html.tmpl and it gives me the following error:
Apr 24 21:51:13 raspberrypi weewx [9579]: cheetahgenerator: Generate failed with exception '<type' exceptions.TypeError '>'
Apr 24 21:51:13 raspberrypi weewx [9579]: cheetahgenerator: **** Ignoring template /etc/weewx/skins/Standard/index.html.tmpl
Apr 24 21:51:13 raspberrypi weewx [9579]: cheetahgenerator: **** Reason: current () got an unexpected keyword argument 'current_time'
Apr 24 21:51:13 raspberrypi weewx [9579]: **** Traceback (most recent call last):
Apr 24 21:51:13 raspberrypi weewx [9579]: **** File "/usr/share/weewx/weewx/cheetahgenerator.py", line 332, in generate
Apr 24 21:51:13 raspberrypi weewx [9579]: **** fd.write (str (compiled_template))
Apr 24 21:51:13 raspberrypi weewx [9579]: **** File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__ Apr 24 21:51:13 raspberrypi weewx [9579]: **** rc = getattr (self, mainMethName) ()
Apr 24 21:51:13 raspberrypi weewx [9579]: **** File "cheetah__etc_weewx_skins_Standard_index_html_tmpl_1619293873_73_36940.py", line 825, in respond
Apr 24 21:51:13 raspberrypi weewx [9579]: **** File "cheetah__etc_weewx_skins_Standard_index_html_tmpl_1619293873_73_36940.py", line 98, in __errorCatcher5
Apr 24 21:51:13 raspberrypi weewx [9579]: **** File "<string>", line 1, in <module> 
I don't know what I'm doing wrong.
Thanks for your quick response.

Tom Keffer

unread,
Apr 24, 2021, 4:36:03 PM4/24/21
to weewx-user
Geez, my apologies. I don't know what I was thinking.

Unfortunately, no, it is not possible to sum from an arbitrary time. It's a reasonable thing to do, but at the moment, weewx does not support it. You would have to write a search list extension to do it.

Manuel

unread,
Apr 24, 2021, 4:43:26 PM4/24/21
to weewx-user
Thank you very much Tom. My knowledge doesn't go that far. I do it manually by adding the rainfall of the months since September, which is the beginning of the hydrological year.

Tom Keffer

unread,
Apr 24, 2021, 5:35:23 PM4/24/21
to weewx-user
Oh. In that case, you can use $rainyear. That's what it's for:

$rainyear.rain.sum

Just be sure to set option rain_year_start to whatever month your rain year starts.

BTW, many of the skins come with this already included.

p q

unread,
Apr 24, 2021, 5:36:52 PM4/24/21
to weewx...@googlegroups.com
You can set the rain year, which might have been what you were looking for anyway. 
In weewx.conf
rain_year_start = 9 
(for sept)


On Sat, Apr 24, 2021 at 1:43 PM Manuel <nofu...@gmail.com> wrote:


--
Peter Quinn
(415)794-2264

Manuel

unread,
Apr 24, 2021, 5:55:37 PM4/24/21
to weewx-user
No. I only need to know the rain since September but not at all weewx. Thanks.

Manuel

unread,
Apr 26, 2021, 9:25:44 AM4/26/21
to weewx-user
Solved. I have changed rain_year_start = 9 in weewx.config because there are two different variables: "$ rainyear.rain.sum" which is the rain since September and "$ year.rain.sum" the rain since January 1st. That's what I wanted. Thank you.
Reply all
Reply to author
Forward
0 new messages