I am running Grafana v9.3.1 on Raspberry Pi 4 B. I am trying to Stack values from two Goesund EP2 Smart Sockets that run Tasmota 12.2.0 and log with Homebroker.io in InfluxDB. The timestamps of the values are not identical because I cannot (or don’t know how to) control the time when the Sockets send the values. Hence the sockets are logging every 10s they have a gap between each other of up to 5 seconds.
I thought I could just use the stacking option and Grafana would automatically group the values but I always get a zero value stacked to the actual value and never the 2 actual values together.
I also tried summing the values with Transform and a binary operation but that was also unsuccessful because I did not get a new Alias.
I think I am not seeing something fairly obvious. I don’t know and can’t find if there is an option in Grafana that stacks all values in the range of 10 seconds together or if I just need to write that in flux.
My Query is the following:
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “Power_Socket_002” or r[“_measurement”] == “Power_Socket_001”)
|> filter(fn: (r) => r[“_field”] == “value”)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: “mean”)
Thanks for any help on this topic!