I have recently upgraded from OH 2.5 to 3.0. My rules stopped working.
I don’t receive any related error messages from the RuleStatusInfoEvent Logger on any levels.
I created a trivial test rules file to update some items, but this does not take effect on the items either.
Could you please help me with some ideas what should I investigate further? Thanks!
Update: I copied the rule definitions to new rules files, after this the rules appeared on the UI and they are executable and doing their job. So the issue is that neither the system started, neither the time based rules are executed by the system. Any suggestions welcomed.
I have rules that should run every minute. These rules are not firing since the upgrade. But if I trigger them from the UI, then they are running fine. What could go wrong with the execution of time based rules?
Here is one of the rules below… (I created a trivial one as well, which does not fire automatically either)
rule "FloorHeating"
when
Time cron "0 * * * * ?"
then
if (TemperatureFloor.state < ((FloorThermostatSTP.state as DecimalType)-0.2 ) ) {
if (FloorHeater.state == OFF) {
FloorHeater.sendCommand(ON)
postUpdate(Heating_Cooling_Mode,"Heating")
}
}
else if ((TemperatureFloor.state) > ((FloorThermostatSTP.state as Number)+0.2) ) {
if (FloorHeater.state == ON) {
FloorHeater.sendCommand(OFF)
postUpdate(Heating_Cooling_Mode,"Off")
}
}
end
Hi, The problem is not with the code. As I wrote, the rule is executing properly if I trigger it manually from UI. The problem is that the rule is not triggered every minute, it isn’t not executed by the system.
Ok, I created a trivial rule, @schossel… You will love this, but it unfortunately reassures my problem. @spy0r Thanks for the suggestion, I fight for this a bit more and I will do a clean one.
rule "Testrule"
when
Time cron "0 * * * * ?"
then
var Number NewCounter=(TestCounter.state as Number)+1
TestCounter.postUpdate(NewCounter)
logInfo("logThermostat","TestCounter incremented {}", NewCounter)
end
Which should show in the log every minute would have done the trick and the less complicated the better. It is just for testing.
You didn’t even post a conclusion of your test. You just wrote your code.
I wrote this reassures the problem. The rule is running on manual trigger and incrementing the test item and put the message into the log. But it does not run every minute.
Check your system time. I have the time displaying on my sitemap and it is way off. I have been having a heck of a time fixing it. I have edited my locale, time zone, etc. The 3.0 system is so different that I’m having a hard time finding things.
I purged openhab and re-installed and restored the previous configuration.
Unfortunately the rules still not executed…
Checked system time, that is sharp.
The solution for the problem was to rebuild OH3 from scratch. I wiped the OS, reinstalled Openhabian and OH3. I did not restore the Openhab backup to avoid migrating potential database issues. I installed the necessary addons, bindings, transformation manually from UI, then deployed the config files to restore my config. Rules worked fine after this. This was much less of a work than I expected.