Daily, weekly or monthly view

I want to use Grafana to create a dashboard where I can easily switch from hourly to daily, weekly or monthly view from my solar power entity_id.
But I don’t know how I wil calculate the difference between 00:00-23:59 in time interval.
Could you help me please ?

Thank you…

See Time range controls | Grafana Labs
for guidance on how to specify units of time such as weeks and months.


1 Like

Antony, thank you so much for your interested in…
I want to show the power produced by solar panels as the total energy produced at the end of the day, week etc.
how do i chart the total production at the end of the day or the weekend ?

And… I can share my dashboard and panel if you would like to show me how I can make it…

I did the same in my home, using InfluxDB

For example, I store the grid in power, grid out, home and solar every second and the do a downgrade data to one minute to free resources.

So I do a mean by hour to see a “day chart”. See i query all data in one query.
I did diferent days with: Query Options → Relative time, Time shift

SELECT sum("P_Red")/60 AS "Red", sum("P_FV")/60 AS "FV", sum("P_Exp")/60 AS "Exportada", sum("P_Cargas")/60 AS "Cargas" FROM "Potencias" WHERE ("Tipo" = '1m') AND $timeFilter GROUP BY time(1h) fill(null)

To see a week chart I query: notice the arg tz() to align data to 00h.

SELECT sum("P_Red")/60 AS "E. Red Total" FROM "Potencias" WHERE ("Tipo" = '1m') AND $timeFilter GROUP BY time(1d) fill(null) tz('Europe/Madrid')

And similar to archieve This Month and This year

Thank you my friend,
It looks like so cool. Also I would like to do my charts.
Whattever i am new on the grafana and influxdb. Could you expleane a little more how i would set it ( SELECT sum(“P_Red”)/60 AS “Red”, sum(“P_FV”)/60 AS “FV”, sum(“P_Exp”)/60 AS “Exportada”, sum(“P_Cargas”)/60 AS “Cargas” FROM “Potencias” WHERE (“Tipo” = ‘1m’) AND $timeFilter GROUP BY time(1h) fill(null) )


Sorry for my delay.

I store in my InfluxDB the power consumption every second. So I have 60 measurements every minute, 3600 every hour.
In my python script, where I collect the data, I do a mean every minute and store in the InfluxDB with the label “Tipo” = ‘1m’… in english “Type = 1 minute”

The query in Grafana is… give me the sum of “P_Red” and divide it by 60.

This topic was automatically closed after 365 days. New replies are no longer allowed.