ich hoffe jemand von euch kann mir hefen. Ich bin heute von OH3 auf OH4 umgestiegen. Ich habe dazu das openhabian Image genutzt und dann ein Restore von den OH3 - Daten durchgeführt.
Soweit hat alles geklappt, allerdings funktionieren die Skripte nicht mehr, die den Befehl ScriptExecution nutzen.
Ich bekomme die Fehlermeldung:
Script execution of rule with UID 'Rollo_Lichtsensor_Down_Osten' failed: org.graalvm.polyglot.PolyglotException: ReferenceError: "scriptExtension" is not defined
Code: Alles auswählen
var scriptExecution = Java.type('org.openhab.core.model.script.actions.ScriptExecution');
var zdt = Java.type('java.time.ZonedDateTime');
var logger = Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' + ctx.ruleUID);
if (typeof this.timers === 'undefined') {
this.timers = [];
}
if (typeof this.timers['Bad'] === 'undefined' || this.timers['Bad'].hasTerminated()) {
this.timers['Bad'] = scriptExecution.createTimer(zdt.now().plusSeconds(5), function () {
events.sendCommand('RolloOGBadezimmer_Level', 'DOWN');
})
}
if (typeof this.timers['Kleiderschrank'] === 'undefined' || this.timers['Kleiderschrank'].hasTerminated()) {
this.timers['Kleiderschrank'] = scriptExecution.createTimer(zdt.now().plusSeconds(15), function () {
events.sendCommand('RolloOGSchlafzimmerKleiderschrank_Level', 'DOWN');
})
}
if (typeof this.timers['Garage'] === 'undefined' || this.timers['Garage'].hasTerminated()) {
this.timers['Garage'] = scriptExecution.createTimer(zdt.now().plusSeconds(20), function () {
events.sendCommand('RolloOGSchlafzimmerGarage_Level', 'DOWN');
})
}
if (typeof this.timers['Balkon'] === 'undefined' || this.timers['Balkon'].hasTerminated()) {
this.timers['Balkon'] = scriptExecution.createTimer(zdt.now().plusSeconds(23), function () {
events.sendCommand('RolloOGSchlafzimmerBalkontur_Level', '32');
})
}