I want to create a schedule based on the time of the year. For example, let say I want my Christmas lights set to ON at sunset everyday but only during the following period: from December 15th to January 5th of every year.
I understand I can create a custom ephemeris file and use isBankHoliday(<datetime>, <file>) in a rule to check if the date is present in the custom file. Is there a way to do this from the configuration UI instead?
Thanks for the response Rich. At the very least, I can define at the rule level the script that will check for a holiday in a specific file with isBankHoliday(<datetime>, <file>)
Correct. In fact, that’s the only way you can check for your custom holidays. I don’t think any other part of OH will be aware of your custom file.
For the same use case (seasonally turning on my Christmas lights), I have used the Blockly Ephemeris “days until holiday named” Christmas block to make this work. I would show the Blockly but I haven’t figured out how to do it other than with a screen image, which I understand to be bad form in this forum. But I have an AND logic block with two comparison subblocks. The first compares the days until Christmas to 15 and the second to 353 (365-12). Seems a lot easier than the custom ephemeris file for this use.
The custom file should work well for another use case. I turn my outside lights to my alma maters colors on their game days. In the past I have either read my calendar using the icalendar binding or used a textual map file with the dates I manually entered. It should also be good for other dates that are celebrated but are not bank holidays, such as St. Patrick’s Day, when I turn my lights green or patriotic days that are not bank holidays such as Flag Day in the US. Thanks for sharing your approach