Rules stopped working after upgrading to OH3

rule “Heating Governor”
when
Item Heating_Monitoring_Temp changed or
Item Heating_Temp changed
then
var Number house_heat = (Heating_Monitoring_Temp.state as Number)
var Number heat_setpoint = (Heating_Temp.state as Number)
val Number offset = 0.4
if (house_heat >= (heat_setpoint + offset)) {
ZWaveNode016SSR302TwoChannelBoilerActuator_Switch.sendCommand(OFF)
} else if (house_heat < (heat_setpoint - offset)) {
ZWaveNode016SSR302TwoChannelBoilerActuator_Switch.sendCommand(ON)
}
end

My version of boiler on off depending on temp
Curious Why do you have

FloorThermostatSTP.state as DecimalType

And then

FloorThermostatSTP.state as Number

My version of boiler on off depending on temp

@garyfree You are right, triggering on temperature and setpoint change would result less execution. I will modify my rule

Curious Why do you have
FloorThermostatSTP.state as DecimalType
And then
FloorThermostatSTP.state as Number

Thanks for pointing out, this was unintentional… Casting to Number should be the right one here.

I had the same issue as the OP. When I moved to OH 3.0.1, my rules worked if I used the config files. When I moved them to the Main UI they stopped working. I could trigger them manually, but the timed events did not trigger. They are only simple rules to turn on/off lights at certain times.
Interestingly, when I upgraded to OH 3.1, the rules started working properly. But, unfortunately, the upgrade broke other things, like MyOpenhab. I’m still working on that one.

Make sure you are running the correct version of Java.
My rules did not want to run on Java 16. Also no logging…
All got fixed when I went down to Java 11.

1 Like

Thank you @faf :grinning: This was the problem! My openHAB 3 ran on Java 17 without any obvious issues, execept that the rules just didn’t work anymore. There were no errors in the logs. With Java 11 the rules are back :+1:

For Ubuntu/Linux users: I posted instructions on how to configure the Java version for openHAB running as systemd-based service here. Just replace openhab2 with openhab and zulu8 with zulu11.