Hi,
I am trying to display in Grafana a daily power consumption graph using data gathered from a SONOFF device (POWR320D). The data are sent via node-red flow to a influxdb db and used in Grafana.
Well after reading many posts on power consumption displays, I have managed to get a graph which gives me the same information I have when I use the SONOFF app.
The device is giving me the actual power consumption, Wh. I am sending this info to Grafana and this helps me plot a panel with actual consumption. And I have another plot where I try to get the “daily consumption”. I am gathering the meter data and grouping it for 1h and I am getting the exact reading from the app (hour by hour). Then I have set up the “Total” variable so I can sum these figures and get the daily consumption. And my results are really close to the one displayed by the Sonoff app.
I still have one issue. When I plot the daily graph, it gives me a 1 day “window” and it’s not a graph from midnigh to midnight.
My SQL query looks like this ":
SELECT mean(“electric-power”) / 100 FROM “Switch” WHERE (“devicename”::field = ‘POWR320D’) AND $timeFilter GROUP BY time(1h) fill(null)
And I use the “Query options” to set the “Relative time” to “1d”.
Is there another way to have a fixed plot from 00:00 to 23h00 of one day, just for this panel, I don’t want to use the general time scheduler of the dashboard.
And I seize the opportunity to add another request, is there a way to plot the results for one month day by day ? How to use the “Total” variable calculated in the daily plot to store it and use it in another panel ?
THANK you in advance for your help.
Best,
Abdo