Debugging Rules Not Running

Good morning all

I’m having problems getting Openhab to run correctly and am looking for some help debugging why my rules don’t fire.

I have a collection of rules files, some rules fire when based of zwave items others on hue lights and some from items changed through the REST API.

The only rules that run are those triggered by a cron string. I’ve put tried setting rules logging to TRACE but nothing is printed on the logs. I can see from the events log and the events log that item States are changing but Openhab just isn’t triggering the associated rule. I’ve also tried a fresh install of OpenHabian but with no change.

Does anyone have any suggestions what I can do next to debug this problem? If required I can provide a link to the git repository for my config files, but since the problem exists accross all my rules files I’m not sure what’s of use too share just now.

  • Platform information:
    • Hardware: Raspberry Pi 3
    • OS: OpenHabian 1.4
    • Java Runtime Environment: java version "1.8.0_161"
      Java™ SE Runtime Environment (build 1.8.0_161-b12)
      Java HotSpot™ Client VM (build 25.161-b12, mixed mode)
    • openHAB version: 2.2.0-1

Maybe post an example of a rule that isn’t firing. It could be an issue with the rule itself…

Here is an example rule file that’s supposed to trigger my morning alarms and determine when we’re going to bed.

CalDav items are changed by the caldav binding.

The only two rules in this file that run are the last two, both triggered by cron strings

Here is a single rule that’s supposed to set the house an occupied state.

rule "Stuart's Come Home"
when
    Item Shadow_Stuart_State changed from 0 to 4
    or
    Item Shadow_Stuart_State changed from 3 to 4
then
    logInfo("PresenceCheck", "Stuart's Come Home")

    if( Shadow_Kareen_State.state !== NULL && (Shadow_Kareen_State.state as DecimalType).intValue >= 4 ) {
        sendCommand(Shadow_Family_State, 6)
    } else {
        sendCommand(Shadow_Family_State, 5)
    }

    if( Device_PC_TaiChi_Ping.state == ON ) {
        sendCommand(Socket_FF_Study_PC_Monitors, ON)
    }

    sendCommand(Shadow_Stuart_GEO_Home, ON)
    sendCommand(Device_PC_TaiChi_InUse, OFF)
end

I can see from the events log that Shadow_Stuart_State was correctly changed from 0 to 4, however Shadow_Family_State is never updated and the logInfo command has no effect

2018-01-25 15:45:10.607 [ome.event.ItemCommandEvent] - Item 'Shadow_Stuart_State' received command 4
2018-01-25 15:45:10.616 [vent.ItemStateChangedEvent] - Shadow_Stuart_State changed from 0 to 4

Just as quick update. On Friday night I went through all my rules files and split the 8 files into 26 others. I didnt change anything, just reorganised the rules into more sensible categories and copied accross each rule as was.

Everything started working as expected until last night when the again the only rules to trigger were cron based ones.

I’m still no further forward to resolving this problem.