I’m pretty new to Grafana and have an issue I can’t figure out. Btw, I’m using InfluxDB as data source.
I’m getting data from my smart energy meter (measuring gas/power usage) going to Home Assistant and then to InfluxDB. The interfal of sending data is when the number changes (so when not using gas the latest number stays until gas usage starts) and resets at midnight (so daily usage).
So I want 3 graphs, a daily, weekly and monthly usage. The daily graph I’ve already setup and running as a line graph. The weekly and monthly graphs I want them to be bar graphs.
So when setting up the weekly graph, I’m getting a discrepancy between daily and weekly.
So for example, today my current gas usage so far is 0.62m3 as can be seen on the daily graph below:
I know this value is correct because I can check the sensor value in Home Assistant:
But when I try to setup the weekly graph I get an usage of 0.364m3:
“See second post for image”
This discrepancy is for every day. I’ve tried different options and values in the graph but never get the same outcome as the daily graph.
This are the settings for the daily graph with a relative time of
SELECT mean("value") FROM "m3" WHERE ("entity_id" = 'daily_gas') AND $timeFilter GROUP BY time($__interval) fill(linear)
This are the settings for the weekly graph with a relative time of
SELECT mean("value") FROM "m3" WHERE ("entity_id" = 'daily_gas') AND $timeFilter GROUP BY time(1d) fill(linear)
The fix is propably easy but I can’t figure it out.