Help with rule / var definition?

I need your help finding my error with a rule where I try to calculate average waterconsumption. The basis is a field called Watermeter_Liter which gets updated by MQTT from my watermeter every time 1 liter has been metered.
The format of the data comming in is a number with 3 digits (cubic meter with 3 decimals, i.e. “221.143”)

This works well all around - but I cannot get this rule to work it - and I believe my problem lies in the … “var Number” definitions. It seems like the rule execution stops right at that (tested inserting a twitter Tweet just before and just after).

What am I doing wrong ?


rule "calculate waterconsumption"
		Time cron "0 0/1 * * * ?"   // every minute


		// Something is wrong here:
		var Number LiterToday = Watermeter_Liter.deltaSince(now.toDateMidnight, "rrd4j"))
        var Number LiterLastHour = Watermeter_Liter.deltaSince(now.minusHours(1), "rrd4j")

		LiterToday = LiterToday * 1000
		LiterLastHour = LiterLastHour * 1000

        postUpdate(Watermeter_Liter_Today, LiterToday)
        postUpdate(Watermeter_Liter_LastHour, LiterLastHour)



Number	Watermeter_Liter	"Watermeter [%.3f m3]"	<water>	(watermeter)		{ mqtt="<[control:sensor/watermeter/waterusage/cubicliter:state:default]" }
Number	Watermeter_Liter_LastHour	"Water last hour [%.0f liter]"	<water>	(watermeter)	
Number	Watermeter_Liter_Today	"Water today [%.0f liter]"	<water>	(watermeter)	
DateTime	Watermeter_LastUpdate	"Last read [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"

// persistence strategies have a name and a definition and are referred to in the “Items” section
Strategies {
// for rrd charts, we need a cron strategy
everyMinute : “0 * * * * ?”

Items {
	* : strategy = everyChange, everyMinute, restoreOnStartup

Found the error myself; there was a paranthesis too much in the first var Number definition (at the end). Now it works…