node-red-contrib-huemagic: Hue wall switch module outputs wrong payload when set to rocker_switch mode

Describe the bug

When set to “rocker switch” mode in the hue app, the wall switch module outputs the payload sequence of a “push button” configuration. After only a single flick of the switch into either position, the Hue Buttons node outputs two separate payloads within a fraction of a second:

  1. payload.action: "left_press"
  2. payload.action: "left_press_release" (although there is no release on a rocker switch when you flick it into a position)

(notice, that this is the output sequence of a button press where you press the button down and release it after a certain time)

This output sequence is the same for both switch positions (on/off), which makes it unusable as a switch since you can not distingush if the switch is in “on” or “off” position.

Flow to Reproduce

[{"id":"9eaae750d4d6e0cf","type":"debug","z":"85268a1e5cd5777d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":2140,"wires":[]},{"id":"ab22d126097e7535","type":"hue-buttons","z":"85268a1e5cd5777d","name":"Hue wall switch module (set to rocker switch mode in app)","bridge":"3aef7858e3c99604","sensorid":"","skipevents":false,"initevents":false,"x":370,"y":2140,"wires":[["9eaae750d4d6e0cf"]]},{"id":"3aef7858e3c99604","type":"hue-bridge","name":"Hue-Holz Bridge","bridge":"192.168.188.55","key":"CgjlJYm7GTqPwJRlSVPn6JmdYNLw6Cu9r2od3f2R","worker":"100","disableupdates":false}]

Expected behavior

Hue Buttons node should output payloads, that distinguish between the two possible positions of a rocker switch

For the first channel

Flick the left switch into “off” position - payload.action: left_off Flick the left switch into “on” position - payload.action: left_on

For the second channel:

Flick the right switch into “off” position - payload.action: right_off Flick the right switch into “on” position - payload.action: right_on

Screenshots

This is the output for a single flick into “on” position: image

This for a single flick into “off” position: image

Please complete the following information:

  • Node-RED version: 10.0.0
  • NodeJS version: ?
  • Device running Node-RED: Home Assistant 2022.2.6 in VM on Synology NAS-916

Additional context

Before writing this issue I tried to find my own solution to this problem. This involved paring a hue wall switch to my Dresden-Elektronik Conbee II Zigbee Coordinator with Zigbee2MQTT. There I encountered the exact same problem and wrote a issue on this topic aswell:

https://github.com/Koenkk/zigbee2mqtt/issues/11727

During my research I found another Thread where the same issue was mentioned:

https://discourse.nodered.org/t/hue-wall-switch-sends-on-and-off-status-at-every-toggle/55856

About this issue

Most upvoted comments

I’m facing exactly the same issue. Did you find a solution by chance?