nach etwas Abstinenz habe ich dann mal wieder mein OH auf die Version 4.3.2 aktualisiert und die Änderung bei Zeit/Datum in Rules direkt über die Suche hier im Forum lösen können

Scheinbar gab es auch Änderungen bei Ephemeris, da diese nun einen Fehler produziert und die entsprechende Rule nicht mehr funktioniert.
Im Detail geht es um die Funktion FixedWeekdayRelativeToFixed, welche unter OH 4.2.x noch (bis auf die Übersetzung) funktionierte
Fehlermeldung
Nachdem ich in meinen Tests diverse Änderungen ausprobiert habe, läuft die Rule mit den angemeckerten specialdays.xml ohne Probleme, wenn ich meine Einträge zu FixedWeekdayRelativeToFixed entferne.[ERROR] [l.handler.AbstractScriptModuleHandler] - Script execution of rule with UID 'a_startup-2' failed: Cannot instantiate configuration from URL 'file:/etc/openhab/services/specialdays.xml'. in a_startup
Meine Rules
Code: Alles auswählen
rule Feiertage
when
Time cron "5 0 0 * * ?" or
Item vSystemRestart changed to ON or
System started
then
val String strHoliday = '/etc/openhab/services/holidays_de.xml'
val String strSpecialday = '/etc/openhab/services/specialdays.xml'
val dtDate = new DateTimeType().getZonedDateTime(ZoneId.systemDefault()).plusDays(0)
var String strToday = "regular"
if (Ephemeris.isBankHoliday(dtDate, strHoliday)) {
strToday = Ephemeris.getHolidayDescription(Ephemeris.getBankHolidayName(dtDate, strHoliday))
Holiday.postUpdate(ON)
} else {
Holiday.postUpdate(OFF)
if (Ephemeris.isBankHoliday(dtDate, strSpecialday))
strToday = Ephemeris.getBankHolidayName(dtDate, strSpecialday)
}
TodayIs.postUpdate(strToday)
val nextHoliDay = getNextBankHoliday(strHoliday)
val nextHoliDayDe = getHolidayDescription(getNextBankHoliday(strHoliday))
val nextHoliDayDays = getDaysUntil(nextHoliDay, strHoliday)
logInfo("Ephemeris", "Heute ist: {}", strToday)
logInfo("Ephemeris", "Feiertag: {}", Holiday.state.toString)
logInfo("Ephemeris","Nächster Feiertag: {} in {} Tagen ({})", nextHoliDayDe, nextHoliDayDays, now.plusDays(nextHoliDayDays).toLocalDate)
end
Code: Alles auswählen
<?xml version="1.0" encoding="UTF-8"?>
<tns:Configuration hierarchy="de" description="Germany" xmlns:tns="http://www.example.org/Holiday"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.example.org/Holiday /Holiday.xsd">
<tns:Holidays>
<tns:ChristianHoliday type="CARNIVAL"/> <!-- dayOfYear==easterSunday.getDayOfYear-48 -->
<tns:ChristianHoliday type="MAUNDY_THURSDAY"/> <!-- dayOfYear==easterSunday.getDayOfYear-3 -->
<tns:Fixed day="29" month="JUNE" descriptionPropertiesKey="ST_PETER_PAUL"/>
<!-- dayOfYear==stAdvent.getDayOfYear-14 // "remembrance_day" // Volkstrauertag -->
<!-- dayOfYear==stAdvent.getDayOfYear-7 // "sunday_in_commemoration_of_the_dead" // Totensonntag -->
<tns:Fixed day="04" month="DECEMBER" descriptionPropertiesKey="ST_BARBARAS_DAY"/> <!-- Barbara Tag -->
<tns:Fixed day="06" month="DECEMBER" descriptionPropertiesKey="ST_NICHOLAS"/> <!-- Nicolaus Tag -->
<tns:FixedWeekdayRelativeToFixed which="FIRST" weekday="SUNDAY" when="BEFORE" descriptionPropertiesKey="FOURTH_ADVENT" localizedType="OFFICIAL_HOLIDAY">
<tns:day month="DECEMBER" day="25"/>
</tns:FixedWeekdayRelativeToFixed>
<tns:FixedWeekdayRelativeToFixed which="SECOND" weekday="SUNDAY" when="BEFORE" descriptionPropertiesKey="THIRD_ADVENT" localizedType="UNOFFICIAL_HOLIDAY">
<tns:day month="DECEMBER" day="25"/>
</tns:FixedWeekdayRelativeToFixed>
<tns:FixedWeekdayRelativeToFixed which="THIRD" weekday="SUNDAY" when="BEFORE" descriptionPropertiesKey="SECOND_ADVENT" localizedType="UNOFFICIAL_HOLIDAY">
<tns:day month="DECEMBER" day="25"/>
</tns:FixedWeekdayRelativeToFixed>
<tns:FixedWeekdayRelativeToFixed which="FOURTH" weekday="SUNDAY" when="BEFORE" descriptionPropertiesKey="FIRST_ADVENT" localizedType="UNOFFICIAL_HOLIDAY">
<tns:day month="DECEMBER" day="25"/>
</tns:FixedWeekdayRelativeToFixed>
</tns:Holidays>
</tns:Configuration>
Code: Alles auswählen
<?xml version="1.0" encoding="UTF-8"?>
<tns:Configuration hierarchy="de" description="Germany" xmlns:tns="http://www.example.org/Holiday"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.example.org/Holiday /Holiday.xsd">
<tns:Holidays>
<tns:ChristianHoliday type="CARNIVAL"/> <!-- dayOfYear==easterSunday.getDayOfYear-48 -->
<tns:ChristianHoliday type="MAUNDY_THURSDAY"/> <!-- dayOfYear==easterSunday.getDayOfYear-3 -->
<tns:Fixed day="29" month="JUNE" descriptionPropertiesKey="ST_PETER_PAUL"/>
<!-- dayOfYear==stAdvent.getDayOfYear-14 // "remembrance_day" // Volkstrauertag -->
<!-- dayOfYear==stAdvent.getDayOfYear-7 // "sunday_in_commemoration_of_the_dead" // Totensonntag -->
<tns:Fixed day="04" month="DECEMBER" descriptionPropertiesKey="ST_BARBARAS_DAY"/> <!-- Barbara Tag -->
<tns:Fixed day="06" month="DECEMBER" descriptionPropertiesKey="ST_NICHOLAS"/> <!-- Nicolaus Tag -->
</tns:Holidays>
</tns:Configuration>

Nutzt noch jemand die Funktion und hat einen Tipp

Viele Grüße und ein 3-fach Düsseldorfer Helau, Helau, Helau
