Trigger WLED patterns from a set of buttons

I’ve been going around in circles for a few days now and getting nowhere so I’ve run out of ideas and would like some help from the community.

I have 3 separate WLED controllers and I want to be able to select the presets on all of these with a single button press.

I have this setup with the help of a Mushroom Template card which calls a script as follows:

type: custom:mushroom-template-card
primary: Starter
secondary: ''
icon: mdi:led-strip
entity: input_boolean.starter
layout: vertical
icon_color: green
tap_action:
  action: call-service
  service: script.get_preset
  data:
    outerPreset: input_text.button_1_outer
    matrixPreset: input_text.button_1_matrix
    shelfPreset: input_text.button_1_shelf
  target: {}

The input text comes from a page I created where the presets can changed.

Script

alias: Get Preset
sequence:
  - service: select.select_option
    data:
      option: "{{ states(outerPreset) }}"
    target:
      entity_id: select.outer_lights_preset
  - service: select.select_option
    data:
      option: "{{ states(matrixPreset) }}"
    target:
      entity_id: select.ceiling_matrix_preset
  - service: select.select_option
    data:
      option: "{{ states(shelfPreset) }}"
    target:
      entity_id: select.bar_lights_preset
mode: single

This works just fine but I have more than one button and I want the currently selected button to be green and all the others to be red. Then when I select another pattern I want that to be green and all the others to be red.

This is what it currently looks like:
Screenshot 2023-01-09 145537

Would really appreciate some pointers on how to achieve this.

You can use templates also under

icon_color

with the mushroom template card

I used this on my PS5 MQTT card

icon_color: |-
  {% if is_state('switch.ps5_808_power', 'on') %}
    green
  {%- else -%}
   red
  {% endif %} 

hope that helps a little bit …You shoud be able to get the correct state from

states(matrixPreset)

might work … cannot check it myself right now

1 Like

Did it help?