IKEA Styrbar E2001-2002 Ultimate Zigbee2MQTT (Z2M)

Get the most out of your IKEA Styrbar switch. Use each button for what you like.

You can do press and hold on each button. I don’t have a release, because I don’t use it, but let me know if it’s needed.

Link to Z2M device
Link to blueprint on github

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

blueprint:
  name: IKEA Styrbar - E2001_E2002 Switch Actions (Z2M)
  description: Define actions for press and hold on all four buttons of the E2001_E2002 switch.
  domain: automation
  author: Keviin Cosmos
  input:
    controller_entity:
      name: (Zigbee2MQTT) Controller Entity
      description: The action sensor of the controller to use for the automation.
      default: ""
      selector:
        entity:
          domain:
            - sensor
          multiple: false
    hold_delay:
      name: Hold delay
      description: If the button has been held more than the configured Hold delay, the corresponding held action is triggered.
      default: 1000
      selector:
        number:
          min: 100.0
          max: 5000.0
          unit_of_measurement: milliseconds
          mode: box
          step: 10.0
    light_large_push:
      name: Light Large (Top) Pushed
      default: []
      selector:
        action: {}
    light_large_hold:
      name: Light Large (Top) Held
      default: []
      selector:
        action: {}
    light_small_push:
      name: Light Small (Bottom) Pushed
      default: []
      selector:
        action: {}
    light_small_hold:
      name: Light Small (Bottom) Held
      default: []
      selector:
        action: {}
    arrow_left_push:
      name: Arrow Left Pushed
      default: []
      selector:
        action: {}
    arrow_left_hold:
      name: Arrow Left Held
      default: []
      selector:
        action: {}
    arrow_right_push:
      name: Arrow Right Pushed
      default: []
      selector:
        action: {}
    arrow_right_hold:
      name: Arrow Right Held
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/ikea-styrbar-e2001-2002-ultimate-zigbee2mqtt-z2m/625090
mode: single
max_exceeded: silent
trigger:
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input controller_entity
action:
  - variables:
      trigger_action: "{{ trigger.event.data.new_state.state }}"
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "on" }}'
        sequence: !input light_large_push
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "brightness_move_up" }}'
        sequence: !input light_large_hold
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "off" }}'
        sequence: !input light_small_push
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "brightness_move_down" }}'
        sequence: !input light_small_hold
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "arrow_left_click" }}'
        sequence: !input arrow_left_push
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "arrow_left_hold" }}'
        sequence: !input arrow_left_hold
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "arrow_right_click" }}'
        sequence: !input arrow_right_push
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "arrow_right_hold" }}'
        sequence: !input arrow_right_hold

3 Likes

Simple to use and seems to work great. Is it possible to “dim while holding a button” or would that require a more complicated blueprint?

1 Like

Hey.
It’s possible, but I would have to make another version.
Or you could create script to trigger light down by 5% each second then held is registered.
I’ll ping you if I get time soon :+1:

Thanks for this blueprint. But I’d love to have the possibility “dim while hgolding a button”, too. I’ve tried something using “mode: repeat” but syntax-failed. Do you have a hint for me oder even better, a new version?

Hey,
Haven’t been online very much.

I haven’t tried that. What I do is that i have a looping script.

  1. press goes to 100%, next press, 10%, Next press 50% > repeat.

Check out this: Brightness steps: homeassistant/switch-brightness-steps.yaml at a78d6f0327cc72d838196f96ed5b4a49682e4ebf · KeviinCosmos/homeassistant · GitHub
Temp: homeassistant/switch-color_temp-steps.yaml at a78d6f0327cc72d838196f96ed5b4a49682e4ebf · KeviinCosmos/homeassistant · GitHub

2 Likes

Thanks for your work. Today I updated to zigbee2mqtt and the blueprint stopped working.
Context:

It would be great to see a fix :slight_smile:

1 Like

I faced the same issue and managed to fix the blueprint. I hope it works for you, too. :slight_smile:

