Hello!
I would like to create a graph with 15 minute average of my HomeAssistant/InfluxDB/Grafana Shelly3EM data of electricity power. I have a state MojElektro electricity app reference to compare with.
This is the code so far:
from(bucket: “homeassistant/autogen”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“entity_id”] == “power_a_b_c”)
|> filter(fn: (r) => r[“_measurement”] == “W”)
|> filter(fn: (r) => r[“_field”] == “value”)
Now I need to calculate 15 min average of data. Then I must time shift it for 15 minutes in advance to sync it with state app.
MojElektro app shows average of 2kW at 23.45.
Grafana app shows roughly the same kW at 23.30.
I am trying to use Flux in Grafana because of time difference in my measurements vs state measurements (probably NTS problem or data calculation difference).
I will attach screenshots for clarification.
Thank you in advance.
Do you know in myelektro calculates using rolling interval or in static intervals?
Static Intervals: This means that the intervals are fixed, starting at the top of the hour and then every 15 minutes thereafter (e.g., 11:00 to 11:15, 11:15 to 11:30, and so on). The electricity usage during each of these intervals is measured separately.
Rolling Averages: In this case, the usage is calculated as an average over the last 15 minutes, regardless of the exact start time of the measurement. This method smooths out short-term fluctuations in usage but doesn’t align measurements to specific quarters of the hour.