Home Assistant and WLED Presets

I’d like to add something since I’m not seeing it anywhere else. Doing this doesn’t require any custom cards. Just vanilla HA, HA helpers, HA automations and official wled integration.

You can use the state of an input select helper or input select integration (in config.yaml) then add helper to a card in lovelace to easily change the effect. Helpers can be used via automations on all wled attribute states that are available with service calls. Also input select helper state can be set from wled attribute state when effect is changed by some other means such as changing a preset or changing the effect in wled web ui. Again this can be done for all wled attributes exposed in home assistant.

Here are my automations for controlling wled. I made a separate one for each but I’m sure this could be done more elegantly.

alias: Set Effect
description: ''
trigger:
  - platform: state
    entity_id: input_select.effect
condition: []
action:
  - service: wled.effect
    data:
      effect: '{{ states("input_select.effect") }}'
    entity_id: light.wled
mode: single

alias: Set effect to dropdown
description: ''
trigger:
  - platform: state
    entity_id: light.wled
    attribute: effect
condition: []
action:
  - service: input_select.select_option
    data:
      option: '{{ state_attr("light.wled", "effect") }}'
    entity_id: input_select.effect
mode: single
alias: Set Intensity
description: ''
trigger:
  - platform: state
    entity_id: input_number.intensity
    for: '00:00:00'
condition: []
action:
  - service: wled.effect
    data:
      intensity: '{{ states("input_number.intensity") }}'
    entity_id: light.wled
mode: single
max: 10

alias: Set intensity to slider
description: ''
trigger:
  - platform: state
    entity_id: light.wled
    attribute: intensity
condition: []
action:
  - service: input_number.set_value
    entity_id: input_number.intensity
    data:
      value: '{{ state_attr("light.wled", "intensity") }}'
mode: single
alias: Set palette
description: ''
trigger:
  - platform: state
    entity_id: input_select.palette_list
    for: '00:00:00'
condition: []
action:
  - service: wled.effect
    data:
      palette: '{{ states("input_select.palette_list") }}'
    entity_id: light.wled
mode: single
alias: Set palette to dropdown
description: ''
trigger:
  - platform: state
    entity_id: light.wled
    attribute: palette
condition: []
action:
  - service: input_select.select_option
    data:
      option: '{{ state_attr("light.wled", "palette") }}'
    entity_id: input_select.palette_list
mode: single
alias: Set Preset
description: ''
trigger:
  - platform: state
    entity_id: input_select.preset
    for: '00:00:00'
condition: []
action:
  - service: wled.preset
    data:
      preset: '{{ states("input_select.preset") }}'
    entity_id: light.wled
mode: single
alias: Set preset to dropdown
description: ''
trigger:
  - platform: state
    entity_id: light.wled
    attribute: preset
condition: []
action:
  - service: input_select.select_option
    data:
      option: '{{ state_attr("light.wled", "preset") }}'
    entity_id: input_select.preset
mode: single
alias: Set Reverse
description: ''
trigger:
  - platform: state
    entity_id: input_boolean.reverse
    for: '00:00:00'
condition: []
action:
  - service: wled.effect
    data:
      reverse: '{{ states("input_boolean.reverse") }}'
    entity_id: light.wled
mode: single
alias: Set Speed
description: ''
trigger:
  - platform: state
    entity_id: input_number.speed
    for: '00:00:00'
condition: []
action:
  - service: wled.effect
    data:
      speed: '{{ states("input_number.speed") }}'
    entity_id: light.wled
mode: single
alias: Set speed to slider
description: ''
trigger:
  - platform: state
    entity_id: light.wled
    attribute: speed
condition: []
action:
  - service: input_number.set_value
    data:
      value: '{{ state_attr("light.wled", "speed") }}'
    entity_id: input_number.speed
mode: single
alias: Set Brightness
description: ''
trigger:
  - platform: state
    entity_id: input_number.brightness
condition: []
action:
  - service: light.turn_on
    data:
      brightness: '{{ states("input_number.brightness") }}'
    entity_id: light.wled
mode: single
alias: Set brightness to slider
description: ''
trigger:
  - platform: state
    entity_id: light.wled
condition: []
action:
  - service: input_number.set_value
    data:
      value: '{{ state_attr("light.wled", "brightness") }}'
    entity_id: input_number.brightness
mode: single