Skip to content

[BUG] E2213 (Ikea Somrig) Integration cannot dim lights #1292

@annoying-default-user

Description

@annoying-default-user

Bug report

Description

I'm using the Ikea Somrig (E2213) Switch in Home Assistant and try to control some lights. But, when holding or double press one of the buttons a X_initial_press action is send in front of X_long_press or X_double_press. In the standard integration in ControllerX this leads to the behavior, that when holding the button for decrease the brightness, the lights get turned off, because of the X_initial_press before the long press.

E2213 (Somrig) is always sending at least two actions per event:

  • X_initial_press & X_short_release when just tapped
  • X_initial_press & X_long_press & X_long_release when hold
  • X_initial_press & X_double_press when tapped twice

As stated out in the discussion in my issue at Zigbee2MQTT, this seems an intended behavior.
I already found a Workaround (see below).

Additional information

  • Devices involved:
    • Model: IKEA E2213 as controller
  • Integration: external z2m via mqtt
  • AppDaemon version: 0.17.13
  • ControllerX version: 5.2.2
  • HACS version (if installed from there): 2.0.5
  • Home Assistant Core version: 2025.12.5

AppDaemon app configuration

Here using mostly default integration, just mapped different lights for the case of double press.

schalter_flur_E2213_3:
  module: controllerx
  class: E2213LightController
  integration:
    name: z2m
    listen_to: mqtt
  controller:
    - Schalter_Flur_3
  merge_mapping:
    1_double_press:
      service: light.turn_on
      data:
        entity_id: light.lampen_flur_n2_1
    2_double_press:
      service: light.turn_off
      data:
        entity_id: light.lampen_flur_n2_1
  light: light.lampen_flur_n2_2

Workaround

Ignore the initial press actions and remap the on and off events to the X_short_release actions.

schalter_flur_E2213_3:
  module: controllerx
  class: E2213LightController
  integration:
    name: z2m
    listen_to: mqtt
  controller: Schalter_Flur_3
  excluded_actions:
    - 1_initial_press
    - 2_initial_press
  merge_mapping:
    1_short_release:
      - "on"
      - action: release
    2_short_release:
      - "off"
      - release
    1_double_press:
      service: light.turn_on
      data:
        entity_id: light.lampen_flur_n2_1
    2_double_press:
      service: light.turn_off
      data:
        entity_id: light.lampen_flur_n2_1
  light: light.lampen_flur_n2

Logs

In the Appdaemon Log of ControllerX, I can see these actions (pressing 1 to turn on and then holding 2 to dim down). These actions are also visible in the "Exposes" tab of Z2M when using the switch.

2026-01-06 00:45:23.675561 INFO schalter_flur_E2213_3: 🎮 Button event triggered: `1_initial_press`
2026-01-06 00:45:23.677736 INFO schalter_flur_E2213_3: 🏃 Running `Predefined (on)` now
2026-01-06 00:45:23.680433 INFO schalter_flur_E2213_3: 
🤖 Service: light.turn_on
  - entity_id: light.lampen_flur_n2_2
2026-01-06 00:45:24.676478 INFO schalter_flur_E2213_3: 🎮 Button event triggered: `1_short_release`
2026-01-06 00:45:24.679466 INFO schalter_flur_E2213_3: 🏃 Running `Predefined (release)` now
2026-01-06 00:45:26.422019 INFO schalter_flur_E2213_3: 🎮 Button event triggered: `2_initial_press`
2026-01-06 00:45:26.424495 INFO schalter_flur_E2213_3: 🏃 Running `Predefined (off)` now
2026-01-06 00:45:26.426953 INFO schalter_flur_E2213_3: 
🤖 Service: light.turn_off
  - entity_id: light.lampen_flur_n2_2
2026-01-06 00:45:26.732158 INFO schalter_flur_E2213_3: 🎮 Button event triggered: `2_long_press`
2026-01-06 00:45:26.734141 INFO schalter_flur_E2213_3: 🏃 Running `Predefined (hold_brightness_down)` now
2026-01-06 00:45:28.431559 INFO schalter_flur_E2213_3: 🎮 Button event triggered: `2_long_release`
2026-01-06 00:45:28.433962 INFO schalter_flur_E2213_3: 🏃 Running `Predefined (release)` now

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions