I’m trying to replicate this dashboard into Grafana.
I have already access to the values like daily_energy_vt and daily_energy_nt into Grafana.
How are you trying to achieve it?
The values I’m trying to graph need to be grouped by time of the day. I’ve expected that would be easier but either I’m overthinking to the solution or the thing is not possible and more transformation is needed.
What happened?
The values at the moment are simply graphed as an increasing curve. I have not found a way to group them by time of the day.
What did you expect to happen?
Can you copy/paste the configuration(s) that you are having problems with?
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
Did you follow any online instructions? If so, what is the URL?
OK, so obviously Histogram is not the right visualization tool here because you want aggregate (sum of the energy values) on an hourly basis, but still want to use the Grafana dropdown (6 hours, 1 week, etc.) to change the time scale, correct?
Am pretty sure this is possible, but will take some experimentation. In FluxQL, it’s much easier, but you are using InfluxQL, so click the pencil icon to view the query and then maybe try changing $timeFilter GROUP BY time(1h) fill(null)
I’ve tried but nothing. it did not work. I’m pretty sure that this is not directly possible in Grafana w/o before making a transformation on those data.
Like I said, you will probably have to write the query directly in the query editor (not using Grafana’s query builder) to get what you want. This post might be a good jumping off point.
I’ve also enabled fluxql so it should be now easier. I will play a bit and see if I can get to the solution and then I’ll post it back. I’m new to fluxql so no idea atm how to write that query.
SELECT max("value") AS "max_value" FROM "homeassistant"."autogen"."kWh" WHERE time > :dashboardTime: AND time < :upperDashboardTime: AND "entity_id"='daily_energy_nt' GROUP BY time(1h) FILL(null)
and this give me the increment aggregated by hour.
If only I could do the diff I could get the value per hour.
Does Grafana has a way to calculate the diff between the two increments?