[Very Newbie] Daily consumption

i think that something like:

SELECT MAX(energy)-MIN(energy)
FROM measurement
WHERE $timeFilter
GROUP BY time(1d)

but it depends of your names