Ephemeris binding?

Tags: #<Tag:0x00007f8320c96cb0>

I haven’t had properties-file in my system, placed it now to services folder as well.
Also I changed to default name “holidays_de.xml” and added a new item, did a restart of OH, bt still no success

New Item

<tns:Fixed month=“DECEMBER” day=“24” descriptionPropertiesKey=“GIFT_CHRISTMAS_DAY”/>

logInfo(“Test”, “Day 24: {}”, Ephemeris.getBankHolidayName(new DateTimeType(“2020-12-24”).zonedDateTime))
logInfo(“Test”, “Day 25: {}”, Ephemeris.getBankHolidayName(new DateTimeType(“2020-12-25”).zonedDateTime))
logInfo(“Test”, “File 24: {}”, Ephemeris.getBankHolidayName(new DateTimeType(“2020-12-24”).zonedDateTime), ‘services/Holidays_de.xml’)
logInfo(“Test”, “File 25: {}”, Ephemeris.getBankHolidayName(new DateTimeType(“2020-12-25”).zonedDateTime), ‘services/Holidays_de.xml’)
logInfo(“Test”, “File2 25: {}”, Ephemeris.getBankHolidayName(new DateTimeType(“2020-12-25”).zonedDateTime), ‘d:/OpenHAB/conf/services/Holidays_de.xml’)


22:21:13.543 [INFO ] [g.eclipse.smarthome.model.script.Test] - Day 24: {}
22:21:13.552 [INFO ] [g.eclipse.smarthome.model.script.Test] - Day 25: FIRST_CHRISTMAS_DAY
22:21:13.562 [INFO ] [g.eclipse.smarthome.model.script.Test] - File 24: null
22:21:13.570 [INFO ] [g.eclipse.smarthome.model.script.Test] - File 25: FIRST_CHRISTMAS_DAY
22:21:13.581 [INFO ] [g.eclipse.smarthome.model.script.Test] - File2 25: FIRST_CHRISTMAS_DAY

It looks like information is read somewhere else than from file? As descriptionPropertiesKey is shown up in log, I won’t expect a dependency to country_descriptions_de.properties ?

I’ve just found the (further) mistake and got it working.
I have to provide full path to file and to set brackets at right place.


logInfo(“Test”, “Day25: {}”, Ephemeris.getBankHolidayName(new DateTimeType(“2020-12-25”).zonedDateTime), ‘d:/OpenHAB/conf/services/Holidays_de.xml’)


logInfo(“Test”, “Day 25: {}”, Ephemeris.getBankHolidayName(new DateTimeType(“2020-12-25”).zonedDateTime, ‘d:/OpenHAB/conf/services/Holidays_de.xml’))

Obvious but just hidden.

From the docs:

You can place these XML files anywhere on your file system that openHAB has permission to read. In the calls to the Actions, use the fully qualified path.

I’d read this,but it haven’t worked because of error wih brackets, which wasn’t recognized by VSC either. Anyway, this one is working now.

As Advent weekends are not included I’m trying to create a custom xml, but these days are not fixed ones.
I already posted this in knx-user-forum (german one) but probably some here also has some tipp or knows where the issue is??

<?xml version="1.0" encoding="UTF-8"?>

<tns:Configuration hierarchy=“de” description=“Germany” xmlns:tns=“http://www.example.org/Holiday
xsi:schemaLocation=“http://www.example.org/Holiday /Holiday.xsd”>
<tns:RelativeToFixed descriptionPropertiesKey=“FIRST_ADVENT”>
<tns:date month=“DECEMBER” day=“25”/>
<tns:RelativeToFixed descriptionPropertiesKey=“SECOND_ADVENT”>
<tns:date month=“DECEMBER” day=“25”/>
<tns:RelativeToFixed descriptionPropertiesKey=“THIRD_ADVENT”>
<tns:date month=“DECEMBER” day=“25”/>
<tns:RelativeToFixed descriptionPropertiesKey=“FOURTH_ADVENT”>
<tns:date month=“DECEMBER” day=“25”/>

For debugging the XML file you might need to ask over at the Jollyday github project. At this point you are probably among the most experienced with Ephermeris on this forum. I don’t know that many have created custom XML files yet and even fewer have attempted to create relative holiday dates. I know it’s possible though.

You might look at the example xml files on Jollyday for various countries and see if there is something different between your XML and relative dates in the various country XML files.

1 Like

Just for information, after I read through various xml’s I’ve found something I can use and which solves this issue for me. Thanks for support and hints.