Smartmeter - daily kWh - any existing solution

Can you tell me, exactly what this line does:

EZD_Bezug_Heute.postUpdate ((EZD_Wirken_A_plus.deltaSince(now.withTimeAtStartOfDay, "influxdb")).floatValue)

Ii tried it on my SMA Energy Meter, which tells me every 30 second, how much energi our household is drawing from the Grid. But I end up with a strange value for the calculated item, (its a negative value which seems to count down).
This is my test rule:

rule "Strømforbrug fra Grid daglig" 
when
Item PurchasedPower received update
then
DagStroemForbrug.postUpdate ((PurchasedPower.deltaSince(now.withTimeAtStartOfDay, "influxdb")).floatValue)
end

The item PurchasedPower is persisted in influxdb.
The item DagStroemForbrug is just a proxy item (the calculated value I suspect).

This is how it looks like in my sitemap:

Red square is the smart meter data item (PurchasedPower) .
Yellow is the value of the proxy item (DagStroemForbrug)