Hi all,
I ran into something confusing and wanted to check whether it’s intended behavior or a bug worth reporting.
Symptom
My strip stayed dark and nothing I changed in the UI (effect, color, palette) had any visible effect, even though global power was on. /json/state showed the cause: global "on":true, but the only segment was off:
"on": true, "bri": 177,
"seg": [{ "id": 0, "start": 0, "stop": 150, "on": false, "bri": 255, ... }]
The Segments tab only shows the (un)Freeze icon and the segment name. There is no ⏻ toggle, not even when the segment is expanded. I had to turn it back on through the JSON API:
curl -X POST http://<ip>/json/state -d '{"seg":[{"id":0,"on":true}]}'
What I found in the code
wled00/data/index.js, populateSegments() (the same code is in 0.15.3, v16.0.1 and main):
if (segCount < 2) {
gId(`segd${lSeg}`).classList.add("hide"); // hide delete if only one segment
if (parseInt(gId("seg0bri").value)==255) gId(`segp0`).classList.add("hide");
So with a single segment at bri 255, the whole segment power/brightness row is hidden, and the check doesn’t consider whether the segment is on. I understand why the row is hidden (global controls are enough with one segment), but when that segment is off, the UI offers no way to recover.
Reproduce
curl -X POST http://<ip>/json/state -d '{"on":true,"seg":[{"id":0,"on":false,"bri":255}]}'
Then open the UI → Segments: the strip is dark and there’s no control to turn segment 0 back on.
How the segment got turned off
I don’t know for sure. Several clients control this WLED:
- Home Assistant (WLED integration)
- Hyperion (ambilight with Kodi, WLED device in realtime/UDP mode)
My guess is Hyperion, since its WLED device can switch segments on and off and restore state when streaming starts or stops, but I haven’t confirmed it. Has anyone seen Hyperion or HA leave a segment on:false like this?
Questions
-
Is hiding the segment power row in this situation intended?
-
If not, would something like this be acceptable as a fix (only hide the row when the segment is on)?
if (parseInt(gId("seg0bri").value)==255 && s.seg[0].on) gId(`segp0`).classList.add("hide");Or should global power-on also turn on segments when all of them are off?
If this is confirmed as a bug, I’m happy to open a GitHub issue.
Setup: WLED 0.15.3 (build 2508020), ESP32 (Gledopto), 150 LEDs, single segment.
Workaround for anyone hitting this: set the segment brightness to 254 instead of 255. The power row then stays visible.