Ephemeris binding?

Hmm,
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’)

Log

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.

WRONG

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

WORKING

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.

Yep,
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
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=“http://www.example.org/Holiday /Holiday.xsd”>
tns:Holidays
<tns:RelativeToFixed descriptionPropertiesKey=“FIRST_ADVENT”>
tns:WhichFOURTH</tns:Which>
tns:WeekdaySUNDAY</tns:Weekday>
tns:WhenBEFORE</tns:When>
<tns:date month=“DECEMBER” day=“25”/>
</tns:RelativeToFixed>
<tns:RelativeToFixed descriptionPropertiesKey=“SECOND_ADVENT”>
tns:WhichTHIRD</tns:Which>
tns:WeekdaySUNDAY</tns:Weekday>
tns:WhenBEFORE</tns:When>
<tns:date month=“DECEMBER” day=“25”/>
</tns:RelativeToFixed>
<tns:RelativeToFixed descriptionPropertiesKey=“THIRD_ADVENT”>
tns:WhichSECOND</tns:Which>
tns:WeekdaySUNDAY</tns:Weekday>
tns:WhenBEFORE</tns:When>
<tns:date month=“DECEMBER” day=“25”/>
</tns:RelativeToFixed>
<tns:RelativeToFixed descriptionPropertiesKey=“FOURTH_ADVENT”>
tns:WhichFIRST</tns:Which>
tns:WeekdaySUNDAY</tns:Weekday>
tns:WhenBEFORE</tns:When>
<tns:date month=“DECEMBER” day=“25”/>
</tns:RelativeToFixed>
</tns:Holidays>
</tns:Configuration>

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.