🎮 ZHA, deCONZ, Zigbee2MQTT - IKEA E2001/E2002 STYRBAR Remote control Universal blueprint - all actions + double click events - control lights, media players and more with Hooks

This blueprint is part of the Awesome HA Blueprints project.
Read more about it on the related Community Forum topic. :rocket:

Updates will be published on the project’s GitHub repository.

:arrow_down: Get Started

Option 1: My Home Assistant

Click the badge to import this Blueprint (needs Home Assistant Core 2021.3 or higher)

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

Option 2: Direct Link

Copy this link if you want to import the blueprint in your installation.

:link: Blueprint URL

:page_facing_up: Description

This blueprint provides universal support for running any custom action when a button is pressed on the provided IKEA E2001/E2002 STYRBAR Remote control. Supports controllers integrated with deCONZ, ZHA, Zigbee2MQTT. Just specify the integration used to connect the remote to Home Assistant when setting up the automation, and the blueprint will take care of all the rest.

In addition of being able to provide custom actions for every kind of button press supported by the remote, the blueprint allows to loop the long press actions while the corresponding button is being held. Once released, the loop stops. This is useful when holding down a button should result in a continuous action (such as lowering the volume of a media player, or controlling a light brightness).

The blueprint also adds support for virtual double button press events, which are not exposed by the controller itself.

Automations created with this blueprint can be connected with one or more Hooks supported by this controller.
Hooks allow to easily create controller-based automations for interacting with media players, lights, covers and more. See the list of Hooks available for this controller for additional details.

:closed_book: Full Documentation

Full documentation regarding requirements, inputs and more is available here.

Docs provide all the information you need to properly configure this blueprint on your instance.

:electric_plug: Available Hooks

:bulb: Light

This Hook blueprint allows to build a controller-based automation to control a light. Supports brightness and color control both for white temperature and rgb lights.

Light Hook docs

:loud_sound: Media Player

This Hook blueprint allows to build a controller-based automation to control a media player. Supports volume setting, play/pause and track selection.

Media Player Hook docs

:information_source: Changelog

Updated list of changes and improvements is available here.

Happy automating to everyone! :fire:

2 Likes

Hello. This blueprint looks exactly what I’d like to use. However I’m having some issues and I’m not sure if they are related to my deCONZ configuration or if I’m doing something wrong with the blueprints. So I’m trying to use controllers and hooks, but my E2001 controller is not connecting to my light hook. Here is my light hook configuration and controller configurations

So I only have the sensor.olohuone_kytkin_battery level entity for my button but I’m not sure if I should have something else? And because I want to use the default actions for the light hook I didn’t configure eany actions myself in the controller configuration. Are these right? And any ideas about what is the problem? My controller automation does trigger so that shouldn’t be the problem.

Thank you in advance :slight_smile:

Edit: It seems I wrongly assumed that the light hook needs to have the Zigbee gateway as the device. When I switched the controller device to the controller device everything works. Thank you for the blueprint, amazing work!

1 Like

Hi @JKalliomaki,

thank you for reporting here. I’m glad that you’ve managed to solve your issue.

So I only have the sensor.olohuone_kytkin_battery level entity for my button but I’m not sure if I should have something else?

You can safely remove the value you provided as the “Controller Entity” input in the Light Hook configuration: since you’re using deCONZ, this integration exposes the controller as a device to Home Assistant. Therefore, you should only provide a value for the “Controller Device” input, matching the device exposed by deCONZ for your controller.
Aside from this, configuration for both the controller and hook automations look great to me. :smiley:

If you’ve any additional questions or doubts feel free to ask, I’d be glad to help. Happy automating!

1 Like

Great blueprint

I was using it without any issue whilst using deconz to manage by zigbee network.

However yesterday I moved to ZHA and it seems that the blueprint has an issue picking double clicks.
As soon as I enable “expose double press event”, the blueprint will trigger the double click action whether I clicked single or double. Long clicks work OK.

EDIT: I resolved the issue

  • For some reason every single click was generating 4 click event (like if the device was paired multiple times).
  • Full reset + repaying resolved the issue (now only one event is fired and your blueprint functions like a charm)

jf

1 Like

Hi @jfparis,

thank you so much for your feedback. I’m glad that your issue is solved. :slight_smile:
I’ll add a small note on the blueprint documentation, stating that the controller might have this strange behavior with ZHA, and a full reset should solve the problem.

