You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the latest WLED version (16.0.0) in the action button presets each button is labeled wrong and or erroneously
push/switch is single press
short is long press
long is double press
To Reproduce Bug
Set presets, push button
Expected Behavior
push/switch is single press -> should be labelled as press
short is long press -> should be labelled as long press
long is double press -> should be labelled as double press
Install Method
Binary from WLED.me
What version of WLED?
WLED 16.0.0 (2605030)
Which microcontroller/board are you seeing the problem on?
@coderabbitai please compare the related source code of the main and 0_15_x branch. Is the reported behaviour a regression since release 0.15.4? If yes, what is the root cause?
The issue body seems missing. Let me fetch more details.
🏁 Script executed:
#!/bin/bash
# Fetch the full issue body
gh api repos/wled/WLED/issues/5613 | jq '{title, body, labels: [.labels[].name], state}'
# Also fetch all comments
gh api repos/wled/WLED/issues/5613/comments | jq '.[] | {user: .user.login, body}'
Length of output: 1289
Now I understand the issue. Let me search for the button label source code in both branches.
🏁 Script executed:
#!/bin/bash
# Find files related to button labels in main branch
echo "=== Files with button-related label strings ==="
gh api repos/wled/WLED/git/trees/main?recursive=1 | jq -r '.tree[].path' | grep -iE '(button|btn)' | head -40
echo ""
echo "=== Searching for button action label strings in main branch ==="
# Check the main wled.h or button.cpp files
for f in $(gh api repos/wled/WLED/git/trees/main?recursive=1 | jq -r '.tree[].path' | grep -iE '\.(cpp|h|js|htm|html)$' | grep -iE '(button|btn|usermods)'); do
echo "FILE: $f"
done
Length of output: 5320
🏁 Script executed:
#!/bin/bash
# Find all web/HTML/JS files in the repo
echo "=== Web/HTML/JS files ==="
gh api repos/wled/WLED/git/trees/main?recursive=1 | jq -r '.tree[].path' | grep -iE '\.(htm|html|js)$' | grep -v usermod | head -30
echo ""
echo "=== button.cpp in main branch ==="
gh api repos/wled/WLED/contents/wled00/button.cpp?ref=main | jq -r '.content' | base64 -d
echo ""
echo "=== button.cpp in 0_15_x branch ==="
gh api repos/wled/WLED/contents/wled00/button.cpp?ref=0_15_x | jq -r '.content' | base64 -d
Length of output: 32704
The button logic is the same. The bug is in the UI labels. Let me check the settings HTML files.
🏁 Script executed:
#!/bin/bash
# List all settings-related htm files
echo "=== Settings HTM files in main ==="
gh api repos/wled/WLED/git/trees/main?recursive=1 | jq -r '.tree[].path' | grep -i settings
echo ""
echo "=== Check settings.htm in main for button label strings ==="
gh api repos/wled/WLED/contents/wled00/data/settings.htm?ref=main | jq -r '.content' | base64 -d | grep -n -i -E "(push|switch|short|long|double|press|macroButton|macro)" | head -60
echo ""
echo "=== Check settings.htm in 0_15_x for button label strings ==="
gh api repos/wled/WLED/contents/wled00/data/settings.htm?ref=0_15_x | jq -r '.content' | base64 -d | grep -n -i -E "(push|switch|short|long|double|press|macroButton|macro)" | head -60
Length of output: 808
🏁 Script executed:
#!/bin/bash
echo "=== settings_time.htm in main - button/macro label strings ==="
gh api repos/wled/WLED/contents/wled00/data/settings_time.htm?ref=main | jq -r '.content' | base64 -d | grep -n -i -E "(push|switch|short|long|double|press|macro|button|btn|label|M1|M2|M3|Action)" | head -80
echo ""
echo "=== settings_time.htm in 0_15_x - button/macro label strings ==="
gh api repos/wled/WLED/contents/wled00/data/settings_time.htm?ref=0_15_x | jq -r '.content' | base64 -d | grep -n -i -E "(push|switch|short|long|double|press|macro|button|btn|label|M1|M2|M3|Action)" | head -80
Length of output: 3572
🏁 Script executed:
#!/bin/bash
echo "=== settings_time.htm in main - full button block JS (lines 230-290) ==="
gh api repos/wled/WLED/contents/wled00/data/settings_time.htm?ref=main | jq -r '.content' | base64 -d | sed -n '220,295p'
echo ""
echo "=== settings_time.htm in 0_15_x - full button block JS (lines 80-130) ==="
gh api repos/wled/WLED/contents/wled00/data/settings_time.htm?ref=0_15_x | jq -r '.content' | base64 -d | sed -n '75,130p'
Length of output: 4974
@softhack007 — Yes, this is a confirmed regression in the main branch. Here's the detailed analysis:
Root Cause Analysis
Variable Mapping (identical in both branches)
In settings_time.htm, the addRow(i, p, l, d) function maps the three macro selects the same way in both branches:
macroLongPress = long press (push button) / off→on (switch)
MD${b}
d
macroDoublePress = double press (push button)
Labels in 0_15_x — ✅ Correct
The old table layout had 4 header columns for 4 data cells (Button label + 3 macros):
Header col 0
Header col 1
Header col 2
Header col 3
push / switch
short / on→off
long / off→on
double / N/A
Button i: (label)
MP (press) ✓
ML (long press) ✓
MD (double press) ✓
The first header cell (push/switch) was effectively the column header for the row label ("Button i:"). Each macro input was correctly labelled: short → MP, long → ML, double → MD.
Labels in main — ❌ Incorrect (regression)
When the UI was refactored from a table to a block/card layout in main, the labels were reassigned incorrectly (settings_time.htm, ~lines 258–266):
The 2nd and 3rd labels are wrong. When the old table header was adapted into per-field labels, the logic shifted by one — the push/switch column header (which referred to the row identifier, not a macro) was incorrectly turned into the first macro's label, cascading the remaining labels onto the wrong fields.
Observed User Impact
What user sees
Underlying select
What it actually controls
Push/Switch
MP
✅ Short press / on→off for switch
Short (on→off)
ML
❌ Actually long press / off→on for switch
Long (off→on)
MD
❌ Actually double press
This exactly matches the bug report: "short is long press" and "long is double press".
Suggested Fix in wled00/data/settings_time.htm (main)
#!/bin/bash
# Get the git log for settings_time.htm on main branch to find the regression commit
gh api "repos/wled/WLED/commits?path=wled00/data/settings_time.htm&sha=main&per_page=20" \
| jq -r '.[] | "\(.sha[0:12]) \(.commit.author.date[0:10]) \(.commit.author.name): \(.commit.message | split("\n")[0])"'
Length of output: 1481
🏁 Script executed:
#!/bin/bash
echo "=== Diff for 14bd5d615baf (UI readability improvements) ==="
gh api repos/wled/WLED/commits/14bd5d615baf | jq -r '.files[] | select(.filename == "wled00/data/settings_time.htm") | .patch' 2>/dev/null | head -120
echo ""
echo "=== Diff for 4a6ff64519fe (more macro/timer slots) ==="
gh api repos/wled/WLED/commits/4a6ff64519fe | jq -r '.files[] | select(.filename == "wled00/data/settings_time.htm") | .patch' 2>/dev/null | head -120
Length of output: 8961
🏁 Script executed:
#!/bin/bash
echo "=== addRow function diff in 4a6ff64519fe ==="
gh api repos/wled/WLED/commits/4a6ff64519fe | jq -r '.files[] | select(.filename == "wled00/data/settings_time.htm") | .patch' 2>/dev/null | grep -A 5 -B 5 -i "addRow\|Short\|Long\|Double\|Push\|Switch\|label\|ML\|MP\|MD" | head -100
echo ""
echo "=== addRow function diff in 14bd5d615baf ==="
gh api repos/wled/WLED/commits/14bd5d615baf | jq -r '.files[] | select(.filename == "wled00/data/settings_time.htm") | .patch' 2>/dev/null | grep -A 5 -B 5 -i "addRow\|Short\|Long\|Double\|Push\|Switch\|label\|ML\|MP\|MD" | head -100
echo ""
echo "=== addRow function diff in ceed494cf793 ==="
gh api repos/wled/WLED/commits/ceed494cf793 | jq -r '.files[] | select(.filename == "wled00/data/settings_time.htm") | .patch' 2>/dev/null | grep -A 5 -B 5 -i "addRow\|Short\|Long\|Double\|Push\|Switch\|label\|ML\|MP\|MD" | head -100
Length of output: 5120
🏁 Script executed:
#!/bin/bash
echo "=== Full patch for 4a6ff64519fe - lines mentioning label/addRow/rBPO/Short/Long/Double/Push ==="
gh api repos/wled/WLED/commits/4a6ff64519fe | jq -r '.files[] | select(.filename == "wled00/data/settings_time.htm") | .patch' 2>/dev/null | grep -n "addRow\|rBPO\|label\|Short\|Long\|Double\|Push\|Switch\|select name\|MP\|ML\|MD" | head -80
echo ""
echo "=== State of addRow function AFTER 4a6ff64519fe (current main) ==="
gh api repos/wled/WLED/contents/wled00/data/settings_time.htm?ref=4a6ff64519fe | jq -r '.content' | base64 -d | grep -n -A 30 "function addRow\|function rBPO"
echo ""
echo "=== State of addRow function BEFORE 4a6ff64519fe (parent commit 14bd5d615baf) ==="
gh api repos/wled/WLED/contents/wled00/data/settings_time.htm?ref=14bd5d615baf | jq -r '.content' | base64 -d | grep -n -A 30 "function addRow\|function rBPO"
Length of output: 5696
@softhack007 — The exact commit introducing the regression is pinpointed:
"add more macro/timer slots" (#5140) — 2026-03-29 by Benjam Welker
What changed
In that commit, the addRow() function was completely rewritten. The old code (in 14bd5d615baf) used a plain <table> with bare <input type="number"> fields — no inline labels, relying on the table's <thead> column headers for labelling:
The new code in 4a6ff64519fe switched to a block/card layout with <select> dropdowns and per-field <label> elements. The labels were taken from the old table's column headers but shifted by one position — the "Push/Switch" header (which described the button type row, not a macro action) was repurposed as the first macro's label, pushing all subsequent labels onto the wrong field:
// AFTER (4a6ff64519fe) — labels shifted off by one ❌<label>Push/Switch</label>→<selectname="MP${b}">// macroButton = short press ✅ (label is ambiguous but not wrong)<label>Short (on→off)</label>→<selectname="ML${b}">// macroLongPress = LONG press ❌<label>Long (off→on)</label>→<selectname="MD${b}">// macroDoublePress = DOUBLE press ❌
Suggested fix (same as before, now with confirmed commit context)
In wled00/data/settings_time.htm, lines ~262–267 of main:
This Info just saved my night. Was debugging endlessly when trying to trigger a playlist via PIR. Can confirm the bug. Changing to short switches correctly from off to on when motion is detected.
Activity
softhack007 commentedon May 14, 2026
@coderabbitai please compare the related source code of the
mainand0_15_xbranch. Is the reported behaviour a regression since release 0.15.4? If yes, what is the root cause?coderabbitai commentedon May 14, 2026
🧩 Analysis chain
Let me first read the issue and then compare the relevant source code between the branches.
🏁 Script executed:
Length of output: 254
The issue body seems missing. Let me fetch more details.
🏁 Script executed:
Length of output: 1289
Now I understand the issue. Let me search for the button label source code in both branches.
🏁 Script executed:
Length of output: 5320
🏁 Script executed:
Length of output: 32704
The button logic is the same. The bug is in the UI labels. Let me check the settings HTML files.
🏁 Script executed:
Length of output: 808
🏁 Script executed:
Length of output: 3572
🏁 Script executed:
Length of output: 4974
@softhack007— Yes, this is a confirmed regression in themainbranch. Here's the detailed analysis:Root Cause Analysis
Variable Mapping (identical in both branches)
In
settings_time.htm, theaddRow(i, p, l, d)function maps the three macro selects the same way in both branches:MP${b}pmacroButton= short/press (push button) / on→off (switch)ML${b}lmacroLongPress= long press (push button) / off→on (switch)MD${b}dmacroDoublePress= double press (push button)Labels in
0_15_x— ✅ CorrectThe old table layout had 4 header columns for 4 data cells (Button label + 3 macros):
push / switchshort / on→offlong / off→ondouble / N/AButton i:(label)MP(press) ✓ML(long press) ✓MD(double press) ✓The first header cell (
push/switch) was effectively the column header for the row label ("Button i:"). Each macro input was correctly labelled: short → MP, long → ML, double → MD.Labels in
main— ❌ Incorrect (regression)When the UI was refactored from a table to a block/card layout in
main, the labels were reassigned incorrectly (settings_time.htm, ~lines 258–266):The 2nd and 3rd labels are wrong. When the old table header was adapted into per-field labels, the logic shifted by one — the
push/switchcolumn header (which referred to the row identifier, not a macro) was incorrectly turned into the first macro's label, cascading the remaining labels onto the wrong fields.Observed User Impact
Push/SwitchMPShort (on→off)MLLong (off→on)MDThis exactly matches the bug report: "short is long press" and "long is double press".
Suggested Fix in
wled00/data/settings_time.htm(main)softhack007 commentedon May 14, 2026
@coderabbitai which commit introduced this regression?
coderabbitai commentedon May 14, 2026
🧩 Analysis chain
🏁 Script executed:
Length of output: 1481
🏁 Script executed:
Length of output: 8961
🏁 Script executed:
Length of output: 5120
🏁 Script executed:
Length of output: 5696
@softhack007— The exact commit introducing the regression is pinpointed:Regression introduced in commit
4a6ff64519feWhat changed
In that commit, the
addRow()function was completely rewritten. The old code (in14bd5d615baf) used a plain<table>with bare<input type="number">fields — no inline labels, relying on the table's<thead>column headers for labelling:The new code in
4a6ff64519feswitched to a block/card layout with<select>dropdowns and per-field<label>elements. The labels were taken from the old table's column headers but shifted by one position — the "Push/Switch" header (which described the button type row, not a macro action) was repurposed as the first macro's label, pushing all subsequent labels onto the wrong field:Suggested fix (same as before, now with confirmed commit context)
In
wled00/data/settings_time.htm, lines ~262–267 ofmain:<label>Push/Switch</label> <select name="MP${b}" class="s" required>${presetOpts}</select> - <label>Short (on→off)</label> + <label>Long (off→on)</label> <select name="ML${b}" class="s" required>${presetOpts}</select> - <label>Long (off→on)</label> + <label>Double press</label> <select name="MD${b}" class="s" required>${presetOpts}</select>This can be fixed directly in PR
#5140or as a follow-up patch.DedeHai commentedon May 14, 2026
@benjamw are you able to provide a fix?
mkdzabel commentedon May 17, 2026
This Info just saved my night. Was debugging endlessly when trying to trigger a playlist via PIR. Can confirm the bug. Changing to short switches correctly from off to on when motion is detected.
benjamw commentedon May 21, 2026
I'll get a fix in soon.
DedeHai commentedon Jun 1, 2026
@benjamw it was mentioned that analog buttons no longer work with the dropdowns, see https://kno.wled.ge/features/macros/#analog-button
can you please check if this is the case and open an issue (or a fix PR)?
DedeHai commentedon Jun 9, 2026
@benjamw in the macros I see this:
but I think it shold be "short press" , "long press", "double press". can you check?
benjamw commentedon Jun 10, 2026
I've added more to the PR. Try again. This is what I'm seeing:
benjamw commentedon Jun 10, 2026
What branch are you looking at? My fix PR for this issue went into
main.My new PR for the updated analog buttons also is based off of
main.DedeHai commentedon Jun 10, 2026
I was looking at 16.0, forgot you already made some updates