I’m trying to populate an input_select with the list of possible effects in WLED. I can test this code in the template editor and it works as expected, however the duplicate RSVD entries cause the automation to fail with the error below. Can anyone assist me with either a better way to do this or a solution that excludes the duplicates.
{% set wled_effects = namespace(effect_name=[]) %}
{%- for effect_list in state_attr('light.wled_home_1', 'effect_list') -%}
{%- set wled_effects.effect_name = state_attr('light.wled_home_1', 'effect_list') -%}
{%- endfor -%}
{{wled_effects.effect_name}}
The error reported in the trace timeline is:
Stopped because an error was encountered at August 22, 2023 at 8:12:00 PM (runtime: 0.03 seconds)
Duplicated options: ['Akemi', 'Android', 'Aurora', 'Black Hole', 'Blends', 'Blink', 'Blink Rainbow', 'Blobs', 'Blurz', 'Bouncing Balls', 'Bpm', 'Breathe', 'Candle', 'Candle Multi', 'Chase', 'Chase 2', 'Chase 3', 'Chase Flash', 'Chase Flash Rnd', 'Chase Rainbow', 'Chase Random', 'Chunchun', 'Colored Bursts', 'Colorful', 'Colorloop', 'Colortwinkles', 'Colorwaves', 'Crazy Bees', 'DJ Light', 'DNA', 'DNA Spiral', 'Dancing Shadows', 'Dissolve', 'Dissolve Rnd', 'Distortion Waves', 'Drift', 'Drift Rose', 'Drip', 'Dynamic', 'Dynamic Smooth', 'Fade', 'Fairy', 'Fairytwinkle', 'Fill Noise', 'Fire 2012', 'Fire Flicker', 'Firenoise', 'Fireworks', 'Fireworks 1D', 'Fireworks Starburst', 'Flow', 'Flow Stripe', 'Freqmap', 'Freqmatrix', 'Freqpixels', 'Freqwave', 'Frizzles', 'Funky Plank', 'GEQ', 'Game Of Life', 'Ghost Rider', 'Glitter', 'Gradient', 'Gravcenter', 'Gravcentric', 'Gravfreq', 'Gravimeter', 'Halloween Eyes', 'Heartbeat', 'Hiphotic', 'ICU', 'Juggle', 'Juggles', 'Julia', 'Lake', 'Lighthouse', 'Lightning', 'Lissajous', 'Loading', 'Matripix', 'Matrix', 'Metaballs', 'Meteor', 'Meteor Smooth', 'Midnoise', 'Multi Comet', 'Noise 1', 'Noise 2', 'Noise 3', 'Noise 4', 'Noise Pal', 'Noise2D', 'Noisefire', 'Noisemeter', 'Noisemove', 'Octopus', 'Oscillate', 'Pacifica', 'Palette', 'Percent', 'Perlin Move', 'Phased', 'Phased Noise', 'Pixels', 'Pixelwave', 'Plasma', 'Plasma Ball', 'Plasmoid', 'Polar Lights', 'Popcorn', 'Pride 2015', 'Puddlepeak', 'Puddles', 'Pulser', 'RSVD', 'RSVD', 'RSVD', 'RSVD', 'RSVD', 'RSVD', 'RSVD', 'RSVD', 'RSVD', 'Railway', 'Rain', 'Rainbow', 'Rainbow Runner', 'Random Colors', 'Ripple', 'Ripple Peak', 'Ripple Rainbow', 'Rocktaves', 'Running', 'Running Dual', 'Saw', 'Scan', 'Scan Dual', 'Scanner', 'Scanner Dual', 'Scrolling Text', 'Sindots', 'Sine', 'Sinelon', 'Sinelon Dual', 'Sinelon Rainbow', 'Soap', 'Solid', 'Solid Glitter', 'Solid Pattern', 'Solid Pattern Tri', 'Spaceships', 'Sparkle', 'Sparkle Dark', 'Sparkle+', 'Spots', 'Spots Fade', 'Squared Swirl', 'Stream', 'Stream 2', 'Strobe', 'Strobe Mega', 'Strobe Rainbow', 'Sun Radiation', 'Sunrise', 'Sweep', 'Sweep Random', 'Swirl', 'TV Simulator', 'Tartan', 'Tetrix', 'Theater', 'Theater Rainbow', 'Traffic Light', 'Tri Fade', 'Tri Wipe', 'Twinkle', 'Twinklecat', 'Twinklefox', 'Twinkleup', 'Two Dots', 'Washing Machine', 'Waterfall', 'Waverly', 'Wavesins', 'Waving Cell', 'Wipe', 'Wipe Random']
I’m sure there is a simple solution, but I’m not having any luck at it right now.
For completeness here is the full attributes list from the states page:
effect_list: Akemi, Android, Aurora, Black Hole, Blends, Blink, Blink Rainbow, Blobs, Blurz, Bouncing Balls, Bpm, Breathe, Candle, Candle Multi, Chase, Chase 2, Chase 3, Chase Flash, Chase Flash Rnd, Chase Rainbow, Chase Random, Chunchun, Colored Bursts, Colorful, Colorloop, Colortwinkles, Colorwaves, Crazy Bees, DJ Light, DNA, DNA Spiral, Dancing Shadows, Dissolve, Dissolve Rnd, Distortion Waves, Drift, Drift Rose, Drip, Dynamic, Dynamic Smooth, Fade, Fairy, Fairytwinkle, Fill Noise, Fire 2012, Fire Flicker, Firenoise, Fireworks, Fireworks 1D, Fireworks Starburst, Flow, Flow Stripe, Freqmap, Freqmatrix, Freqpixels, Freqwave, Frizzles, Funky Plank, GEQ, Game Of Life, Ghost Rider, Glitter, Gradient, Gravcenter, Gravcentric, Gravfreq, Gravimeter, Halloween Eyes, Heartbeat, Hiphotic, ICU, Juggle, Juggles, Julia, Lake, Lighthouse, Lightning, Lissajous, Loading, Matripix, Matrix, Metaballs, Meteor, Meteor Smooth, Midnoise, Multi Comet, Noise 1, Noise 2, Noise 3, Noise 4, Noise Pal, Noise2D, Noisefire, Noisemeter, Noisemove, Octopus, Oscillate, Pacifica, Palette, Percent, Perlin Move, Phased, Phased Noise, Pixels, Pixelwave, Plasma, Plasma Ball, Plasmoid, Polar Lights, Popcorn, Pride 2015, Puddlepeak, Puddles, Pulser, RSVD, RSVD, RSVD, RSVD, RSVD, RSVD, RSVD, RSVD, RSVD, Railway, Rain, Rainbow, Rainbow Runner, Random Colors, Ripple, Ripple Peak, Ripple Rainbow, Rocktaves, Running, Running Dual, Saw, Scan, Scan Dual, Scanner, Scanner Dual, Scrolling Text, Sindots, Sine, Sinelon, Sinelon Dual, Sinelon Rainbow, Soap, Solid, Solid Glitter, Solid Pattern, Solid Pattern Tri, Spaceships, Sparkle, Sparkle Dark, Sparkle+, Spots, Spots Fade, Squared Swirl, Stream, Stream 2, Strobe, Strobe Mega, Strobe Rainbow, Sun Radiation, Sunrise, Sweep, Sweep Random, Swirl, TV Simulator, Tartan, Tetrix, Theater, Theater Rainbow, Traffic Light, Tri Fade, Tri Wipe, Twinkle, Twinklecat, Twinklefox, Twinkleup, Two Dots, Washing Machine, Waterfall, Waverly, Wavesins, Waving Cell, Wipe, Wipe Random
supported_color_modes: rgb
color_mode: rgb
brightness: 128
hs_color: 9.123, 67.059
rgb_color: 255, 110, 84
xy_color: 0.589, 0.329
effect: Solid
icon: mdi:led-strip-variant
friendly_name: WLED Home 1
supported_features: 36
Thanks in advance!