Change/edit/delete rain sum

138 views
Skip to first unread message

Tomasz Lewicki

unread,
May 3, 2025, 12:44:31 PM5/3/25
to weewx-user
I would like to ask which columna in the archive_day_rain array stores the daily rainfall. The problem is that Weewx has treated today's rainfall at my place in a very strange way - the daily summary in the HTML files shows more than 130 mm. The station panel (logger) recorded 12 mm and this is the correct value, because another station located about 1 km from me recorded a similar value. I would like to manually correct the daily precipitation in the weewx.sdb file, but I don't know which column I should edit - sum or wsum. In what units is the precipitation value expressed? In the wsum column I have 1515 - but what?

michael.k...@gmx.at

unread,
May 4, 2025, 5:55:34 AM5/4/25
to weewx-user
To correct your rain values modify the column in the archive table, then let weewx build the daily values for the affected dates. I can't remember if the rainRate is a derived value or not (or if it depends on the hardware), if so, you might want to (delete and) recalculate this derived value also. There shouldn't be any need to modify die archive_day table.

Tomasz Lewicki

unread,
May 5, 2025, 2:59:36 AM5/5/25
to weewx-user
Thank you for the reply. But as I wrote in othe thread (https://groups.google.com/g/weewx-user/c/aPjmvWN9Kss), values in 'archive' table looks normal. So I don't know what is correlation between 'sum' and 'wsum'  and what is the reason that in the current data I have the correct values, and the daily summary shows something strongly deviating from reality. I would like to fix this, because it spoils the statistics a lot, and I would not like to zero out the rain from the whole day.

michael.k...@gmx.at

unread,
May 5, 2025, 3:35:06 AM5/5/25
to weewx-user
sum is the sum, wsum is the weighted sum, needed to calculate averages, etc.

michael.k...@gmx.at

unread,
May 5, 2025, 3:36:12 AM5/5/25
to weewx-user
When the archive table is ok, just rebuild the affected days. If the archive really is OK, then everything should be correct.

Tomasz Lewicki

unread,
May 5, 2025, 5:12:19 AM5/5/25
to weewx-user
For testing purposes, I installed Weewx on my laptop and transferred the database to it from the Raspberry Pi running my PWS. Weewx runs in simulator mode, but I'm interested in data from yesterday and earlier, so I don't pay attention to the current readings. I've done everything, including rebuilding the database described here: https://weewx.com/docs/5.1/utilities/weectl-database/?h=derived#recalculate-daily-summary-weights Unfortunately, nothing changes - the false value is still visible in daily, weekly and monthly data. I don't understand what the issue is :|

Tomasz Lewicki

unread,
May 5, 2025, 5:32:37 AM5/5/25
to weewx-user

I took another peek into the database and noticed something strange. I sorted all the records in the ‘rain’ column from smallest to largest. Excluding those with a value of 0.0, all the records have a value much smaller than 1; the largest has a value of 0.4. However, there is one that has a value of 4.984 - and that's the one from May 3, 2025, 10:00 a.m. local time. If I understand correctly, 4.984 is the value in inches - this would explain the false precipitation value (126.6 mm plus the rest from that day). I will do some modification soon and write about the results.

michael.k...@gmx.at

unread,
May 5, 2025, 5:53:32 AM5/5/25
to weewx-user
Yes, as described above: correct the values in archive table and then rebuild the affected days.

Tomasz Lewicki

unread,
May 5, 2025, 6:07:30 AM5/5/25
to weewx-user
Problem SOLVED!

I will describe the course of action, should anyone encounter a similar incident in the future and come across this thread.

I assumed that the wrong value in the ‘rain’ column is given in inches:

4.984 inches = 126.6 mm

I know from the PWS panel records that 15.0 mm of rain fell that day:

15 mm = 0.590551181102 inch

I subtracted the false value of 4.984 from the total value of 5.294 from the ‘rain’ column for the entire day:

5.294 - 4.984 = 0.31 inches

Now I convert this difference into millimeters:

0.31 inch = 7.874 mm

From the known precipitation value of the whole day (15 mm) I subtract the precipitation value from all observations (records) except one false one:

15 mm - 7.784 mm = 7.126 mm

The result of the above subtraction to the true (or close to true) rainfall value, which falsified the daily results. I convert it to inches:

7.126 mm = 0.280551181102 inch

I substitute the latter value in the database in the appropriate row and column:

echo “UPDATE archive SET rain=0.280551181102 WHERE dateTime = 1746259200;” | sqlite3 /var/lib/weewx/weewx.sdb

(I didn't back up the database because I run all the time on a local copy of the database on my laptop, not on a Raspberry Pi that supports PWS).

Now rebuilding the daily statistics:

weectl database rebuild-daily --date=2025-05-03

And everything looks as it should :)

Thank you for your help and hints - although they did not solve the problem by themselves, they guided me to the right solution.
Reply all
Reply to author
Forward
0 new messages