Happy automating!

1 Like

Hum, there’s an issue with the blueprint (zigbee2mqtt).

Whenever I long press the left or right button, the top button triggers a short press.

I have two different E2002 so it’s not a part issue.

Hi @Dumonster,

thank you for reporting here. Could you please share the YAML for the automation you set up with this blueprint?

Thanks!

I have the same problem on two distinct devices running the same blueprint so I’ll share both, in case it’s any help:

DEVICE ONE

- id: '1637588705936'
  alias: QuartoTiago_Dimmer
  description: ''
  use_blueprint:
    path: EPMatt/ikea_e2001_e2002.yaml
    input:
      integration: Zigbee2MQTT
      controller_entity: sensor.quartotiago_dimmer_action
      helper_last_controller_event: input_text.quartotiago_dimmer
      action_button_left_short:
      - service: media_player.media_previous_track
        target:
          entity_id: media_player.spotify_tiago_dumont
      action_button_left_long:
      - service: remote.send_command
        target:
          device_id: 2fffc1bb3694ca0c028f669130ffa6ba
        data:
          device: soundbar
          command: VOL-
      button_left_long_loop: true
      button_right_long_loop: true
      action_button_right_short:
      - service: media_player.media_next_track
        target:
          entity_id: media_player.spotify_tiago_dumont
      action_button_right_long:
      - service: remote.send_command
        target:
          device_id: 2fffc1bb3694ca0c028f669130ffa6ba
        data:
          device: soundbar
          command: VOL+
      action_button_up_short:
      - service: switch.turn_on
        target:
          entity_id: switch.quartotiago_luzcima
      action_button_up_long:
      - service: light.turn_on
        target:
          entity_id: light.quartotiago_luzescima
        data:
          brightness_step: 15
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 250
      action_button_down_short:
      - service: switch.turn_off
        target:
          entity_id: switch.quartotiago_luzcima
      action_button_down_long:
      - service: light.turn_on
        data:
          brightness_step: -15
        target:
          entity_id: light.quartotiago_luzescima
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 250
      button_up_long_loop: true
      button_down_long_loop: true

DEVICE TWO

- id: '1637590372702'
  alias: Sala_Dimmer
  description: ''
  use_blueprint:
    path: EPMatt/ikea_e2001_e2002.yaml
    input:
      integration: Zigbee2MQTT
      controller_entity: sensor.sala_dimmer_action
      helper_last_controller_event: input_text.sala_dimmer
      action_button_left_short:
      - service: switch.turn_on
        target:
          entity_id:
          - switch.salajantar_luzesfluorescentessala_left
          - switch.salajantar_luzesfluorescentessala_right
      action_button_left_long:
      - service: switch.turn_off
        target:
          entity_id:
          - switch.salajantar_luzesfluorescentessala_left
          - switch.salajantar_luzesfluorescentessala_right
      button_left_long_loop: true
      button_right_long_loop: true
      action_button_right_short:
      - service: switch.turn_on
        target:
          entity_id: switch.sala_luzcima_top
      action_button_right_long:
      - service: switch.turn_off
        target:
          entity_id: switch.sala_luzcima_top
      action_button_up_short:
      - service: switch.turn_on
        target:
          entity_id: switch.sala_luzcima_bottom
      action_button_up_long:
      - service: light.turn_on
        data:
          brightness_step: 15
        target:
          entity_id: light.sala_ltemp
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 250
      action_button_down_short:
      - service: switch.turn_off
        target:
          entity_id: switch.sala_luzcima_bottom
      action_button_down_long:
      - service: light.turn_on
        data:
          brightness_step: -15
        target:
          entity_id: light.sala_ltemp
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 250
      button_up_long_loop: true
      button_down_long_loop: true

Basically, on device one, when I hold one of the side buttons to increase\decrease the volume on my soundbar, the light will turn on.

On device two, when I hold one of the side buttons to turn off one of the auxiliary lights, the main light turns on.

Hum, if you expose the double press on any of the side buttons, the single press stops working.

Yeah I can’t really get more than one fuction from the side buttons with this template.

Either I have single click on but the holding makes the top button trigger, or I have the double click enabled and the single click stops working, or, or, or. Tried a bunch of things but it basically all comes around to the same.

I’m not code savy enough to troubleshoot this.