Hello,
I got a problem with displaying my power consumption per day and I am pretty sure that someone here can point me in the right direction.
I am using a table with some overrides for a better representation of the data. For the data itself I use the aggregateWindow Function for one day (1d) and only take the last value. To get the consumption per day the difference function is used which subtracts the value from the day before.
For the representation I override the value field with gradient gauge display mode and the time field with display name “Tag” (= day) and a custom unit time:DD.MM. for the date.
I have two problems that I don’t know a solution for. First one is obvious: The actual date is shown twice. In the picture the 27th is in the first and second row and I don’t know how to change that. It would also be nicer to name the first one “today” but that is something different.
Second problem is that the first row doesn’t show the actual consumption. There is a value of 1.45 but the graph is equal to zero and also the value of 1.45 doesn’t change over the day. Normally it should grow because I am consuming power.
Any ideas what I can do?
Thank you very much.
My code:
import “timezone”
option location = timezone.location(name: “Europe/Berlin”)
from(bucket: “iobroker”)
|> range(start: -7d, stop: now())
|> filter(fn: (r) => r[“_measurement”] == “sonoff.0.Stromzaehler.SENSOR.Z1.Bezug_1_8_0”)
|> filter(fn: (r) => r[“_field”] == “value”)
|> aggregateWindow(every: 1d, fn: last, createEmpty: false)
|> difference()
|> yield(name: “last”)