Do you want to do this in Grafana or in a direct query on the database?
Edit:
If you want a direct query to give you the total Wh over a period then it will be something like
SELECT SUM("value")/2 FROM "the_measurement" WHERE ...
with a WHERE clause selecting the time range.
The divide by 2 is because, for example, the value 150W at 08:30 is 75Wh, the 230W at 09:00 is 115Wh and so on, so you just have to add them up over the total time range and divide by 2.