Light colors for each bulb based on holidays

Hi
I’m new here. I’m trying to get my 3 color-changing LED bulbs working on a schedule.
On normal days it would turn on as a warm light (2700K) but on holidays I’d like to turn on different colors.
I found this topic (Schedule light color based on holidays) which is great but I need my 3 lights to be different colors on e.g 4th of July (I ned one to be red, one blue and one white).

I was tweaking the script for the topic mentioned above but I only broke the automation.

Any help would be appreciated.

Thanks

Post the automation yaml code (using code tags).

Here is the code.
For 7/4 I set the lights to blue but I want them to be red, blue and white - one color for each LED light.
This is an automation when sunset then do action:

data:
brightness_pct: 40
color_name: >
{% set holidays = { ‘03-15’: ‘green’, ‘03-16’: ‘green’, ‘03-17’: ‘green’,
‘07-04’: ‘blue’,
‘10-31’: ‘orange’, ‘12-25’: ‘red’,
‘01-01’: ‘yellow’ } %}
{% set today = (now().date()|string)[5:] %} {{ holidays[today] if today in
holidays.keys() else ‘warm’}}
target:
device_id:
- 2fc53535b125e5ab093c9f3b5982f3e0
- b55afc49f9aa2f8e8d570b8470bea83e
- 13eabd77ed854d663ec328c09cfb5cc0
action: light.turn_on

Use code tags. The forum editor screws up formatting.

1 Like

Make a scene for every holiday first my man.

Assuming your code is working, and that what you want is to have multiple colors on 7/4, the simplest way to adapt what you currently have is to make three calls to light.turn_on, one for each light. For the 7/4 color, you’d just specify different colors for the different lights.

But that’s definitely not a great solution in general. Creating a scene and selecting the scene based on the holiday, like @coud suggests, is a much more robust way to approach this.

Thanks all for your suggestions - will try scenes to control the colors of my lights.
If anyone has other suggestions - feel free to add them.