rain-plot hourly

88 views
Skip to first unread message

Joachim Puttkammer

unread,
May 10, 2019, 3:01:59 AM5/10/19
to weewx-user
Hi,
I'm using the current weewx version with a Mysql DB. Due to an error, non-existent rainfall was recorded (meteostick). Therefore I set the values in the database ( table archive, archive_day_rain and archive_day_rainRate, the columns rain, rainRate, sum, count and wsum) to 0 and deleted also the dayrain plot. The current condition values are now 0 but the plot hasn't changed. What to do for a correct plot?


best regards
Joachim

rain.png

Greg from Oz

unread,
May 10, 2019, 3:53:59 AM5/10/19
to weewx-user
I have a bash script that fixes it all up.

If you run wee_database /etc/weewx/weewx.conf --rebuild-daily --from=startdate --to=endate
and then run wee_reports it "should" fix it.

gjr80

unread,
May 10, 2019, 5:27:13 AM5/10/19
to weewx-user
The WeeWX image generator uses data from the archive not the daily summaries so unfortunately rebuilding the daily summaries will have no effect on the plots. WeeWX plots that use an aggregate interval are only regenerated every aggregate interval, so for an hourly rain plot this will be every hour. You can either wait an hour and the plot will be regenerated using the 'fixed' data or you can force regeneration on the next report cycle by deleting the offending plot from the WeeWX machine.

Gary

Joachim Puttkammer

unread,
May 10, 2019, 10:41:02 AM5/10/19
to weewx-user


Am Freitag, 10. Mai 2019 09:53:59 UTC+2 schrieb Greg from Oz:
I have a bash script that fixes it all up.

If you run wee_database /etc/weewx/weewx.conf --rebuild-daily --from=startdate --to=endate
and then run wee_reports it "should" fix it.

Hi Greg, I tried (very quickly) your script, but without success, there are some errors. I will have a look at this evening

rich T

unread,
May 10, 2019, 11:01:12 AM5/10/19
to weewx-user
If the plot still did not update, try clearing your browser cache.

Greg from Oz

unread,
May 11, 2019, 4:49:27 AM5/11/19
to weewx-user
Let me know how you go with the script.
I use it and it works fine for me.
I am running Ubuntu...

Joachim Puttkammer

unread,
May 11, 2019, 6:30:39 AM5/11/19
to weewx-user
I have solved the plot-problem by hand with phpmyadmin and sql query.

the 1. script ( named raindel.sh) run :
./raindel.sh: Zeile 74: bc: Kommando nicht gefunden.

I installed bc , then insert in the DB two values for rain and rainRate in table of weewx ( for rain simulation )
I started the script again :

Now : after each row there is an "-e"
This fixes the database if there are any wrong entries
-e
If you just press enter for the next two prompts you will get all the rainfall for the day
-e

After ENTER  input for day, time and rain quantity there are errors :

./raindel.sh: 44: ./raindel.sh: [[: not found
-e The date selected is 

./raindel.sh: 55: ./raindel.sh: [[: not found
-e The time selected is 

./raindel.sh: 65: ./raindel.sh: [[: not found
-e

-e The rain amount is   and the reporting interval is  5  minutes.
-e
(standard_in) 2: syntax error
./raindel.sh: 78: ./raindel.sh: [[: not found
-e
----------------------------------------

Then I guess some issues aren't displayed:

-e Rain value is   and rain rate value is 
-e If there are no records above then that means there are no rain rates for 

Select the FIRST dateTime you want to update
after update, there is nothing and therefore I tried the unix-date

-----------------------------------------
as an attachment the rain-script.txt for better understanding

I insert the ---   if the script expected an input


best regards
Joachim

Joachim Puttkammer

unread,
May 11, 2019, 6:32:59 AM5/11/19
to weewx-user
hier the attachement
rain-script.txt

Greg from Oz

unread,
May 11, 2019, 8:14:37 AM5/11/19
to weewx-user
Hi
The -e is for formatting the text to colour.

Also you need this at the very first line of your script:

#!/bin/bash



On Saturday, 11 May 2019 20:32:59 UTC+10, Joachim Puttkammer wrote:
hier the attachement

Joachim Puttkammer

unread,
May 11, 2019, 12:34:00 PM5/11/19
to weewx-user

Hi,
I changed the script a bit and now it works,
The double bracket I have made into a simple one and replaced all -e with "\n" at the end of the echo line.
 At the end I changed the colour.
raindel.sh

Greg from Oz

unread,
May 11, 2019, 7:12:34 PM5/11/19
to weewx-user
Glad it worked for you.
I am sure there is a better way to do it but that was my first attempt at writing the script, but it works for me.
Reply all
Reply to author
Forward
0 new messages