WLED integration, is it possible to select preset?

Is it possible to select a ‘preset’ from the WLED integration?
Or how do I set a full effect with two colors, effect, speed, etc.?
Can it be done from within or how do I accomplish this?

1 Like

@frenck Is it necessary to create a scene for doing this?

I am doing it via a restful_comand

  wled_front_left_c9:
    url: 'http://192.168.0.114/win&FP=48'
    method: POST
  wled_front_right_c9:
    url: 'http://192.168.0.115/win&FP=48'
    method: POST
2 Likes

Ok, that could be a way forward, I’ll experiment with that, thanks!

I did make it work, but decided against the presets, and just did one long API call with all the settings I want to set, that way it’s super easy to copy it to other wled lights.

yes, but…

‘with two colors’, no, or rather I haven’t figured out how to change secondary and tertiary colors with service calls. As far as I know it can’t yet be done. Can be done via mqtt, I think. Everything* else though can be done using service calls.

I do all of these with mqtt and can post the config if you are interested:

wled_lovelace

1 Like

Please do. I’d very much like to add mirror effect, preset cycle and secondary and tertiary color selection to my config. Guess mqtt is the only way to do those things right now. I’ll keep using integration and associated service calls for the rest though.

Well I have less functionality than you do here. I’m going to change over to your method :slight_smile:

But for completeness, I used Dr zzzzs configs, here: https://github.com/Snipercaine/WLED-HomeAssistant

1 Like

:smile:

I also made a simple ‘preset cycle’ toggle with this automation. Can’t set the transition time though.

alias: Preset Cycle Automation
description: ''
trigger:
  - platform: state
    entity_id: input_boolean.preset_cycle
  - platform: state
    entity_id: timer.time_per_preset
    from: active
    to: idle
condition:
  - condition: state
    entity_id: input_boolean.preset_cycle
    state: 'on'
action:
  - service: input_select.select_next
    data: {}
    entity_id: input_select.preset
  - service: timer.start
    data: {}
    entity_id: timer.time_per_preset
mode: single

1 Like

The random button on my card calls a script with this service:

  - service: wled.effect
    data:
      entity_id: light.bar_led_strip
      effect: "{{ state_attr('light.bar_led_strip', 'effect_list') | random }}"
      palette: "{{ (range(0, 50)|random) }}"
      speed: "{{ (range(0, 255)|random) }}"
      intensity: "{{ (range(0, 255)|random) }}"

i get this error when i try your random service call :thinking:

[139635203020112] extra keys not allowed @ data['preset']
[139635480113840] expected int for dictionary value @ data['speed']
[139635480113840] expected int for dictionary value @ data['intensity']
[139635279281648] expected int for dictionary value @ data['speed']

this is what i’m trying to do:

type: button
tap_action:
  action: call-service
  service: wled.effect
  service_data:
    entity_id: light.garden_wled
    effect: "{{ state_attr('light.garden_wled', 'effect_list') | random }}"
    palette: "{{ (range(0, 50)|random) }}"
    speed: "{{ (range(0, 255)|random) }}"
    intensity: "{{ (range(0, 255)|random) }}"
entity: light.garden_wled

Try putting it in a script and calling that from the button.