Holiday Lights Script Modification Help

Before moving to Hubitat I was using Smartthings and an app called "Holiday Color Lights". It was hosted on Github and developed by "ygelfand". I cannot find a current copy of it on Github so it may have been pulled. I do have a copy of it and successfully have it running on HE.

My question and request is to find someone that could either modify the code for me with some changes. For the most part, the current code works for my needs but I really wish the app had a configuration page for each Holiday. For example, I would like to see the following abilities added:

  • Add / edit / delete holidays
  • Even better would be if holidays could be updated via a public available API
  • Edit the start "days before holiday" and end "days after the holiday as a per holiday setting. Currently this is a global setting.
  • Edit the color cycle per holiday from a configuration dialog

I am willing to replace this app with another one with similar capabilities. What I really like about this app is that it is simple and reliable and easy works with any color changing bulb in the system. Usually I keep my outdoor Philips Hue bulbs set to warm white turning on at sunset and off at a set time. For various holidays, they cycle set colors for that holiday starting with days before holiday until days after holiday with set values. For some holidays, I would enable the colors 2 days before running until 1 day after while others like Christmas have a longer season.

I have come across similar capabilities in a WebCore script but at least on Smartthings found it incredibly painful to manage.

Any and all help and/or suggestions are appreciated.

1 Like

It never ceases to amaze me what people spend time setting up on their home automation. I'd rather go down the pub :wink:

1 Like


Could this help you?

3 Likes

This holiday color lights app? :slight_smile:

1 Like

I remember this too:

I've been looking for a simple app to sequence some color changes on a loop for a while. I prefer to leave that to the hue bridge but now I've got a new set of lights that I'm controlling over 433mhz... It's gross and I'm about ready to buy another GLEDOPTO controller to fix the issue... which will cause another issue because it's outside...

Yes! That's the one.

This would be cool to incorporate into the Holiday Lights app to automatically load the holidays. The configuration page of the Holiday Lights app could then select which holidays to use and set colors and begin/end times accordingly.

Is this something that the color lights app has, functionality wise? If not, I’d be down to add it.

Let me know if you experience any issues with that app. I haven’t tested it, but now that I remember it exists, I might start using it around our house for our porch :slight_smile:

I'll try the 'Holiday Switch' driver in the next few days.

As for 'Holiday Lights' (ygelfand), I have that running successfully. What I don't like is that you have to edit the holiday dates manually for those that fall on a day of the week. I think you should be allowed to edit this via a configuration page. Also, the script currently sets the lights to the holiday colors based on a fixed day before and after variable set in the configuration page. It would be nice to have each holiday configurable with a separate days before and days after setting.

I realize these are not necessarily practical scripts but they are a fun way to get less technical family on board with what home automation can do. For example, have a special holiday lighting sequence for a birthday is kind of fun.

I have three Hue lights around my front yard and it's nice to see the color rotation supporting a specific holiday (or special occasion). Thanks in advance for any help you can provide.

1 Like

Thanks for the info on these holiday lighting apps...I currently have 63 Philips Hue color bulbs indoors and about to add some outdoor ones. I think these apps will be cool to play with for holidays. I was not aware of these apps...they'll sure help the WAF for me in HE.
Just curious what outdoor Philips lights do you have fischer1049? Any experience with the outdoor lightstrips?

2 Likes

I just use the standard Philips Hue color bulbs outdoors. Each bulb is fully enclosed in an outdoor sconce like fixture. I've had them outdoors for over two years without any issues whatsoever. Apps like Holiday Lighting really do help with the WAF of home automation. :grin:

I was going to try outdoor light strips but they were too difficult to cost justify.

So I have a need for this wonderful application originally created by Ygelfand. I have started to modify it to allow adding dates and colors for each holiday. But am running into some issues with the way the application calls sunset and sunrise times. Can I get a developer to take a look at the issue I'm sure it is a simple fix that I can't wrap my head around. I can get the Sunrise and Sunset times to show up in the debug log but that is about as far as I have gotten so far.

Log of error:

Here is the code that I have worked on so far:

I have something that is mostly working for me. I was able to code around the sunrise/sunset code and it is working for me. I don't have access to my hub at the moment but I'll post the changes as soon as I can get to it.

I do still have problems with the code. Specifically, after the holiday is over, the lights do not revert back to their default white color which is something that was working when I was on SmartThings.

My intention is to figure this out at some point but I need more time and patience. In the meantime, there may be a workaround such as a daily rule that sets the affected lights back to white before the Holiday Lights rule runs.

I also have issues with the scheduling but that is more complex. For example, I'd like to trigger each holiday with separate before and after (linger) times. For certain holidays like (US) Presidents Day, I may only want the holiday color scheme for the day of the holiday but Christmas lights I may want to run for the month of December. I see these as part of my spare time portfolio once I retire next year. LOL.

I know this thread is a bit old, but would like to revisit it in order to get a working Holiday Lights App. I had it partially working except sunrise/sunset. @fischer1049 Any chance you have an update to what you were working on?

I still have not gotten back to rewriting this code but I do have the sunrise/sunset offset working properly in Hubitat. Here is what is working for me.

private timeWindowStart() {
def result = null
if (startTimeType == "sunrise") {
result = location.sunrise
if (result && startTimeOffset) {
result = new Date(result.time + Math.round(startTimeOffset * 60000))
}
}
else if (startTimeType == "sunset") {
result = location.sunset
if (result && startTimeOffset) {
result = new Date(result.time + Math.round(startTimeOffset * 60000))
}
}
else if (starting && location.timeZone) {
result = timeToday(starting, location.timeZone)
}
log.trace "timeWindowStart = ${result}"
result
}

private timeWindowStop() {
def result = null
if (endTimeType == "sunrise") {
result = location.sunrise
if (result && endTimeOffset) {
result = new Date(result.time + Math.round(endTimeOffset * 60000))
}
}
else if (endTimeType == "sunset") {
result = location.sunset
if (result && endTimeOffset) {
result = new Date(result.time + Math.round(endTimeOffset * 60000))
}
}
else if (ending && location.timeZone) {
result = timeToday(ending, location.timeZone)
}
log.trace "timeWindowStop = ${result}"
result
}

Hope this helps.