Open quensen opened 2 weeks ago
averageSince now returns a QuantityType for Items that have a dimension. This is listed in the breaking changes. In your rule it causes a subtraction of a QuantityType (result of the subtraction in brackets) from a DecimalType (you defined sollflur as a Number). You should not convert sollflur or indeed, define the two others as a Number to stay consistent in your rule. So I don’t think this is a bug.
The minus operator (-) for subtraction does not work in rules in some cases since I updated from 4.1.3 to 4.2.0 Release Build.
Expected Behavior
The following code was working in 4.1.3:
Current Behavior
After I updated to 4.2.0, I am getting this error:
2024-07-08 14:13:57.877 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'main-40' failed: Unknown variable or command '-'; line 1543, column 30, length 18 in main
Possible Solution
My quick-fix was to add type Number to the variables:
But that does not solve the original issue.
Steps to Reproduce (for Bugs)
Put the lines above in a text file rule and save it as test.rules in the rules folder in your config folder. Watch the log file.
Context
I was trying to perfom the subtraction to calculate a derived value.
Your Environment