[Release] Holiday Lighting

@mbishop do I understand correctly you can’t use the switch/contact/motion triggers to initiate any of the non-white color patterns?

Here’s what I’m thinking: once certain color palettes have been established, the only way to trigger the palette is based on datetime and/or mode (I think). If you could allow for a switch or similar basic event to trigger the exact same lighting behavior, it would generalize the app in potentially powerful ways.

Granted, this may not be how you were thinking about the app (Holidays), and I have no clue if this is simple or difficult to change. Thought I’d throw it out there just the same. Maybe there are workarounds.

That's correct -- the holiday lights are on a schedule, and the white lights are a higher priority which can "interrupt" the display.

If I were to code device triggers, I can think of two ways it could work, neither quite ideal:

  • If a set of sensors were an alternative to the schedule (as, in fact, the switch already is for illumination), then what colors would I show if no holiday is currently defined?
  • If a "holiday" could be defined as a collection of sensor states rather than a time period, it's unclear how I'd determine priority between them. (Overlapping holidays are currently resolved in favor of the briefest period; e.g. Juneteenth supersedes Pride Month.)

I think what you're suggesting might work better as a separate app that could reuse a chunk of code from this one about how to apply colors to lights, something like dynamic Scenes. Given a trigger device and a set of colors to apply to the RGB lights when the trigger is on, you could use existing automation to have the trigger logic be as complex as desired.

1 Like

Hmm I take your point. Maybe the wrong approach to the use case.

That said, what if the switch-based interruptions could use color palettes as well (not just white). I think that might address the design issues you raised.

Totally acknowledge these are “easy” things in concept when we’re just talking. I appreciate it may not be straightforward to do, and it sounds like it doesn’t fit your vision.

Your code, your call. Just spitballin’….

That's an interesting thought. The code actually does account for the possibility that the lights are pure RGB (versus RGBW) and let you pick a color for that case, but it's a single color and I always assumed it would be a shade close to white.

I'm still leaning toward a new app with a different interaction model for more general use-cases, but I don't think it would be a huge amount of new code.

Whatever you decide I respect. Just LMK.

I'll make a separate thread for this soon, but I took that idea and tried it out. Here's the result.

If you look at GitHub - MikeBishop/hubitat-holiday at palette-scenes, there are three files to install:

There's a lot of reused code, mostly in the instance file. It will do basically what the holiday display does, but instead of using a calendar, you just get a collection of activator switches that apply each set of colors. Those can be automated with any triggers you want. The parent device driver ensures that at most one of them can be turned on at once -- turning one on turns the others off.

I've done some very rough testing and nothing is obviously broken; I'd appreciate if someone else could also poke at it before I post it as a separate app.

Update: This and Holiday Lights were refactored to use the Libraries function and share code. Palette Scenes is now published as a separate app.

I have FLS100 floodlights (set to always be on, I use the motion only as a trigger for automation) that hold Sengled RGBW Floods. I use Simple Automation to turn them all to the same random dimmed color every night at sundown. Then, if any motion is detected for a particular light, I use Rule Machine to capture the current color and brightness of the bulb nearest to the motion detection (the same FLS100), then it changes it to bright white (as a motion light should!), waits 5 minutes and then restores the color back to the original color that it was set at sundown.

Is there any possibility you might allow for that in your app?

Hm, perhaps if I let you get colors from a variable, you could set it from the other automation? Then you would have one scene which sets whatever is in the variable, and one which is always white...?

1 Like

Hey sorry I’ve been traveling the past week plus. I get home Monday so will check it out next week. Looks cool!

Edit: Works Awesome! TYVM!!

I'd definitely be glad to try it.

I've got a strange issue with this app. No matter what color I choose it always starts with a gold/yellow when I test a holiday. I've tried this with a RGBW and a hue color light, same result.

I just pulled the code from github the other day so it should be the latest.

Definitely strange. Can you confirm that a valid-looking ColorMap is saved in the app settings, and that the same ColorMap works if you past it in on the device page for that bulb?

I just went and did the pre-select color just to be safe to rule out the color map. I'm able to choose any color on the devices page.

Here are the values for one of the colors:
[hue:77.77777777777779, saturation:55.29953917050692, level:85.09803921568627]
177,101,215

