IKEA Somrig remote E2213 ZHA

IKEA Somrig remote blueprint

Hi everyone!

I created a simple blueprint for the IKEA Somrig remote, model E2213, to be used with ZHA.
It’s based on the @Atlantis_One Symfonisk GEN2 Blueprint.

It’s made for the new IKEA remote with dots.
image

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Contributors

  • @holyo: Added the long_release actions

YAML

blueprint:
  name: ZHA - IKEA Somrig remote dot-buttons control
  description:
    Fully customisable dot-buttons, with options for single, double and
    long press for each one.
  domain: automation
  input:
    remote:
      name: Remote
      description: IKEA Somrig remote to use
      selector:
        device:
          integration: zha
          manufacturer: IKEA of Sweden
          model: SOMRIG shortcut button
          multiple: false
    single_dot_single_press:
      name: Single dot (Single press)
      description: Action to run on single dot press
      default: []
      selector:
        action: {}
    single_dot_double_press:
      name: Single dot (Double press)
      description: Action to run on single dot double press
      default: []
      selector:
        action: {}
    single_dot_long_press:
      name: Single dot (Long press)
      description: Action to run on single dot long press
      default: []
      selector:
        action: {}
    single_dot_long_release:
      name: Single dot (Release after long press)
      description: Action to run on releasing after a long press on the single dot
      default: []
      selector:
        action: {}
    double_dot_single_press:
      name: Double dot (Single press)
      description: Action to run on double dot press
      default: []
      selector:
        action: {}
    double_dot_double_press:
      name: Double dot (Double press)
      description: Action to run on double dot double press
      default: []
      selector:
        action: {}
    double_dot_long_press:
      name: Double dot (Long press)
      description: Action to run on double dot long press
      default: []
      selector:
        action: {}
    double_dot_long_release:
      name: Double dot (Release after long press)
      description: Action to run on releasing after a long press on the double dot
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/ikea-somrig-remote-e2213-zha/668671
mode: single
max_exceeded: silent
trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_id: !input remote
action:
  - variables:
      command: "{{ trigger.event.data.command }}"
      cluster_id: "{{ trigger.event.data.cluster_id }}"
      endpoint_id: "{{ trigger.event.data.endpoint_id }}"
      args: "{{ trigger.event.data.args }}"
  - choose:
      - conditions:
          - "{{ command == 'short_release' }}"
          - "{{ endpoint_id == 1 }}"
        sequence: !input single_dot_single_press
      - conditions:
          - "{{ command == 'multi_press_complete' }}"
          - "{{ endpoint_id == 1 }}"
        sequence: !input single_dot_double_press
      - conditions:
          - "{{ command == 'long_press' }}"
          - "{{ endpoint_id == 1 }}"
        sequence: !input single_dot_long_press
      - conditions:
          - "{{ command == 'long_release' }}"
          - "{{ endpoint_id == 1 }}"
        sequence: !input single_dot_long_release
      - conditions:
          - "{{ command == 'short_release' }}"
          - "{{ endpoint_id == 2 }}"
        sequence: !input double_dot_single_press
      - conditions:
          - "{{ command == 'multi_press_complete' }}"
          - "{{ endpoint_id == 2 }}"
        sequence: !input double_dot_double_press
      - conditions:
          - "{{ command == 'long_press' }}"
          - "{{ endpoint_id == 2 }}"
        sequence: !input double_dot_long_press
      - conditions:
          - "{{ command == 'long_release' }}"
          - "{{ endpoint_id == 2 }}"
        sequence: !input double_dot_long_release
9 Likes

Thnx Lorenzo for sharing this.

I added the long_release action which is natively supported by this device and very helpful e.g. for stopping a cover or roller blind.

So, you might want to update your blueprint with this:

blueprint:
  name: ZHA - IKEA Somrig remote dot-buttons control
  description:
    Fully customisable dot-buttons, with options for single, double and
    long press for each one.
  domain: automation
  input:
    remote:
      name: Remote
      description: IKEA Somrig remote to use
      selector:
        device:
          integration: zha
          manufacturer: IKEA of Sweden
          model: SOMRIG shortcut button
          multiple: false
    single_dot_single_press:
      name: Single dot (Single press)
      description: Action to run on single dot press
      default: []
      selector:
        action: {}
    single_dot_double_press:
      name: Single dot (Double press)
      description: Action to run on single dot double press
      default: []
      selector:
        action: {}
    single_dot_long_press:
      name: Single dot (Long press)
      description: Action to run on single dot long press
      default: []
      selector:
        action: {}
    single_dot_long_release:
      name: Single dot (Release after long press)
      description: Action to run on releasing after a long press on the single dot
      default: []
      selector:
        action: {}
    double_dot_single_press:
      name: Double dot (Single press)
      description: Action to run on double dot press
      default: []
      selector:
        action: {}
    double_dot_double_press:
      name: Double dot (Double press)
      description: Action to run on double dot double press
      default: []
      selector:
        action: {}
    double_dot_long_press:
      name: Double dot (Long press)
      description: Action to run on double dot long press
      default: []
      selector:
        action: {}
    double_dot_long_release:
      name: Double dot (Release after long press)
      description: Action to run on releasing after a long press on the double dot
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/ikea-somrig-remote-e2213-zha/668671
mode: single
max_exceeded: silent
trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_id: !input remote
action:
  - variables:
      command: "{{ trigger.event.data.command }}"
      cluster_id: "{{ trigger.event.data.cluster_id }}"
      endpoint_id: "{{ trigger.event.data.endpoint_id }}"
      args: "{{ trigger.event.data.args }}"
  - choose:
      - conditions:
          - "{{ command == 'short_release' }}"
          - "{{ endpoint_id == 1 }}"
        sequence: !input single_dot_single_press
      - conditions:
          - "{{ command == 'multi_press_complete' }}"
          - "{{ endpoint_id == 1 }}"
        sequence: !input single_dot_double_press
      - conditions:
          - "{{ command == 'long_press' }}"
          - "{{ endpoint_id == 1 }}"
        sequence: !input single_dot_long_press
      - conditions:
          - "{{ command == 'long_release' }}"
          - "{{ endpoint_id == 1 }}"
        sequence: !input single_dot_long_release
      - conditions:
          - "{{ command == 'short_release' }}"
          - "{{ endpoint_id == 2 }}"
        sequence: !input double_dot_single_press
      - conditions:
          - "{{ command == 'multi_press_complete' }}"
          - "{{ endpoint_id == 2 }}"
        sequence: !input double_dot_double_press
      - conditions:
          - "{{ command == 'long_press' }}"
          - "{{ endpoint_id == 2 }}"
        sequence: !input double_dot_long_press
      - conditions:
          - "{{ command == 'long_release' }}"
          - "{{ endpoint_id == 2 }}"
        sequence: !input double_dot_long_release

/Olaf

1 Like

Nice work!
I’ve updated my post to include your edit!

Hi Lorenzo, thank you for making this blueprint!

Would it be possible to add the functionality to have long press actions repeated with a certain delay? This would be great to use them for brightness and volume control.

you can use an automation for this (as I do), it is not complicated. like in this tutorial

1 Like

Ciao @cecche

Thanks for sharing this blueprint, it works very well

Do you know a way to rotate colors, eventually also a list of colors, pressing a button?

Thanks again

I have opened the box of a somrig (no firmware upgrade) but it doesnt show up in the blueprints device dropdown. I use zha. Where am i going wrong?


Thanks in advance,

Could you send me more info about your device? it seems like it does not match with the selector:

selector:
  device:
    integration: zha
    manufacturer: IKEA of Sweden
    model: SOMRIG shortcut button
    multiple: false

Have you tried simply rebooting your home assistant instance?

PS. I have the same firmware too

Sorry if I haven’t answered you yet, but I’m in the middle of a university exam session.
I started editing the blueprint the day you wrote it, but it still doesn’t work perfectly.
As soon as I take this next exam on February 12th I’ll get back to it, I promise! :sweat_smile:

By the way, I’m doing it with a solution very similar to the video posted by @kszaboa

Yes
If you wish to have a list of colours, you should make a “selector” helper with each hex color code you wish to rotate through. Next you have to make an automation (or script) to go to the next value input_select.select_next service of the selector and then use a template to adapt the current value of the dropdown to fit in the color input of your light.

Unfortunately I still have no RGB lights in my home at the moment, so i never faced the problem of changing colour “continuously”.

1 Like

hello,

thanks for sharing.

I created an automation (activate a scene on single dot press) based on your blueprint, unfortunately the action is never triggered. Do you have an idea what could be the reason?

I know the scene is working as I have the same automation with a Ikea STYRBAR which works perfectly fine.

Hi,

Well … what can I say? Lorenzo, Olaf and kszaboa you are stars!!
You have saved me sooooo much time.
Thank you very much.

I’ve only been using HA for a month or so. I’ve been moving all my ‘Hive’ devices to HA under ZHA with reasonable success.

During a recent visit to IKEA store I got carried away and bought too many devices. When I got home I got one or two working then started to worry!!!

This is my first Blueprint and along with Ed’s Youtube video I have finally got there. The Somrig controller is working prefectly with a HIve bulb.

