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

2 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

1 Like