Hi,
i am running OH2.5 and got trouble with an Ephemeris Rule.
rule "Wichtiger Tag"
when
Time cron "0 0 1 ? * * *" or
Item Dummy received update or
System started
then
val String naechsterTag = Ephemeris.getNextBankHoliday('/etc/openhab2/services/wichtige_tage.xml')
naechsterTagAnzeige.postUpdate(naechsterTag)
val long TagebiswichtigerTag = Ephemeris.getDaysUntil(naechsterTag, '/etc/openhab2/services/wichtige_tage.xml')
TagebiswichtigerTagAnzeige.postUpdate(TagebiswichtigerTag)
// wichtigerTag.postUpdate(TagebiswichtigerTagAnzeige.toString)
var int zahlversuch = (TagebiswichtigerTagAnzeige.state as Number).intValue
var wichtigerTagDatumCalc = now.plusDays(zahlversuch)
wichtigerTagDatum.postUpdate(wichtigerTagDatumCalc.toString("dd-MM-yyyy"))
wichtigerTag.postUpdate(naechsterTag + " " + wichtigerTagDatumCalc.toString("dd-MM-yyyy") + ", noch " + TagebiswichtigerTag.toString + " Tage " )
if (TagebiswichtigerTag < 1) {
logInfo("Info","Heutiges Event: " + naechsterTag)
}
else {
logInfo("Info","Heute liegt nichts an. Nächster wichtiger Tag: " + naechsterTag + " " + wichtigerTagDatumCalc + ", noch " + TagebiswichtigerTag + " Tage")
}
end
When it runs with the cronjob it gets the day wrong “Geburtstag Sandra 2021-03-11”. The Birthday is on the 10th. The 10th is specified as day in the xml file.
If i run it with the dummy trigger, it works correct and shows the 10th as Birthday “Geburtstag Sandra 2021-03-10”.
The day count towards that day is correct in both cases…
Please, if anyone has an idea, let me know. My Brain allready hurts
Thnx in advance
Cheers
Michael