tested it:
button 1, 2 and 3 have working on/off and dimming works as supposed.
Double click however acts as short press.
Button 4 has working on/off.
Dimming does nothing
Double click however acts as short press.
Did not retest zha, i assume nothing changes there?
Can you check if the Z2M shows the correct actions for the button 4 long press?
brightness_move_up_bottom_right (when holding from off or alternating up)
brightness_move_down_bottom_right (when holding from on or alternating down)
brightness_stop_bottom_right (when releasing)
As the code is exactly the same for buttons 1/2/3 and 4, so it should respond the same, unless something is wrong in the Z2M implementation.
Double click I have found where it went wrong, so I can fix that.
it seems there is something wrong there indeed.
If i go to the device in HA and i press all actions on button 1, 2 and 3.
I see (for example):
V-1 - mancave - schakelaar Action changed to brightness_stop_bottom_left
11:53:19 AM - Now
V-1 - mancave - schakelaar Action
11:53:17 AM - 2 seconds ago
V-1 - mancave - schakelaar Action changed to brightness_move_up_bottom_left
if i do this with button 4, i can get the single clicks to work, but i see no logs for the brightness
Gonna try to find out where i can test this in dev options
New Update Available (2026.01.6)
Fix double-click detection and prevent MQTT mistriggers
Whatâs Fixed:
- Double-click detection now works correctly (was being interpreted as short presses)
- MQTT value_template filter added to wait_for_trigger to prevent spurious triggers from battery/linkquality updates
- Refactored second trigger parsing to directly extract action and button number with explicit matching
- Eliminated startswith/endswith pattern matching on raw MQTT payload data
- Cleaner variable naming by removing unnecessary intermediate second_command variable
Upgrade Instructions:
- Simply re-import the blueprint and reload Automations
- All changes are backward compatible
Hmm, that is interesting to see. So it might be a bug in the Z2M implementation itself. Would need to check the code in there if there is something not logical in there. Please let me know if you find anything else about that.
I have released a new update just now for the double press, can you check that again?
tested the double clicks, seems to not work yet
It is strange, as it works without issues for my 1-button version.
Can you check if you actually see alternating on/off within the button/Z2M logs for the specific button? First when tapping slowly and then faster double tapping.
1 double press on a button gives the following activity:
V-1 - mancave - schakelaar Action
11:59:04 AM - In 1 second
V-1 - mancave - schakelaar Action changed to off_top_left
11:59:04 AM - In 1 second
V-1 - mancave - schakelaar Action
11:59:03 AM - Now
V-1 - mancave - schakelaar Action changed to on_top_left
11:59:03 AM - Now
1 click gives:
V-1 - mancave - schakelaar Action
11:59:35 AM - Now
V-1 - mancave - schakelaar Action changed to on_top_left
11:59:35 AM - Now
since 2 days there is an mqqt update, i can update it?
If you want we can go in a teams/zoom call or something alike and we can live test it?
I always keep my Z2M up-to-date. I can see there was an edit 3 weeks ago in the niko.ts file (Z2M drivers for devices), so this should be in the lateste update. Can you update and check again?
The current niko.ts shows the same implementation for button 2/3/4 so they should respond the same way.
Iâm not interested in an online meeting, so letâs keep it on the forum.
updated z2m.
Double click does not work
Did you check the dimming for button 4?
yes this triggers no activity
New Update Available (2026.01.7)
Increase double-click timeout default for Z2M compatibility
Whatâs Changed:
- Default double-press timeout increased from 300ms to 500ms for better Z2M compatibility
- Added guidance for Z2M users who may need 700-1000ms due to MQTT protocol latency
- Technical explanation added to version history about ZHA vs Z2M latency differences
Upgrade Instructions:
- Simply re-import the blueprint and reload Automations
- If double-press still not working reliably on Z2M, increase the timeout in your automation settings to 700-1000ms
Please update and try the double tap again. You can also test the rest.
Since buttons 1-3 dimming works fine, letâs identify why button 4 doesnât:
Step 1: Verify Z2M is Publishing the Actions
Enable MQTT logging to see raw messages:
- Open Home Assistant â Settings â Devices & Services â MQTT
- Click Configure â Enable debug logging
- Long-press button 4 (hold for 2-3 seconds to trigger dimming)
- Go to Settings â System â Logs
- Look for MQTT messages like:
Topic: zigbee2mqtt/[your-switch-name]
Payload: {"action": "brightness_move_up_bottom_right", ...}
Expected actions for button 4:
- Long press:
brightness_move_up_bottom_right or brightness_move_down_bottom_right
- Release:
brightness_stop_bottom_right
If you donât see these messages: The switch might not be sending them (firmware issue or device problem)
Step 2: Compare with Button 1 (Working)
With MQTT logging still enabled:
- Long-press button 1 â check logs for action name
- Long-press button 4 â check logs for action name
- Compare the two
Expected:
- Button 1:
brightness_move_up_top_left
- Button 4:
brightness_move_up_bottom_right
Step 3: Check Automation Trace
- Settings â Automations â Your Niko automation â ⎠â Traces
- Long-press button 4 â click latest trace
- Look at Variables section for
command value
Expected: command: "button_4_brightness_move_up"
Please share:
- MQTT payload from Step 1 (exact action name for button 4)
- Screenshot of automation trace showing
command variable
- Does button 1 MQTT action appear in logs? (Step 2)
This will show if the issue is Z2M not sending the action, or the blueprint not processing it correctly!
enabled debugging log.
Since that moment the dim function on the bottom right works (button 4).
Disabled debugging and it keeps working.
Double click did not work.
Adjusted the slider from 500ms to 1000ms, but this doesnât work either
Iâm thinking maybe something in your HA/MQTT was stuck somehow with the button_4 dimming response not registering correctly.
As that part is fixed I only need to figure out why your double tap still doesnât work. So the rest is working correctly right?
All features work ok with ZHA right? Could you check again, as there were some changes to some logic and for me the 1-button works on Z2M and ZHA without issues.
i retested both zha as z2m (only lights)
Z2m:
- button1
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 37% and then i was able to get it to go down till 2%, or second example started at 100% abel to go down till 66% (in ha, but light stayed the same brightness in real world) and able to get back up til 99%
- double click doesnât work the double click action does enforces the single press action.
- button 2
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 64% and then i was able to get it to go down till 31%
- double click doesnât work the double click action does enforces the single press action.
- button 3
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 61% and then i was able to get it to go down till 0%
- double click doesnât work the double click action does enforces the single press action.
- button 4
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 42% and then i was able to get it to go down till 5%
- double click doesnât work the double click action does enforces the single press action.
Zha:
- button1
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 38% and then i was able to get it to go down till 16%
- double click works
- button 2
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 69% and then i was able to get it to go down till 0%
- double click works
- button 3
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 76% and then i was able to get it to go down till 23%
- double click works
- button 4
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 36% and then i was able to get it to go down till 3% (i tested directly after again, then i went up till 28% and down to 1%)
- double click works
New Update Available (2026.01.8)
Fix random dimming stops and improve trace debugging
BREAKING CHANGE: This version requires a new input_text helper for double-click guard functionality.
Whatâs Fixed:
- Random dimming stops when holding multiple buttons simultaneously
- Double-click mistriggers where second press also executes as single press
- Triple-press causing both single and double actions to trigger
Whatâs New:
- Helper-based guard system distinguishes between buttons while preventing double-execution
- Automatic double-press timeout based on integration (ZHA: 300ms, Z2M: 600ms)
- Button-specific stop flags isolate each buttonâs dimming operation in queued mode
- Flat on/off handlers with descriptive aliases for clearer trace debugging
- Reorganized input order for better configuration flow
Upgrade Instructions:
- Create an input_text helper (see blueprint âText Helper Configurationâ section for instructions)
- Re-import the blueprint
- Add the helper to your automation configuration
- Reload automations
re-imported the blueprint, reloaded all yaml.
Created the input helper and assigned it to the existing automations.
Reloaded al yaml again.
results are the same:
Z2m:
- button1
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 37% and then i was able to get it to go down till 2%, or second example started at 100% abel to go down till 66% (in ha, but light stayed the same brightness in real world) and able to get back up til 99%
- double click doesnât work the double click action does enforces the single press action.
- button 2
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 64% and then i was able to get it to go down till 31%
- double click doesnât work the double click action does enforces the single press action.
- button 3
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 61% and then i was able to get it to go down till 0%
- double click doesnât work the double click action does enforces the single press action.
- button 4
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 42% and then i was able to get it to go down till 5%
- double click doesnât work the double click action does enforces the single press action.
Zha:
- button1
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 38% and then i was able to get it to go down till 16%
- double click works
- button 2
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 69% and then i was able to get it to go down till 0%
- double click works
- button 3
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 76% and then i was able to get it to go down till 23%
- double click works
- button 4
- toggle on/off works
- dim function works, but i noticed that most of the time it doesnât go fully to 100% or to 0%, it stops at random %) for example, when started at 0% it went up to 36% and then i was able to get it to go down till 3% (i tested directly after again, then i went up till 28% and down to 1%)
- double click works