[Edge] IKEA RODRET, SOMRIG and SYMFONISK Gen 2 Button Edge Driver

Editing this, was too long. I’ve found a firmware bug in SOMRIG which will generate ghost events, more especifically single-taps or double-taps that should not be there.

Steps to replicate (all within a second):

  • Hold button
  • Release button
  • Push button

Expected outcome: a Held event and then a Pressed
Actual outcome: a Held event and a Double-Pressed instead :ghost:

Sometimes happens due to a bad debouncing when you are naturally releasing a button after held, especially if it’s a long-press.

A double-tap (0x06) milliseconds after releasing the button (0x04) should be impossible, yet…

2024-03-29T06:45:26.154339567Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x04
...
2024-03-29T06:45:26.414914401Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06

For reference, this is an actual double-tap:

2024-03-29T06:46:23.249518199Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x01
...
2024-03-29T06:46:23.968267491Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06

It’s either a bug or an undocumented feature but the only way to know if it’s a ghost or not is looking at the times of past events. If it follows a 0x04 (release) it’s a ghost because a physical double-tap goes after a 0x01 (first press).

I’ve implemented a detection for this condition and called the feature ghostbuster :sweat_smile: It’s not published yet, there is more to it.

The basic detection works:

2024-03-29T09:25:47.703228578Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x04
...
2024-03-29T09:25:47.832453078Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06
2024-03-29T09:25:47.844944620Z DEBUG Ikea Button Tweaks  Ghost event suppressed

But I kept pushing it and SOMRIG went crazy. Definitely lacks a proper debouncing. The following are all ghosts pressing the button just on the edge of making contact but, of course, the easy one to tell is the first one. Three “real” double taps in 300 milliseconds? Not even humanly possible. That can’t be fixed without hurting the multi-tap feature. Suppressing the ghost after release (0x04) is enough most of the time, just press it correctly and release it at once :rofl:

2024-03-29T14:12:28.883254080Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x04
2024-03-29T14:12:29.259461330Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06
2024-03-29T14:12:29.264718663Z DEBUG Ikea Button Tweaks  Ghost event suppressed
2024-03-29T14:12:29.350493997Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x01
2024-03-29T14:12:30.641151914Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06
2024-03-29T14:12:31.429520830Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x01
2024-03-29T14:12:31.883491497Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06
2024-03-29T14:12:32.473570206Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x01
2024-03-29T14:12:33.033568622Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06
2024-03-29T14:12:33.311863247Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x01
2024-03-29T14:12:33.391921914Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06
2024-03-29T14:12:33.519071122Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x01
2024-03-29T14:12:33.579496914Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06
2024-03-29T14:12:33.647150622Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x01
2024-03-29T14:12:33.692385164Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06

Just for fun I’m working on the ultimate ghostbuster, that unfortunately does not catch 100% of the ghost presses but it is way smarter to detect a ghost chain of events if the ghosts wreak havok:

2024-03-30T06:53:39.407711865Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x04
2024-03-30T06:53:39.749051324Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06
2024-03-30T06:53:39.767688907Z DEBUG Ikea Button Tweaks  Ghost tap suppressed
2024-03-30T06:53:39.851437740Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x01
2024-03-30T06:53:39.856643824Z DEBUG Ikea Button Tweaks  Ghost first-press suppressed
2024-03-30T06:53:40.123465240Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x06
2024-03-30T06:53:40.128390782Z DEBUG Ikea Button Tweaks  Ghost tap expected after flagged first-press suppressed.
2024-03-30T06:53:40.240555074Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x01
2024-03-30T06:53:40.245718991Z DEBUG Ikea Button Tweaks  Ghost first-press suppressed
2024-03-30T06:53:40.981232699Z INFO Ikea Button Tweaks  Executing ZclClusterCommandHandler: cluster: 0xFC80, command: 0x03
2024-03-30T06:53:40.986455616Z DEBUG Ikea Button Tweaks  Ghost tap expected after flagged first-press suppressed

Will eventually update the driver when I’m happy with the fix, doesn’t seem urgent since it’s actually hard to replicate using the button “normally” and want to make sure it does not have false positives.

3 Likes