Well, the preselect just populates the map. That looks like a valid color map, albeit one from the color picker rather than the preselect drop-down. If you turn on debug logging, are any errors logged?

Yeah, that color was just one I documented as I was trying to rebuild a holiday.

Here are the logs from the last test run of Veterans day:

Device Logs:

dev:4422022-10-30 08:58:07.204 PMinfoZooz RGBW Dimmer-color switch is off
dev:4422022-10-30 08:58:06.618 PMdebugoff()
dev:4422022-10-30 08:57:54.025 PMinfoZooz RGBW Dimmer-color level is 55%
dev:4422022-10-30 08:57:54.006 PMinfoZooz RGBW Dimmer-color hue is 78
dev:4422022-10-30 08:57:53.997 PMinfoZooz RGBW Dimmer-color colorName is Violet
dev:4422022-10-30 08:57:51.344 PMdebugsetColor([hue:77.5, saturation:100, level:54.90196078431373])
dev:4422022-10-30 08:57:10.276 PMinfoZooz RGBW Dimmer-color saturation is 100
dev:4422022-10-30 08:57:10.258 PMinfoZooz RGBW Dimmer-color hue is 10
dev:4422022-10-30 08:57:10.241 PMinfoZooz RGBW Dimmer-color colorName is Orange
dev:4422022-10-30 08:57:08.207 PMinfoZooz RGBW Dimmer-color switch is on
dev:4422022-10-30 08:57:06.050 PMdebugsetColor([hue:10, saturation:100, level:100])
dev:4422022-10-30 08:57:05.803 PMdebugoff()

App Logs:
app:5792022-10-30 08:58:06.612 PMdebugTurning off lights
app:5792022-10-30 08:58:06.600 PMdebugNot in holiday period
app:5792022-10-30 08:58:06.553 PMdebugTurning off illumination
app:5792022-10-30 08:58:06.499 PMdebugScheduling holidayStop for Mon Oct 31 18:11:00 CDT 2022 (sunset with 0 minutes offset)
app:5792022-10-30 08:58:06.462 PMdebugScheduling holidayStart for Mon Oct 31 07:12:00 CDT 2022 (sunrise with 0 minutes offset)
app:5792022-10-30 08:58:06.426 PMdebugScheduling illuminationStop for Mon Oct 31 18:11:00 CDT 2022 (sunset with 0 minutes offset)
app:5792022-10-30 08:58:06.389 PMdebugScheduling illuminationStart for Mon Oct 31 07:13:00 CDT 2022 (sunrise with 1 minutes offset)
app:5792022-10-30 08:58:06.386 PMdebugGot sunrise: Mon Oct 31 07:12:00 CDT 2022 and sunset: Mon Oct 31 18:11:00 CDT 2022 from location events
app:5792022-10-30 08:58:06.305 PMdebugBegin state machine
app:5792022-10-30 08:57:51.341 PMdebugSetting [Zooz RGBW Dimmer-color] to [hue:77.5, saturation:100, level:54.90196078431373]
app:5792022-10-30 08:57:51.339 PMdebugApplying colors [['hue':77.5, 'saturation':100, 'level':54.90196078431373]] to devices [[Zooz RGBW Dimmer-color]]
app:5792022-10-30 08:57:51.337 PMdebugSublist: [['hue':77.5, 'saturation':100, 'level':54.90196078431373]]
app:5792022-10-30 08:57:51.334 PMdebugStarting from offset 1 (next is 0)
app:5792022-10-30 08:57:51.332 PMdebugColors for holiday 8: [['hue':10, 'saturation':100, 'level':100], ['hue':77.5, 'saturation':100, 'level':54.90196078431373], ['hue':10, 'saturation':100, 'level':100], ['hue':77.5, 'saturation':100, 'level':54.90196078431373]]
app:5792022-10-30 08:57:51.328 PMdebugColors for holiday 8: [['hue':10, 'saturation':100, 'level':100], ['hue':77.5, 'saturation':100, 'level':54.90196078431373]]
app:5792022-10-30 08:57:51.267 PMdebugDo light update
app:5792022-10-30 08:57:07.711 PMdebugFinished with holidayDefinitions
app:5792022-10-30 08:57:06.488 PMdebugColors are ['11':[0, 1, 2], '12':[0, 1], '13':[0], '14':[0], '15':[0], '16':[0, 1], '17':[2, 3], '18':[0, 1, 2, 3, 4], '0':[0, 1, 2], '1':[0], '2':[0, 1, 2], '3':[0, 1, 2, 3, 4, 5], '4':[0, 1, 2], '5':[0, 1, 2], '6':[0, 1, 2], '7':[0, 1, 2], '8':[0, 1], '9':[0, 1, 2], '10':[0, 1, 2]]
app:5792022-10-30 08:57:06.481 PMdebugList became [10, 15, 11, 0, 1, 13, 12, 16, 2, 14, 18, 5, 6, 7, 17, 8, 9]
app:5792022-10-30 08:57:06.456 PMdebugSorting holidays: [10, 15, 11, 0, 1, 13, 12, 16, 2, 14, 18, 5, 6, 7, 17, 8, 9]....
app:5792022-10-30 08:57:06.452 PMdebugRendering holidayDefinitions
app:5792022-10-30 08:57:06.047 PMdebugSetting [Zooz RGBW Dimmer-color] to [hue:10, saturation:100, level:100]
app:5792022-10-30 08:57:06.044 PMdebugApplying colors [['hue':10, 'saturation':100, 'level':100]] to devices [[Zooz RGBW Dimmer-color]]
app:5792022-10-30 08:57:06.042 PMdebugSublist: [['hue':10, 'saturation':100, 'level':100]]
app:5792022-10-30 08:57:06.039 PMdebugStarting from offset 0 (next is 1)
app:5792022-10-30 08:57:06.037 PMdebugColors for holiday 8: [['hue':10, 'saturation':100, 'level':100], ['hue':77.5, 'saturation':100, 'level':54.90196078431373], ['hue':10, 'saturation':100, 'level':100], ['hue':77.5, 'saturation':100, 'level':54.90196078431373]]
app:5792022-10-30 08:57:06.031 PMdebugColors for holiday 8: [['hue':10, 'saturation':100, 'level':100], ['hue':77.5, 'saturation':100, 'level':54.90196078431373]]

