I have created a number of buttons for a custom NS Panel where each button press will instruct 3 WLED controllers to load some presets. Each preset can be individual so and I have 6 buttons in total giving 18 values to change. I want to be able to store these values in a single location to make it easy to update them. I have tired creating YAML lists but no matter what I try I get config errors.
Here is the first button:
# Button 1
- platform: template
switches:
bar_cp_button10:
turn_on:
service: select.select_option
data:
entity_id: select.bar_lights_preset
option: Fireworks
turn_off:
service: esphome.the_bar_nspanel_play_rtttl
data:
song_str: scale_up:d=32,o=5,b=100:e
bar_cp_button11:
turn_on:
service: select.select_option
data:
entity_id: select.outer_lights_preset
option: Spiral
turn_off:
service: esphome.the_bar_nspanel_play_rtttl
data:
song_str: scale_up:d=32,o=5,b=100:f#
bar_cp_button12:
turn_on:
service: select.select_option
data:
entity_id: select.ceiling_matrix_preset
option: Frizzles
turn_off:
service: esphome.the_bar_nspanel_play_rtttl
data:
song_str: scale_up:d=32,o=5,b=100:e
On this button the 3 options are set to Fireworks, Spiral and Frizzles. What ideally I want is to create a list like this:
variables:
presets:
- ctr1.button1: Fireworks
- ctrl1.button2: Spiral
- ctrl1.button3: Frizzles
- ctrl2.button1: Another Preset
etc…
And then to be able to write a button like this:
bar_cp_button10:
turn_on:
service: select.select_option
data:
entity_id: select.bar_lights_preset
option: ctr1.button1
Is this possible?