No. The only way this would work would be to only sum the value at midnight just before it resets to zero. You could do this in a Rule.
when
Item DailyKWH changed
then
if(DailyKWH.state == 0) {
// code to deal with change of the month
MonthlyKWH.postUpdate(MonthlyKWH.state + previousState)
}
end
How is this item updated in the first place. I would think that those daily values are summed up already, can’t you use the same technique for a month
.
var Number nHausTag = (PV_Tag.state as DecimalType) - (D0_Abgabe_Tag.state as DecimalType) - (LG_Resus_Charge_Day.state as DecimalType)
+ (D0_Bezug_Tag.state as DecimalType) + (LG_Resus_Discharge_Day.state as DecimalType) // Hausverbrauch Tag
It is possible to get all these items per month as well…was just thinking/trying to do something in the most effiicient and easiest way. And for sure to learn But I already expected that my first idea does not work. So I will follow the way to have the value for every item per month and then do the calculations.