Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reloading of rules files doesn't work properly in openHAB 4.3.1 #4529

Open
miloit opened this issue Dec 31, 2024 · 0 comments
Open

Reloading of rules files doesn't work properly in openHAB 4.3.1 #4529

miloit opened this issue Dec 31, 2024 · 0 comments
Labels
bug An unexpected problem or unintended behavior of the Core

Comments

@miloit
Copy link

miloit commented Dec 31, 2024

Problem:
In openHAB 4.3.1, the reload of rules files does not function as expected. After making changes to the rules file, the system does not seem to reload the file correctly. The behavior can be observed when updating rule logic, such as changing item states or triggering certain conditions. The expected rule behavior does not occur unless the system is manually restarted or the rule files are reloaded multiple times.

Steps to reproduce:

Update or modify the rule file (e.g., changing triggers or actions).
Reload the rule file via the openHAB UI or CLI.
Observe that the rule file does not reload properly or the rule does not trigger as expected when conditions are met.
Expected behavior:
The rule file should reload successfully and execute the logic whenever the specified triggers or conditions are met, without requiring manual intervention like restarting the system.

Actual behavior:
The rule file does not reload automatically, and the modified rules do not seem to take effect until after a manual restart.

openHAB version:
4.3.1

Rule and Item Example:

seeing in the main.gui

// Example Rule Logic

// Triggers:
// - When item switch_LG_TV_Power changed
// - When item switch_systeminit changed from OFF to ON

// context: network-5
try {
    if (swith_LG_TV_Power == NULL && swith_LG_TV_Power == UNDEF) {
        logError("set switch_tvlivingroom_presence", "swith_LG_TV_Power NULL/UNDEF")
    } else {
        switch_tvlivingroom_presence.sendCommand(swith_LG_TV_Power.state.toString)
        logInfo("set switch_tvlivingroom_presence", switch_tvlivingroom_presence.state.toString())
    }
} catch (Throwable T) {
    logError("Error", "Some bad stuff happened in \"set switch_tvlivingroom_presence\": " + T.toString)
    if (switch_tvlivingroom_presence != NULL && switch_tvlivingroom_presence != UNDEF) {
        switch_tvlivingroom_presence.sendCommand(OFF)
    }
} finally {
    // No operation
}

in the file:

    Item Switch_GF_Livingroom_TVPower changed or Item switch_systeminit changed from OFF to ON
then
    try {
        if (Switch_GF_Livingroom_TVPower == NULL && Switch_GF_Livingroom_TVPower == UNDEF) {
            logError("set switch_tvlivingroom_presence", "Switch_GF_Livingroom_TVPower NULL/UNDEF")
        } else {
            switch_tvlivingroom_presence.sendCommand(Switch_GF_Livingroom_TVPower.state.toString)
            logInfo("set switch_tvlivingroom_presence", switch_tvlivingroom_presence.state.toString())
        }
    } catch (Throwable T) {
        logError("Error", "Some bad stuff happened in \"set switch_tvlivingroom_presence\": " + T.toString)
        if (switch_tvlivingroom_presence != NULL && switch_tvlivingroom_presence != UNDEF) {
            switch_tvlivingroom_presence.sendCommand(OFF)
        }
    }
    finally {
        // No operation
    }
end```
@miloit miloit added the bug An unexpected problem or unintended behavior of the Core label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

No branches or pull requests

1 participant