Getting sum of values of the day in Gauges

Hello,

I’ve recently discovered Home Assistant / InfluDB / Grafana and would like to use these to 2 things:

  • Displaying a Graph of the current day in W with values from gathered my smartplugs, the total consumption of the house, my EVSE and the PV production --> That’s done

  • Displaying Gauges of the same day in kWh with the sum of these devices/sensors… And I can’t get the this right.

I have this:
SELECT sum("value") FROM "W" WHERE ("entity_id" = 'evchargingpower') AND $timeFilter GROUP BY time($__interval) fill(0)

The values are sent to HA/InfluxDB every minute or for some devices every two minutes…

Many thank in advance