[HowTo] Christmas Lights Playlist with Reactor
-
I bought some cheap Chinese lights a couple of years ago, and I permanently installed on my terrace. I let them the first year with just a single effect, because the thing has no way to run a playlist. Then, last year I created a very easy Reactor scene to change effects every 5 minutes.
If you want to do that, just define 3 expressions:
playlist: we'll se the effects latereffect: empty, to track current effectsdata: empty, to compose Home Assistant messagecurrent: just to cycle the effects.
in your playlist expression save something like this:
[ { effect: "clockwise", animation_data: [[255,0,0],[255,255,255]], speed: 35, name: "candy_cane_spin" }, { effect: "counterclockwise", animation_data: [[0,180,0],[255,255,255]], speed: 28, name: "evergreen_snow_spin" }, { effect: "circular", animation_data: [[200,0,0],[0,160,0],[255,215,0]], speed: 40, name: "poinsettia_holly_circle" }, { effect: "gradient", animation_data: [[255,0,0],[0,120,0],[255,255,255]], speed: 32, name: "red_green_white_blend" }, { effect: "breath", animation_data: [[255,80,0],[255,200,150]], speed: 35, name: "warm_ember_breath" }, { effect: "clockwise", animation_data: [[255,215,0],[255,0,0],[255,255,255]], speed: 35, name: "gold_red_white_spin" }, { effect: "counterclockwise", animation_data: [[0,200,0],[255,255,255],[255,0,0]], speed: 36, name: "green_white_red_reverse" }, { effect: "circular", animation_data: [[255,0,0],[255,215,0],[0,255,0]], speed: 44, name: "red_gold_green_circle" }, { effect: "gradient", animation_data: [[255,0,0],[255,255,255]], speed: 30, name: "red_white_gradient" }, { effect: "breath", animation_data: [ [255,0,0],[255,0,0],[255,0,0],[255,0,0],[255,0,0], [0,160,0],[0,160,0],[0,160,0],[0,160,0],[0,160,0], [255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255], [255,0,0],[255,0,0],[255,0,0],[0,160,0],[0,160,0], [255,255,255],[255,255,255],[255,255,255],[0,160,0],[255,0,0] ], speed: 28, name: "wreath_sparkle_breath" } ]Your effects may be different. It's easy to spot them or create specific effects via your favorite AI model. This has no funky effect built in, so I have to send segments, that will then be animated by the Home Assistant integration. I have a Govee Light on the front that just need an effect name and it's driven by the same logic in a different rule.
Then, just define a script action to select an item and set the appropriate payload for home assistant:
current = ((current ?? -1) + 1) % len(playlist), effect = playlist[current], sdata = { "entity_id": "light.led_terrazzo_led_strip", "animation_data": effect.animation_data, "effect": effect.effect, "speed": effect.speed }and another entity action to send the x_hass_call.service and your
sdatato the corresponding service, usuallyligth.turn_on. Enjoy local playlists
