Unable to group cumulative_sum output by time(1d)

Hi there,

at the moment I try to build my own heat output counter from existing sensor measurements inside my database.

I know power input, deltaT between inlet and outlet. Only the circuit flow is a predicted constant as I have no flow sensor installed. With this values it should be possible to calculate the actual heat output and COP of my heat pump. So far so good, I can chart actual output and COP of my heat pump.

But I’m unable du cumulate current power (kW) to cumulated ones (kwH).

My latest state of error ist this query:

Select cumulative_sum("WärmeabgabeHK") as "WärmeabgabeHK" from (
	Select last("WärmeabgabeHK") as "WärmeabgabeHK" from (
		((last("Kesseltemp") - last("TempPuffer2"))  * 1150 * 0.00161)*1000 as "WärmeabgabeHK"
		,last("status_WP") as status_WP
		,last("status_Trinkwasser") as status_Trinkwasser
		,last("PowerReal_P_Sum") as wp_Strom
	from calcBaseData where $timeFilter  group by time(1h) fill(0)) where "status_WP" = 19 AND "wp_Strom" > 150 AND ("status_Trinkwasser" > 95 OR "status_Trinkwasser" <= 25 AND "WärmeabgabeHK" > 0) 
Group by time(1h) fill(null)

Which results in an linux counter like increasing graph over the whole requested time range:

But as soon as I add a

...group by time(1d) 

I receive a null output without any error. What I’m doing wrong?!