Daily consumption rule problem

Dear Comunity,

i am trying to get a rule that calculates my daily comsumption :

rule "Meter Daily Consumption "
 
when
Item HousePower_HouseTotalEnergy received update
then
Daily_Consumption.postUpdate(HousePower_HouseTotalEnergy.deltaSince(ZonedDateTime.now().with(LocalTime.MIDNIGHT)))

end

and i get the following error and have no idea why :


16:42:55.872 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID 'ElectricityMeter-1' failed: The argument 'state' must not be null. in ElectricityMeter

the item HousePower_HouseTotalEnergy is persisted like this :

HousePower_HouseTotalEnergy							:   strategy = everyUpdate, restoreOnStartup

Can anyone give a hint what i’m doing wrong ?

HousePower_HouseTotalEnergy.deltaSince(ZonedDateTime.now().with(LocalTime.MIDNIGHT)) returned null.

Are you using more than one persistence addon? What’s the default? Have you checked whether the data gets persisted?