Hello!
I have the following issue with this flux:
import “timezone”
option location = timezone.location(name: “Europe/Berlin”)
from(bucket: “iobroker”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “field” and r[“_field”] == “value”)
|> aggregateWindow(every: 24h, fn: last, timeSrc: “_start”, createEmpty: false)
|> difference()
|> map(fn: (r) => ({r with _kWh: float(v: r._value) / 1000.00}))
When I use this with e.g. “This week so far” as timerange the current week starts at 19.9. and not at 18.9.
Another flux without difference() works as expected:
import “timezone”
option location = timezone.location(name: “Europe/Berlin”)
from(bucket: “iobroker”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “field”)
|> filter (fn: (r) => r[“_field”] == “value”)
|> aggregateWindow(every: 24h, fn: last, timeSrc: “_start”)
Any ideas what I can do to get the right output for the first flux??
Thanks!