volkszaehler / volkszaehler.org

Open Source Smart Meter with focus on privacy - you remain the master of your data.
https://volkszaehler.org
GNU General Public License v3.0
209 stars 83 forks source link

aggregate might generate wrong results in specific cases #959

Open hasselh opened 1 month ago

hasselh commented 1 month ago

From time to time I run into issues with results in aggregate table for certain metrics. This usually happens when the count of measures fluctuates over time. E.g., I have a script, that usually takes 1 measures/minute, but intentionally might speed up to 15 measures/minute. In these times the aggregate values often get completely out of range. I checked data for these periods - content looks fine (happy to provide the raw data if needed).

Workaround that works for me:

Comment line 276 of Aggregation.php: /* 'SUM(agg.val_by_time) / (MAX(agg.timestamp) - MIN(agg.prev_timestamp)), ' . */