[SOLVED] Watt per Min in kWh

Hello everybody,

I’m doing something wrong. Since the Shelly Pm shows the total consumption only in “watts per minute”, I have created a rule that it will be converted to kWh. Normally, it should come out at 13154 watts per minute, a value of 0.219 kwh. Currently he shows me 0 in the following rule

val String filename = "shellyverbrauch.rules"
rule "Watt pro Minute in kWh"
when
	Item szi_allgemein_geenergy received update
then
	var int verbrauch = (szi_allgemein_geenergy.state as DecimalType).intValue / 60
	verbrauch = verbrauch / 1000
	szi_allgemein_geenergy2.postUpdate(verbrauch)
end

Immediately after posting I found the solution and replaced int with float.

val String filename = "shellyverbrauch.rules"
rule "Watt pro Minute in kWh"
when
	Item szi_allgemein_geenergy received update
then
	var float verbrauch = (szi_allgemein_geenergy.state as Number).floatValue / 60
	verbrauch = verbrauch / 1000
	szi_allgemein_geenergy2.postUpdate(verbrauch)
end