No problem with saving the cumulative data. What I'm wondering about is your approach. Why mess with things like RecordBinder?
Presumably, you're getting cumulative energy data off of some sensor, using a driver. That's the place to take the differences. Very similar to the strategy that many weewx drivers use of deriving rain from cumulative totalRain. -tk On Thu, Jan 12, 2017 at 8:24 AM, Louis De Lange <[email protected]> wrote: > Tom, > > Absolutely agree about saving the incremental data, which is what I am > really after. > > The reason I am also saving the cumulative data and using the last saved > record to calculate the current incremental value is to limit an error that > will be present if my server goes offline for a few days - on a restart > there would be a bunch of incremental values missing that will affect the > accuracy of longer term summations. It happened last summer that the > server went offline for a week while I was on vacation. > > Perhaps there is a better way to do it, and I am happy to learn - but this > is why I went down that rabbit hole. > > On Wednesday, 11 January 2017 16:14:26 UTC-8, Tom Keffer wrote: >> >> Good. For the future: this is why it's better to store the amount >> accumulated during the archive period for extensive quantities like rain >> and energy, rather than the cumulative value. This way, you can just do a >> simple sum over the desired time period to get total energy consumption. >> >> But, if you have the cumulative value in Python, why are you messing >> around with RecordBinders and the like? Why not just calculate the delta >> and include it in the archive record like any other quantity? >> >> -tk >> >> >> -- > 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]. > For more options, visit https://groups.google.com/d/optout. > -- 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]. For more options, visit https://groups.google.com/d/optout.
