Hello, please explain me the use of variables in rule. has anything changed due to an update?
In the past the rule work fine, but not anymore.
var Boden = (HmIPWKlima04_ActualTemperature.state as QuantityType<Number>).doubleValue
var Decke = (HmIPHeater09_ActualTemperature.state as QuantityType<Number>).doubleValue
if ((Boden != NULL) && (Decke != NULL)) {
VI_Heating_Buero_IST.postUpdate(((Boden) + (Decke)) / 2)
} else {
VI_Heating_Buero_IST.postUpdate(0)
Without the if else statement it work.
var Boden = (HmIPWKlima04_ActualTemperature.state as QuantityType<Number>).doubleValue
var Decke = (HmIPHeater09_ActualTemperature.state as QuantityType<Number>).doubleValue
VI_Heating_Buero_IST.postUpdate(((Boden) + (Decke)) / 2)
These will never be state NULL because you’ve already got the .doubleValue. If they were NULL, the rule would fail at that point first.
You probably want to check before getting the state.
So you’ll be wanting to check for NULL states before trying to turn them into numbers.
Well, without you telling us what “doesn’t work” means, it is difficult to say. Nothing has changed about openHAB in this area. Maybe your variables haven’t been NULL for months.
The old rule would not have posted any updates if either Item were NULL state, because it would fail. Maybe you didn’t look for errors before.