Yup, that looks good!
I’m also now clear about what you meant by the 14-day daily chart. You basically need daily values. Try something like
SELECT sum("mean")/3600 FROM (
SELECT mean("value") FROM "autogen"."Item_Garten_Steckdose_Solarpanel_Poolhuette_EnergyCurrent" WHERE $timeFilter GROUP BY time(1s) fill(previous)
) WHERE $timeFilter GROUP BY time(1d,-2h) fill(null)
Your inner query will yield mean power values on a second-by-second basis. You can think of each of those representing a number of “Watt-seconds”. Each Watt-second is 1/3600th of a Watt-hour. So if you sum all of the Watt-seconds you have and divide by 3600, you’ll get Watt-hours.
In fact you can also represent your first query in exactly the same way, i.e.
SELECT sum("mean")/3600 FROM (
SELECT mean("value") FROM "autogen"."Item_Garten_Steckdose_Solarpanel_Poolhuette_EnergyCurrent" WHERE $timeFilter GROUP BY time(1s) fill(previous)
) WHERE $timeFilter GROUP BY time(1h) fill(null)
just with a different aggregation period (1h instead of 1d). Here sum("mean")/3600
is equivalent to mean("mean")
since there will be 3600 readings per hour.
Hope this helps. By the way I also use Grafana for solar power monitoring also, so it’s cool to see your use case!