openhab-core: OH5 Snapshots - Rules reporting error

Expected Behavior

Rule runs to completion as it does with OH4.3.5

Current Behavior

After updating to OH5 M2 or latest snapshots, I get the following: 2025-05-15 18:53:44.111 [ERROR] [e.automation.internal.RuleEngineImpl] - Failed to execute rule 'af4c760780': Failed to execute action: 7(Cannot invoke "com.google.inject.Injector.getInstance(java.lang.Class)" because the return value of "org.openhab.core.model.script.ScriptStandaloneSetup.getInjector()" is null) Action: 7 contains: `actions:

  • inputs: {} id: “7” configuration: type: application/vnd.openhab.dsl.rule script: > var Number requiredSolar = ((TeslaPowerwall_InstanteousHomePower.state as Number)+(1 - (TeslaPowerwall_BatterySOE.state as Number))20000)/5000100;

    if (requiredSolar > 100) requiredSolar = 100;
    
    if (EVChargingGroup.state == ON) requiredSolar = 100;
    
    if (NegativeFIT.state == OFF) requiredSolar = 100;
    
    if (NegativeGrid.state == ON) requiredSolar = 1;
    
    logInfo("curtailSolar", "required solar percent = {}, Current Inverter
    limit = {}", requiredSolar.intValue,
    SolarEdge__Modbus_Data__Active_Power_Limit__61441_Value_as_Number.state);
    
    
    if
    ((SolarEdge__Modbus_Data__Active_Power_Limit__61441_Value_as_Number.state
    as Number) != requiredSolar.intValue) {
        SolarEdge__Modbus_Data__Advanced_Power_Enable__61762_Value_as_Number.sendCommand(1);
        if ((TeslaPowerwall_BatterySOE.state as Number) > 0.97) {
          logInfo("curtailSolar", "current PW2 charge ({}) > 97%, curtail output",(TeslaPowerwall_BatterySOE.state));
          SolarEdge__Modbus_Data__Active_Power_Limit__61441_Value_as_Number.sendCommand(requiredSolar.intValue);
          DaikinAirbaseACUnit_Zone4.sendCommand(ON);
        } else {
          logInfo("curtailSolar", "current PW2 charge ({}) < 97%, set full rate production",(TeslaPowerwall_BatterySOE.state));
          SolarEdge__Modbus_Data__Active_Power_Limit__61441_Value_as_Number.sendCommand(100);
        }
        SolarEdge__Modbus_Data__Commit_Power_Control__61696_Value_as_Number.sendCommand(1);
    } else {
        logInfo("curtailSolar", "required solar matches current inverter limit, no change required.");
    }
    

    type: script.ScriptAction ` From what I’ve seen - any rules with scriptactions with rulesdsl are impacted.

Possible Solution

Rollback to 4.3.5

Steps to Reproduce (for Bugs)

See above

Context

Trying to test OH 5.0

Your Environment

  • OH 5.0 snapshot build 4644

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 31 (27 by maintainers)

Most upvoted comments

But, there have been done some things related to Action in 5.0, some Actions are now available from MainUI. Could there be something in those changes?

It was introduced in OH 4.3, not OH 5.

At least we can advice a workaround, updating and saving the failing rule.

It’s still not clear to me if that is a permanent fix. I find it peculiar if it is.

Yes, me too. And that is true that I got no answer to my question whether the workaround survived to a OH restart.