Problems with region specific holidays

  • Platform information:
    • Hardware: ARM/1GB
    • OS: Raspbian GNU/Linux 11 (bullseye)
    • Java Runtime openjdk 11.0.16 2022-07-19
    • 3.4.0.M3

First of all: There are many ephermeris specific topic (most of them are for OpenHab 2.x) - i read them all but nothings works. Maybe i’m to supid.

What i what to do is quite simple: I want to create some holiday specific rules.

So i configured OpenHab like this:

This configuration is written in /var/lib/openhab/config/org/openhab/ephemeris.config and looks like this:

:org.apache.felix.configadmin.revision:=L"7"
country="de"
dayset-school="\"\"\"\"\"\"(\ \"MONDAY\",\ \"TUESDAY\",\ \"WEDNESDAY\",\ \"THURSDAY\",\ \"FRIDAY\",\ )\"\"\"\"\"\""
dayset-trash=( \
  "MONDAY", \
)
dayset-weekend=( \
  "SATURDAY", \
  "SUNDAY", \
)
dayset-workday=( \
  "MONDAY", \
  "TUESDAY", \
  "WEDNESDAY", \
  "THURSDAY", \
  "FRIDAY", \
)
felix.fileinstall.filename="file:/var/lib/openhab/etc/org.openhab.ephemeris.cfg"
region="sn"
service.bundleLocation="?"
service.pid="org.openhab.ephemeris"

My test rule is also quite simple:

grafik

This works for October 3, 2022 - Day of German unity:

==> /var/log/openhab/openhab.log <==

2022-10-31 11:00:07.899 [ERROR] [org.openhab.rule.6e2fb0dab0                  ] - UNIFICATION_GERMANY

Today is October 31. 2022 - Reformation Day in some regions in germany - and it doesn’t work for this day.

So the first question is: Do i need to store a specific file for my region? If so: Why the October 3 is recognised?

I’ve read this ephemeris-help

The second question is: What are the correct files or file location where i have to configure ephemeris? What is the differents between /var/lib/openhab/config/org/openhab/ephemeris.config and /etc/openhab/services/ephemeris.config.

Sorry for this stupid questions but i’m at my wit’s end.

I thought I had the same problem but …
looking to the settings area I detected that I did not set my region in the ephemeris part.
So go to settings and set your country and region.
Then ephemeris will work for Reformation Day, too.

Holidays are defined in jollyday/src/main/resources/holidays/Holidays_de.xml at master · svendiedrichsen/jollyday · GitHub which is the base for the ephemeris service.

1 Like

Here is the correct configuration screenshot:

I think that’s the correct configration.

Holidays are defined in jollyday/Holidays_de.xml at master · svendiedrichsen/jollyday · GitHub which is the base for the ephemeris service.

And where is this file located locally?

As far as I understand ephemeris has a dependency on jollyday-0.5.10.jar which is downloaded from maven during runtime of the ephemeris / openhab service.
You find the jollyday jar file under: /usr/share/runtime/system/de/jollyday/jollyday/0.5.10/jollyday-0.5.10.jar
This jar file contains ( besides other files ) : holidays/Holidays_de.xml
So the file you are looking for during runtime is located in memory.

1 Like

OK. I found this file in this jar. But it still it does not work. :frowning:

Is it possible to active some logs for involved classes?

Could you try to create a .rules file like /etc/openhab/rules/ephemeris.rules with content


rule "ephemeris message"

when Time cron "0/10 * * * * ?" //run every 10 seconds
then
logInfo("Rules", Ephemeris.getHolidayDescription(Ephemeris.getBankHolidayName(new DateTimeType().zonedDateTime.plusDays(0))))
end

This should create an entry in openhab.log every 10 seconds - at least it does here.

If you are not configuring it through the UI, /etc/openhab/services/ephemeris.conf is the correct place. You should usually not edit /var/lib/openhab/config files unless specifically told to do so after asking for help here on the forum. You can cause quite some problems messing with some of those files.

If you do have an ephemeric.conf in /etc/openhab, what ever you have there is going to overwrite anything you do in MainUI or anything you may have edited in /var/lib/openhab. So if you want to use MainUI to configure this (which I recommend), make sure the /etc/openhab file is either empty or no present.

2 Likes

Typo: ephemeris.cfg

https://www.openhab.org/docs/configuration/actions.html#ephemeris-cfg

Ok. I created an /etc/openhab/services/ephemeris.cfg with the following content:

country=de
region=sn
dayset-workday=[MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY]
dayset-weekend=[SATURDAY,SUNDAY]
dayset-trash=[MONDAY]

This works for me. Configuration with MainUI did not work for me. However it is a solution for me

1 Like