Hey,
I have energy consumption bar chart.
Here are my configs and view of dashboard:
import "timezone"
option location = timezone.location(name: "Europe/Warsaw")
from(bucket: "openhab_db")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "SolarEdge_Day_Production")
|> filter(fn: (r) => r._field == "value")
|> aggregateWindow(every: 1d, fn: last, createEmpty: false)
|> timeShift(duration: -1s)
from here it should give me last value or maks value, because this data is growing through day.
import "timezone"
option location = timezone.location(name: "Europe/Warsaw")
from(bucket: "openhab_db")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "Licznik_Energa_Produkcja")
|> filter(fn: (r) => r._field == "value")
|> aggregateWindow(every: 1d, fn: mean, createEmpty: false)
|> timeShift(duration: -24h1s)
|> difference()
Here it should give me difference between 1 day, because this is data from energy meter, and it is 24h delay from reading so for this I have timeShift
import "timezone"
option location = timezone.location(name: "Europe/Warsaw")
from(bucket: "openhab_db")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "LicznikEnerga_EnergaZuzycie")
|> filter(fn: (r) => r._field == "value")
|> aggregateWindow(every: 1d, fn: mean, createEmpty: false)
|> timeShift(duration: -24h1s)
|> difference()
Here it should give me difference between 1 day, because this is data from energy meter, and it is 24h delay from reading so for this I have timeShift
Ant this is how it looks like:
Every data till yesterday are ok, but why todays data are splitter in two columns?
Why are today’s data separated ??