Thank you for the examples and ways to accomplish this. I assume that by trying it, it will not corrupt the data base, since this is a 'read' type function, correct? If I screw it up, then no harm done, just remove this code or whatever I insert and then restart WeeWx?
Secondly, just for my generation of old timers, I assume that this code will trigger an aggregation from the data base, for instance, by going through all the records for yesterday, totaling the rain, but doing so every time WeeWx generates those HTML images to post to my server? I am from an era where CPU cycles were expensive and slow. Knuth suggested if there were a string that wouldn't change in a loop, to calculate it outside the loop and save it as a constant value and reference that. And on those installs of WeeWx running on RaspPi machines, there is the suggestion that hitting the database a lot will shorten the life of the SD cards which serve as their mass storage. Hence my initial suggestion to take the value of the rain, save it, and just call in that number (which will remain unchanged into the future) instead of accessing the database, and totalling the rain each and every time. If I can get the suggested way working, I'll be grinning a lot. The next would be to figure out the total rain and save that, but is that level of monkeying around with WeeWx permitted, or is the summary of yesterday's rain the only way to accomplish this, even if it does mean all the access and work each time? Just curious. And thank you all for the suggestions. Dale On Sunday, June 14, 2020 at 3:04:32 PM UTC-5, Dale Reid wrote: > > While yesterday's rain total isn't exactly a current condition, I would > like to have the display page show the amount of rain from yesterday. > > I know there are different ideas on when rain totals should zero out, but > I'm asking for something slightly different, and for me, would add to the > usefulness. > > I'm thinking of the situation that often occurs when a storm series moves > through, with say 1/2" or so of rain before midnight, then even more after > midnight, say 1/4" in the new day. > > It is really all the same storm, and not worth the logic to have it done > automatically, but to glance at the summary page and see today's rain is > 1/4", when the storm total is 3/4" would really work better to list what > yesterday's rain was right after today's total so far. > > I don't know how the inner structure of WeeWx works, so one way would be, > if the variable is available, to have today's rain total saved at midnight > to a new variable called YesterdayRain, then zero the today's rain > variable. It seems simple,but I don't know if the ordinary user would have > the ability to modify WeeWx to make this work. > > Is there already this Yesterday's Rain value available, and if so by what > name? > > Can we add a display line to the skin that generates the standard page, or > not? > > Another way to do it would be have the database total up yesterdays rain > with a date range but this seems to be a lot of work, involve accessing the > data base for no added reason, if one just had the YesterdaysRain already > stored. > > Just some thoughts. So far this is the only tweak I've thought of that > WeeWx doesn't seem to already do. Python is really beyond my current > skills, and while I know some might whip this together in short order with > their programming knowledge, I don't know how to find the stored variables > already, or fiddle around with it and screw something up. > > Dale > > ecwx.info/weewx > > (There are no error logs, there is nothing to submit, other than my idea). > > > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/d354276b-5357-4bc4-8b5a-77e658ad1d3do%40googlegroups.com.