blueprint:
  name: IKEA Styrbar - E2001_E2002 Switch Actions (Z2M)
  description:
    Define actions for press and hold on all four buttons of the E2001_E2002
    switch.
  domain: automation
  author: Keviin Cosmos
  input:
    controller_device:
      name: (Zigbee2MQTT) Controller Device
      description: The action device of the controller to use for the automation.
      default: ""
      selector:
        device:
          multiple: false
    hold_delay:
      name: Hold delay
      description:
        If the button has been held more than the configured Hold delay,
        the corresponding held action is triggered.
      default: 1000
      selector:
        number:
          min: 100.0
          max: 5000.0
          unit_of_measurement: milliseconds
          mode: box
          step: 10.0
    light_large_push:
      name: Light Large (Top) Pushed
      default: []
      selector:
        action: {}
    light_large_hold:
      name: Light Large (Top) Held
      default: []
      selector:
        action: {}
    light_small_push:
      name: Light Small (Bottom) Pushed
      default: []
      selector:
        action: {}
    light_small_hold:
      name: Light Small (Bottom) Held
      default: []
      selector:
        action: {}
    arrow_left_push:
      name: Arrow Left Pushed
      default: []
      selector:
        action: {}
    arrow_left_hold:
      name: Arrow Left Held
      default: []
      selector:
        action: {}
    arrow_right_push:
      name: Arrow Right Pushed
      default: []
      selector:
        action: {}
    arrow_right_hold:
      name: Arrow Right Held
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/ikea-styrbar-e2001-2002-ultimate-zigbee2mqtt-z2m/625090
mode: single
max_exceeded: silent

triggers:
  - trigger: device
    domain: mqtt
    device_id: !input controller_device
    type: action
    id: "on"
    subtype: "on"
  - trigger: device
    domain: mqtt
    device_id: !input controller_device
    type: action
    id: "brightness_move_up"
    subtype: "brightness_move_up"
  - trigger: device
    domain: mqtt
    device_id: !input controller_device
    type: action
    id: "off"
    subtype: "off"
  - trigger: device
    domain: mqtt
    device_id: !input controller_device
    type: action
    id: "brightness_move_down"
    subtype: "brightness_move_down"
  - trigger: device
    domain: mqtt
    device_id: !input controller_device
    type: action
    id: "arrow_left_click"
    subtype: "arrow_left_click"
  - trigger: device
    domain: mqtt
    device_id: !input controller_device
    type: action
    id: "arrow_right_click"
    subtype: "arrow_right_click"
  - trigger: device
    domain: mqtt
    device_id: !input controller_device
    type: action
    id: "arrow_left_hold"
    subtype: "arrow_left_hold"
  - trigger: device
    domain: mqtt
    device_id: !input controller_device
    type: action
    id: "arrow_right_hold"
    subtype: "arrow_right_hold"

action:
  - variables:
      trigger_action: "{{ trigger.id }}"
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "on" }}'
        sequence: !input light_large_push
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "brightness_move_up" }}'
        sequence: !input light_large_hold
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "off" }}'
        sequence: !input light_small_push
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "brightness_move_down" }}'
        sequence: !input light_small_hold
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "arrow_left_click" }}'
        sequence: !input arrow_left_push
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "arrow_left_hold" }}'
        sequence: !input arrow_left_hold
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "arrow_right_click" }}'
        sequence: !input arrow_right_push
      - conditions:
          - condition: template
            value_template: '{{ trigger_action == "arrow_right_hold" }}'
        sequence: !input arrow_right_hold

4 Likes

For now, it seems to perfectly work! Thank you so much!

1 Like

I had the same issue since a couple days and was very happy to find your updated blueprint. Thanks for the help!

This have same problem than other updated blueprints. Holding dimming down dims only one step at time.

It is so amazing to see an old scener here. Thanks for all the good times at Breakpoint!

Hi
please can you tell me how to update the blueprint with yours? Do I have to paste it in the original file?
Thanks

edit: copy-paste did it. it is working again.
thanks

Guys, sorry to bother but my styrbar remote shows as entity nothing i could use for inputting into the entity section of the blueprint. Only a battery entry, which is obviously useless. Using Z2M of course.

What am i doing wrong?