running OH 4.2.0-release on openHABian since upgrade from 4.1.2.
- value of the item
EMS_Ueberschuss
is “-2542.211483294 W” presently - default persistence is RRD4j and is filled (see pic)
The following JSScripting worked flawlessly:
var interval10min = time.ZonedDateTime.now().minusMinutes(10);
var ueberschussAVG = Number.parseFloat(items.getItem("EMS_Ueberschuss").history.averageSince(interval10min));
now I changed it to:
var interval10min = time.ZonedDateTime.now().minusMinutes(10);
var ueberschussAVG = Number.parseFloat(items.getItem("EMS_Ueberschuss").averageSince(interval10min));
but still in the logs:
2024-07-18 15:58:30.401 [ERROR] [mation.script.javascript.EmsBatLogic] - Failed to execute script: TypeError: (intermediate value).getItem(...).averageSince is not a function
at <js>.:program(<eval>:21)
at org.graalvm.polyglot.Context.eval(Context.java:399)
at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:458)
at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:426)
at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:262)
... 21 more
2024-07-18 15:58:30.402 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'EmsBatLogic' failed: org.graalvm.polyglot.PolyglotException: TypeError: (intermediate value).getItem(...).averageSince is not a function
What did I miss while upgrading to 4.2.0?