Ed’s Youtube video is great but I guess it must be quite old. For anyone else trying to get it working you need to apply all the principles but the menus look quite different now (I guess) so you may need to search for key controls (especially ‘Restart’)

All good. Thank you again guys - especially Lorenzo.

Cheers, George

1 Like

@cecche - Many thanks indeed for putting this blueprint together, it saved me a tonne of time & was super helpful considering this is my 1st venture into Zigbee devices.

Everything works really well, albeit maybe too well :face_with_raised_eyebrow:

I’m noticing a tonne of these events in the automation log, which as you can see are happening once every hour or so:

Screenshot 2024-02-26 at 19.49.12

Which are at the same time as these Checkin events from the Somrig remote log:

I understand the Checkin events are necessary & that interval attribute is from the Zigbee controller (which in my case is a SkyConnect dongle), & while I can change it to an awfully long interval, I’d really like to understand why the blueprint/automation is being fired on these types of events?

Fyi, my automation is currently setup to fire on Single dot (Single press)

Any help would be greatly appreciated :crossed_fingers:

<<<<< UPDATE >>>>>

Tracing the different trigger steps some more, I noticed a different command value between an actual push of the button, & a checkin event:

ACTUAL

this:
entity_id: automation.shower_single_press
state: ‘on’
attributes:
id: ‘1708101752073’
last_triggered: ‘2024-02-26T20:43:14.557337+00:00’
mode: single
current: 0
friendly_name: Shower Traffic Light Timer
last_changed: ‘2024-02-26T07:31:33.465045+00:00’
last_updated: ‘2024-02-26T20:43:14.568842+00:00’
context:
id: 01HQKJGK7W0CPAT66MREPABFPP
parent_id: 01HQKJGK7TW8QWH9MGJWGKPFZ7
user_id: null
trigger:
id: ‘0’
idx: ‘0’
alias: null
platform: event
event:
event_type: zha_event
data:
device_ieee: 28:76:81:ff:fe:3d:24:f8
unique_id: 28:76:81:ff:fe:3d:24:f8:1:0xfc80
device_id: 427f0a936aeadf67ee700769fbab7911
endpoint_id: 1
cluster_id: 64640
command: initial_press
args:
- 0
params:
new_position: 0
origin: LOCAL
time_fired: ‘2024-02-26T21:18:13.752503+00:00’
context:
id: 01HQKMGN7RVQ2520A53NNP9SE7
parent_id: null
user_id: null
description: event ‘zha_event’

CHECKIN

this:
entity_id: automation.shower_single_press
state: ‘on’
attributes:
id: ‘1708101752073’
last_triggered: ‘2024-02-26T19:48:22.089180+00:00’
mode: single
current: 0
friendly_name: Shower Traffic Light Timer
last_changed: ‘2024-02-26T07:31:33.465045+00:00’
last_updated: ‘2024-02-26T19:48:22.103323+00:00’
context:
id: 01HQKFC3Y8Z4G9PT6E46001XH5
parent_id: 01HQKFC3Y6ZV9Q4J5J5V2MY9A2
user_id: null
trigger:
id: ‘0’
idx: ‘0’
alias: null
platform: event
event:
event_type: zha_event
data:
device_ieee: 28:76:81:ff:fe:3d:24:f8
unique_id: 28:76:81:ff:fe:3d:24:f8:1:0x0020
device_id: 427f0a936aeadf67ee700769fbab7911
endpoint_id: 1
cluster_id: 32
command: checkin
args:
params: {}
origin: LOCAL
time_fired: ‘2024-02-26T20:43:14.554870+00:00’
context:
id: 01HQKJGK7TW8QWH9MGJWGKPFZ7
parent_id: null
user_id: null
description: event ‘zha_event’

cluster_id is also different. Adding either cluster_id: 32 or command: checkin as a NOT condition in the main blueprint should supress the triggering of this automation

@cecche - Is there any chance you could please take a look at the above change, as I wouldn’t know where to start :disappointed: Thank you!

Hello

I would like to use your blueprint. I have a IKEA Somrig E2213 ZHA. I connected it to my HA successfully but after pressing the button nothing happens. I get the error message Error: UndefinedError: ‘dict object’ has no attribute 'event. Cab someone help me please?

Just got hold of a couple of these devices and am having issues getting them into HA. I’ve managed to get one to pair but get nothing more than the battery and one other entity.

I’d like to use this blueprint but I’ve not had to do this before and I’m not sure quite how to do it. I’d like to get these working but if I can’t they’ll have to go back to Ikea for a refund.

Thanks so much for this Blueprint - it’s really helpful. I’ve finally gotten a Somrig remote and have set this up. Is it possible to add looping events for holding down the buttons?