OpenEMS daily energy (kWh) handling

Hi OpenEMS community,

I’m integrating an energy meter into OpenEMS Edge and I need precise daily (and weekly/monthly/yearly) energy consumption/production in my case, and I’m confused about where exactly OpenEMS computes these values: so as I understand there are two methods it’s by either done by reading the meter’s cumulative total import/export energy registers (monotonically increasing Wh) and then deriving daily energy as ΔWh = Wh(end of day) − Wh(start of day) as i assume (and similarly aggregating for week/month/year based on the daily calculation) so is it done every cycle, and if so where in the code does this delta/period logic happen and how robust is it if Edge loses power or the meter connection drops (does it “catch up” cleanly from the meter counters, or can accuracy be impacted); alternatively, when using CalculateEnergyFromPower method (integrating real-time power into energy), what is the reset/rollover mechanism for “daily” values, how are the computed energy values stored/persisted in the timedata/database, and what happens on restart/offline periods to avoid resets or missing energy, given my requirement is billing-grade precision?