Conversation
|
WIP, need some tests on real device (TBD soon) |
|
Hi, I have some questions:
|
|
If we rework this, we should definitely switch to the cleaner mqtt events (actions), like all other remotes from Z2M.
Not sure how it would affect the firmware, this is mostly about the converter / UX. There would be one 'action' field per device, so the possible values would include the gang (1,2,3,4) corresponding to the button pressed.
Double/triple initial-press and hold are overkill imo, but I'm not totally against them.. And for rocker switches it would be just We must also keep in mind what happens if multiple buttons are pressed at once. |
I add a test for that, at last release (passing 200 ms timeout) only the the max bp action will be fired
I though that a flash led on bp event should be nice, to see that event are fired. But we can simplify. |
fully agreed with that but I was not able to deduce impact for users... Too risky for me as I'm not very familiar with usage of this firmware. |
I just added a test for that |




Multi-press action reporting
Summary
Replaces the previous action-dispatch system (which hardcoded relay/binding actions per press count) with pure reporting: the firmware detects how many times a button was pressed and reports it as a multistate value. All automation logic lives in Z2M/ZHA.
This makes multi-press fully generic — supporting triple press (or more) requires zero firmware changes, just setting
max_press_count = 3via ZCL.New multistate values:
long_presssingle_presssingle_releasedouble_pressdouble_holddouble_releasetriple_pressmax_press_count=3)3n+1/3n+2/3n+3for n≥2New ZCL attributes (OnOff Switch Config cluster, per endpoint):
0xFF06confirm_release_ms— window after release before confirming press count (default 200 ms)0xFF07max_press_count— maximum press count to detect (default 2, set to 3 for triple-press)Both attributes are persisted in NVM and survive reboots.
Backward compatibility:
relay_mode,binded_mode, and the legacylong_press(value 2) are fully preserved.Changes
src/zigbee/switch_cluster.c— genericMULTISTATE_N_*formula, dynamicmultistate_num_of_states, removed action-dispatch systemsrc/zigbee/switch_cluster.h— removed 6 action fields, reducedattr_infos[16]→[10]src/zigbee/consts.h— removedSWITCH_ACTION_*enum andACTION_N_*attribute IDssrc/device_config/config_parser.c—Ihandler uses ordered counter for switch indicator assignment;relay_clustersassignment guarded byrelay_clusters_cnt > 0device_db.yaml—REMOTE_MOES_SWITCH_TS0044config_str updated (Stokens +BTC5)helper_scripts/templates/switch_custom.js.jinja— updatedpressActionlookup (up to triple press), addedconfirmReleaseMsandmaxPressCountconverter functionstests/— removed action-dispatch tests, addedsingle_press,double_press,triple_pressmultistate value tests