Skip to content

DSL rule in file with name tmp_* not loaded (OH 5.*) #5134

@michalsrb

Description

@michalsrb

This issue started after upgrading from 4.3.3 to 5.0.2. I further upgraded to 5.1.0~M2 and it is still happening.

I have a simple rule in /etc/openhab/rules/tmp_pantry_light.rules:

rule "Temporary Pantry Light"
when
    Item Pantry_Door_Contact changed
then
    if (Pantry_Door_Contact.state == OPEN) {
        Pantry_CeilingLight.sendCommand(ON)
        Pantry_ShelfLight.sendCommand(ON)
    } else {
        Pantry_CeilingLight.sendCommand(OFF)
        Pantry_ShelfLight.sendCommand(OFF)
    }
end

When I restart openhab (e.g. systemctl restart openhab), I can see in log that the rule is loaded:

2025-11-19 09:40:54.695 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'tmp_pantry_light.rules'

There are no warnings or errors around. But the rule does not appear on the /settings/rules/ page and it isn't working. Some other rules defined in /etc/openhab/rules/ are present and working.

If I make any change to the file, like add an empty line and save, the rule is reloaded:

2025-11-19 09:46:29.227 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'tmp_pantry_light.rules'

And now it is present on the /settings/rules/ page and works.

I can reproduce it easily, it happens after every restart.

Your Environment

  • openSUSE Leap 15.6
  • openhab 5.1.0~M2 installed from the official openhab.jfrog.io respository
  • openjdk 21.0.9 2025-10-21
    OpenJDK Runtime Environment (build 21.0.9+10-suse-1500-x8664)
    OpenJDK 64-Bit Server VM (build 21.0.9+10-suse-1500-x8664, mixed mode, sharing)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn unexpected problem or unintended behavior of the Core

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions