belchertown days without rain

26 views
Skip to first unread message

vince

unread,
Jun 14, 2019, 5:39:16 PM6/14/19
to weewx-user
Pat - back to fiddlin' with Belchertown....

I notice my site is showing 700+ days alltime record for days without rain, which is of course not true (near Seattle).    My recollection is that waaaay back when my old LaCrosse 2315 piece of junk was throwing out bogus rain totals so I cleared all the rain totals for the 2+ years that I had that online with wview/weewx up to the time I got my VP2 in early 2009.  It's very likely that I just set all the values to 0.00 rain for the day, rather than NULL (untested - I'll check tonight).

What's the best way to get belchertown to show truth for this alltime record ?

I'd really like to avoid doing a drop_daily and rebuild since I have 12+ years of data in there.   If I need to do something like change all the rain totals for a day to NULL when the date is earlier than jan-1-2009, then I can certainly do that in sqlite3 for the archive table and whatever table(s) you're using to get the days-since-last-rain from, but I wasn't certain from the source code where you're getting the time-between-rain-events data from.

Suggestions ?

Pat

unread,
Jun 14, 2019, 7:49:21 PM6/14/19
to weewx-user
I know you know this, but first make a backup of your database :)

Is the problem with the "all time" days without rain, or "this year" days without rain? 

  • All time uses this querySELECT dateTime, ROUND( sum, 2 ) FROM archive_day_rain; so setting those to NULL would
  • "This year" days without rain uses this query: SELECT dateTime, ROUND( sum, 2 ) FROM archive_day_rain WHERE strftime("%%Y", datetime(dateTime, "unixepoch")) = "%s";' % time.strftime( "%Y", time.localtime( time.time() ) )

Both are looking at the same table, and both are looking to see what the sum is. If 0 it increments to days without rain, and if it's > 0 it increments the days with rain. 

So modifying that single table for the sum column to be 0 should cover it I'd think. Is your sum column showing NULL for sum (I don't think it would)?

What happens if you run those queries directly on the db?
Reply all
Reply to author
Forward
0 new messages