I use an energy meter SDM630 that writes the data to the Flux database via MBMD.
(GitHub - volkszaehler/mbmd: ModBus Measurement Daemon - simple reading of data from ModBus meters and grid inverters)
It writes every some seconds the current power.
This works as far as it goes.
I would like to display the energy consumption per day in Grafana. My problem is that the last date is double and the first date has wrong values (should be around 12kW per day).
(See screenshot markings)
This is my current query:
Do you have any idea how the query should be correct?
from(bucket: "sdm630") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["_measurement"] == "data") |> filter(fn: (r) => r["_field"] == "value") |> filter(fn: (r) => r["device"] == "SDM1.1") |> filter(fn: (r) => r["type"] == "Power") |> aggregateWindow(every: 24h, fn: (column, tables=<-) => tables |> integral(unit:1h, interpolate: "linear"), createEmpty: false)
Thank you Gudio