Nur zur Sicherheit: die Initialisierung der Variabel steht ganz oben vor allen Rules in der Datei??
In der ersten Zeile.
Habe die Rule umgenannt in testChristmas, zur besserenunterscheidung im Log.
Hier nochmal die Rule mit dem Eintrag von Peter-Pan:
Code: Alles auswählen
root@openhab3:/home/master# cat /etc/openhab/rules/testChristmas.rules
var int intStAdvent
rule "Feiertage" when
Time cron "5 0 0 * * ?" or
System started
then
intStAdvent = LocalDate.now.withMonth(12).withDayOfMonth(25).getDayOfYear - (now.withMonth(12).withDayOfMonth(25).getDayOfWeek.getValue +27)
// intStAdvent = parse(now.getYear + "-12-25").minusDays(((parse(now.getYear + "-12-25").getDayOfWeek) + 28)).getDayOfYear + 1 // Montag vor 1. Advent
end
rule "Weihnachtslicht ein"
when
Time cron "0/20 * * * * ?"
then
if (now.getDayOfYear < 7 || now.getDayOfYear > intStAdvent) {
logDebug("x-mas","Weihnachtsbeleuchtung ein.")
logInfo("x-mas","intStAdvent ist: {}", intStAdvent)
delock05.sendCommand(ON)
}
end
rule "Weihnachtslicht aus"
when
Time cron "10/20 * * * * ?"
then
if (now.getDayOfYear < 7 || now.getDayOfYear > intStAdvent) {
logDebug("x-mas","Weihnachtsbeleuchtung aus.")
logInfo("x-mas","intStAdvent ist: {}", intStAdvent)
delock05.sendCommand(OFF)
}
end
Hier der Log:
Code: Alles auswählen
2021-12-02 11:11:00.288 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'testChristmas-2' failed: An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.IntegerExtensions.operator_greaterThan(int,int) on instance: null in testChristmas
2021-12-02 11:11:10.290 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'testChristmas-3' failed: An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.IntegerExtensions.operator_greaterThan(int,int) on instance: null in testChristmas
2021-12-02 11:11:20.289 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'testChristmas-2' failed: An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.IntegerExtensions.operator_greaterThan(int,int) on instance: null in testChristmas
2021-12-02 11:11:30.290 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'testChristmas-3' failed: An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.IntegerExtensions.operator_greaterThan(int,int) on instance: null in testChristmas
2021-12-02 11:11:40.289 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'testChristmas-2' failed: An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.IntegerExtensions.operator_greaterThan(int,int) on instance: null in testChristmas
Das event.log ist leer.
Kompletter Neustart btrachte auch nichts.
Werde mal das Backup von gestern oder das 2.5.12er Backup rüberbügeln, aber erst heute Abend, muss gleich zur Schicht.