OH4.1.x Rules not firing (or firing intermittently)

  • Platform information:
    • Hardware:
      Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 06)
      VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
      USB controller: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller
      Signal processing controller: Intel Corporation 200 Series PCH Thermal Subsystem
      Communication controller: Intel Corporation 200 Series PCH CSME HECI #1
      SATA controller: Intel Corporation 200 Series PCH SATA controller [AHCI mode]
      PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #21 (rev f0)
      ISA bridge: Intel Corporation 200 Series PCH LPC Controller (B250)
      Memory controller: Intel Corporation 200 Series/Z370 Chipset Family Power Management Controller
      Audio device: Intel Corporation 200 Series PCH HD Audio
      SMBus: Intel Corporation 200 Series/Z370 Chipset Family SMBus Controller
      Ethernet controller: Intel Corporation Ethernet Connection (2) I219-V
      Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961/SM963
    • OS:
      Ubuntu Jammy LTS 22.04
    • Java Runtime Environment:
      openjdk 17.0.9 2023-10-17
      OpenJDK Runtime Environment (build 17.0.9+9-Ubuntu-122.04)
      OpenJDK 64-Bit Server VM (build 17.0.9+9-Ubuntu-122.04, mixed mode, sharing)
    • openHAB version:
      4.1.1
  • Issue of the topic:
    Since ‘upgrading’ to the latest version I have rules that have run for years not firing. I’ve tried ‘re initialising’ the rules by doing a simple change and then saving but nothing works. I have rules that refuse to run at given times or rules that will run ‘on occasion’ (intermittent at best).
  • Please post configurations (if applicable):
    here’s and example of a typical rule that won’t run (on time). it runs manually as they’ve been tested.
configuration: {}
triggers:
  - id: "1"
    configuration:
      time: 08:55
    type: timer.TimeOfDayTrigger
conditions:
  - inputs: {}
    id: "3"
    configuration:
      offset: 0
    type: ephemeris.WeekdayCondition
  - inputs: {}
    id: "2"
    configuration:
      offset: 0
    type: ephemeris.NotHolidayCondition
actions:
  - inputs: {}
    id: "4"
    configuration:
      itemName: OfficePrinter_Command
      command: ON
    type: core.ItemCommandAction

If you run the rule manually, what does the log say?
Do none of your rules run or just a few? If just a few, can you see what those rules have in common (same trigger)?
Is your NTP client getting the correct date and time?

Hi Oliver
date and time are correct.
log output? is this what you’re looking for?

2024-02-16 14:40:43.160 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'OfficePrinter_Command' received command ON
2024-02-16 14:40:43.160 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'OfficePrinter_Command' predicted to become ON
2024-02-16 14:40:43.161 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'OfficePrinter_Command' updated to ON

Yes. At least the rule action works but does not get triggered.
I tested scheduled rules and they are working just fine.

Did you configure ephemeris in the settings?
Could you schedule a rule one minute ahead of now and see if there are any log errors?

So I waited for the printer in the listed rule to turn off, as it should turn off at 3PM (weekdays)

2024-02-16 15:00:00.625 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'OfficePrinter_Command' received command OFF
2024-02-16 15:00:00.626 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'OfficePrinter_Command' predicted to become OFF
2024-02-16 15:00:00.626 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'OfficePrinter_Command' updated to OFF
2024-02-16 15:00:00.626 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'OfficePrinter_Command' changed from ON to OFF
2024-02-16 15:00:00.630 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'OfficePrinter_Command' updated to OFF

The output listed here shows the rule ran and the state of the printer was switched to ‘off’. But the printer did not turn off. I’m sitting next to it. I ran the rule manually and the printer turned off. I can turn the printer on and off by voice, through HomeKit (Home App), from OpenHAB, from the rule itself (manually) and it works.

Just to be sure:

  • the rule is triggered at the scheduled time
  • the log shows item state has changed from ON to OFF
  • but the printer does not get switched OFF
  • whereas if you trigger the rule manually the printer gets switched OFF?

That’s odd.
We need to wait for second level support :slight_smile:

did you enable auto-update?
Maybe disable it for the moment

One thing is suspicous: in the above log there are two UpdatedEvents:

openhab.event.ItemStateUpdatedEvent ] - Item 'OfficePrinter_Command' updated to OFF

compared to a regular command of a switch item they do not appear on my side.
could you post also your item definition?

could you post also your item definition?

Not sure I understand, Oliver. You have the rule. Do you mean the switch? Or the ‘thing’?

UID: deconz:onofflight:00212E06E67B:00124b0022fe335b01
label: Printer (eWeLink)
thingTypeUID: deconz:onofflight
configuration:
  lastSeenPolling: 1440
  id: "50"
bridgeUID: deconz:deconz:00212E06E67B
channels:
  - id: ontime
    channelTypeUID: deconz:ontime
    label: On Time
    description: Time that the light stays on before switched off automatically (0=forever)
    configuration: {}
  - id: switch
    channelTypeUID: system:power
    label: Power
    description: Device is operable when channel has state ON
    configuration: {}
  - id: last_seen
    channelTypeUID: deconz:last_seen
    label: Last Seen
    description: The date and time when the sensor was last seen.
    configuration: {}

a manual run:

2024-02-16 16:38:24.465 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'OfficePrinter_Command' received command ON
2024-02-16 16:38:24.466 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'OfficePrinter_Command' predicted to become ON
2024-02-16 16:38:24.466 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'OfficePrinter_Command' updated to ON
2024-02-16 16:38:24.466 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'OfficePrinter_Command' changed from OFF to ON
2024-02-16 16:38:24.469 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'OfficePrinter_Command' updated to ON

Note the malformation in the entry:
2024-02-16 16:38:24.466 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘OfficePrinter_Command’ predicted to become ON

That doesn’t look favourable. It’s appearing in all instances I’ve posted so far.

Yes. I assume you are adding items by GUI and they are not file based, correct?
In this case goto settings - items
search for OfficePrinter_Command
edit
post the content of code tab

label: Printer
type: Switch
category: poweroutlet_uk
groupNames:
  - Office
tags:
  - Point

And I assume that the item is properly linked to the channel (otherwise it would not work when rule is triggered manually) like this?

Sorry, I am out of ideas. Let’s wait for our experts here.