Just removed and reinstalled, it worked for one test, then went back to pushing orange.

When using multiple colors, Does it just randomly set the colors, or does it let you specify colors for each bulb ?

A couple of modes. You can choose to put all bulbs to the same color or different ones per bulb; you can choose to apply the colors randomly, sequentially, or always stay the same color

Trying to use this with a single RGBW bulb and have the one bulb cycle through the appropriate colors. It was not clear to me how I would set that, but got it figured out. In case it helps anyone else:

  • In "How to rotate colors" select "Sequential"

@mbishop : THANK YOU. Great app. 2 questions:

  1. Would it be possible to add a quicker cycle, such as 5 or 10 seconds, or make it user configurable? 1 minute is a very long time; someone walking down the street could approach and walk by in 30 seconds and would only see one color.
  2. In the holiday lighting section under each holiday there is a button to "Test Holiday" which is great. But if I am working on this app after sunset, and am done testing, I see no way to turn this app on/Activate it to get the non-holiday light on for the remainder of the night. Am I missing something?
    ETA: 3. I can't seem to get this app to trigger in the first place. My holiday lights are triggered by Sunset, but it looks like the app triggers only via a sensor or switch...is there any way to get the app to turn the lights on at sunset and turn off at sunrise?
  1. The frequencies map to the runEveryNMinutes() functions the Hubitat platform provides. It's certainly possible to do an arbitrary number of seconds, just not as easy.
  2. Test Holiday runs a brief cycle for one minute (light updates every 15 seconds, scheduled manually), and at the one-minute mark runs the same code that runs when the settings page is closed. That should result in returning to the normal schedule. If it doesn't, please send logs.
  3. The idea is that general lighting is motion-triggered and overrides a holiday display (which runs when things are idle and it's a holiday). If you want white lights whenever it's not a holiday, you might consider adding a custom holiday that runs all year that displays white. In case of overlap, the briefer holiday is selected, so a year-long holiday will always lose to any other holiday.

Is there a way to run a sunset-sunrise multi-light Holiday setting to 11;59 pm and then switch back to a CT setting for the remainder of the night over an extended holiday period?

1 Like

I had asked for this (or something similar) before, and we had tried to work on it but couldn't get it working reliably. Maybe with more than one person asking he might take another stab at it.