I have a power meter who is logging the usage every minute and also on every change. I would like to greate a graph where I show the Wats per hour (Wh) SUM over the day.
This would be easy if I would only have 1 minute samples. I would have 1440 samples per minute, and SUM this with a window method. But as there are also samples created with every change, I can’t seem to get a query that only selects the minute samples, or a sample per minute.
Using grafana 7.0.3 and MySQL 8.
SELECT $__timeGroupAlias(Time,$__interval), SUM(ABS(value) / 1440) OVER(ORDER BY time) AS Production FROM Item59 WHERE $__timeFilter(Time)
What could I do in MySQL or grafana to select only one sample per minute?
Thank you in advance,