Moved from OH to OH2, Rules Triggers not working

Hello there,

a while ago i made the step from Oh1 to 2, but since then my rules arent working as they should anymore.

First of all, right after a reboot of oh2, the rules work for 1-3 hours. After that time they simply dont trigger anymore.

I got different triggers, none of them is working.

Here are some examples:

rule "Jalousien_Hoch_Schalter"
when
    Item Jalousien_Hoch changed
then
  logError("Test", "Jalousien Hoch triggered")

rule "Fensterwarnung"
when
 Item Fenster_Bad changed
then
  logError("Test", "Fensterwarung triggered!")
rule "Automation hoch"
when

Time cron "0 0,30 10,11,12 * * ?"

then
  logError("Test", "Automation Hoch triggered!")

So neither Cron, nor changed rules seem to trigger anymore after a while. None of the Logerrors appear anymore…

Is there any option i could check the rule interpreter, if there is something blocking him or what he is doing right now?

I also went to disable almost all of my rules, to be sure that none of them is causing something like a loop, which might block the rule trigger…Still not working…

Do you have any idea how i might get closer to a solution of my problem?

Thank you very much

Steffen

I don’t know if you did this intentionally, but none of the rule examples has an “end”…

rule "blabla"
when 
    Item something changed
then
    logError('Test','testing 1234')
end  // <-- this

Probably related, probably not, but I noticed that when moving from AH1 to OH2.0 to OH2.1, the syntax checking became gradually more strict. I had several rules working, and after an update not anymore. I did however found out that all the time, looking at the logs gave me a pretty good clue on the error. I typically did this:

  • Open a karaf console, and do a “log:tail”
  • In another terminal, for each rule-file, “touch” it, or save a modified version (it helps if you have multiple rules files, each with only few rules)
  • If there is a problem, the logs always gave me a pretty good clue on what was the problem (so not when actually running the rule, but when making/changing the rule)
  • Fix it, and right after saving your changes, check again for errors. When the logs did not show errors anymore, my rules worked again. Typical problems I found in this way were often related to forgotten closing quotes, brackets, etc. Apparently older versions of OH did not care too much about correct syntax, newer versions do.

I recommend using the designer

1 Like

Hey there,

thank you for your help.

I will try checking my rules with the designer soon.

@lfs_alp5 - I didnt post the whole rule, they normally have a clean end. Just didnt want to post too much useless information. Basically those rules just set different values to my shutters.

@PeterJ I tried that and its quite interesting. My rules dont give any errors (except for one crying about the wildcard imports). But the confusing point is, that the log error is freezing after 1-2 checks in putty. Maybe there is some issue with my system, breaking openhab for a short time.

The system i am running it on is quite potent for that usage, thats why i also have some other services running on it too, are there any known services that make issues with openhab?

Thank you for your assistance, really would hope to have it working as the first version did soon.

Bye