According to the OpenHAB 2.5 release blog, it should be possible to use Ephemeris with birthdays:
It provides information about the days: Is it a weekday or weekend? Is it a bank holiday? Is it anybody’s birthday or maybe time to carry the trash outside?
honestly even with documentation or Samples I’m not making it
I like to see if a specific date is a holiday and if true, which one. getBankHolidayName(<datetime>) would be the one, but I do not manage to specify a date properly.
e.g. which Holiday would be 25th December of actual year?
On the other hand, how to get 1st Advent for Christmas lights??
You may need to import java.time.ZonedDateTime. In anticipation of the removal of Joda DateTime in future versions of OH, Ephemeris was written to use ZonedDateTime instead.
If Advent is not an official bank holiday in your configured region, you need to create a custom XML file to define it and query that XML file instead of the default one.
thanks, and sure thing I should have posted this, even there where many tries.
Unfortunatelly your string haven’t work either. But I’ve got it working with
I don’t use custom xml files but I know others do and it works for them. Assuming the path to that file is correct I don’t have any further suggestions. There is no error so it seems like it’s finding the file. Are you certain that the holiday is correctly defined on 12/22?
That’s not what the “descriptionPropertiesKey” does. That attribute references a properties file that has a nicer version of the holiday name. See https://github.com/svendiedrichsen/jollyday/tree/master/src/main/resources/descriptions. I’m not sure what get’s returned when the property doesn’t exist. I’m also not sure how to define your own .properties file.
I would test with a day that is not in the county bank holiday list.
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
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 ?
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.
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??
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.
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.