Energy rule

If you don’t have enough data in your persistence service, then openHab can obviously not calculate the difference… (as you can’t either :wink: )

If you have measured values since 7 days, then you should have values today for the weekly value. For month and year you can’t get a value until you have values for a month / for a year… But the weekly value should be correct… Maybe you can Chart the original value to see how this value changed the last 7 days…

For the monthly/yearly values you can do a work-around:
compare the updated values if they are ‘-’ or undefined and then you can do a Approximation with the weekly value:
BilVarmeManed.postUpdate( (BilVarmeUke.state as Number) / 7 * 30 )
BilVarmeAr.postUpdate( (BilVarmeUke.state as Number) / 7 * 365 )

With this workaround you can extrapolate the values which can’t be calculated because of missing historical values from your actual weekly values…
From the time you have enough historical values, the accurate values are used…

1 Like