How to toggle WLED on/off?

I want to have a button that can toggle power to my WLED strip, which seems like a basic function but I can’t work out how to do it.

My WLED controller with 2 presets. #1 has the entire strip as a single segment and #2 has it as multiple segments.

image

It seems that when the strip is a single segment I need to use the entity light.wled to toggle power. However when using the segmented preset, I need to use light.wled_main to toggle the entire strip (light.wled just turns off the first segment in this case). Is this a bug?

Does the integration not support a general on/off switch? Is there a custom component that can save me? Or do I need to manually interact with the API of the controller?

1 Like

Ran into this issue myself. The playlist I used has any number of segments and the entity that needed to be toggled changes between presets.

Ultimately, I ended up using HA to load a preset in WLED that toggled the power from inside the light. If you don’t already have a preset to do that, you can make one by entering the command T=0 into the presets “API command” field. Uncheck “Use current state” if you don’t see the “API command” field when creating the preset in WLED.

2 Likes

Thanks for sharing your solution. I should have come back to this, in the end the way I solved it was by putting the ‘WLED’ and ‘Main’ entities in a group.

2 Likes

For me this worked:
WLED integration → Configure → Keep master light if there is only 1 segment

1 Like

I hadn’t seen that option, is it new? It seems to make “main” that master toggle and the “wled” toggle do nothing. I will have a play around with the behaviour with this toggle on but might change from my group to this solution. I still don’t really understand why there are separate toggles but at least it can be made usable.

I don’t know for how long it has been there, but I currently use it no matter if i have segments or not, because the switches are more predictable.
For me it works like this:

  • The “main” light switch always toggles the whole LED strip
  • Whe “wled”or similar light switch toggles the first segment (default name “Segment 0” in WLED)
  • Every other segment is a light switch named “Segment 1”, “Segment 2” etc.

grafik
In the image, the first segment is yellow, the second is red, the third is not available. However, the whole LED strip is turned off, because main is off. If i turn main on, both segment will light up too.