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
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
NilsFA
October 17, 2023, 11:04pm
2
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
Optimisc
(Michael)
October 31, 2024, 3:26pm
4
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?
Thanks for your work. Today I updated to zigbee2mqtt and the blueprint stopped working.
Context:
opened 08:56PM - 01 Dec 24 UTC
bug
blueprint
### Blueprint name
All blueprints
### Home Assistant Core Version
-
### Home… Assistant Installation Type
Home Assistant Core
### Description
As mentioned in the latest [release notes](https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.42.0): Zigbee2MQTT 2.0 is planned to be released in January 2025. It will remove the `homeassistant_legacy_triggers` currently required to trigger these blueprints. Hopefully they can be updated in time.
Zigbee2MQTT docs suggest moving to MQTT device triggers instead of the `sensor.*`-triggers. Docs for breaking changes are [here](https://github.com/Koenkk/zigbee2mqtt/discussions/24198).
I saw #244 but I figured it would be nice with a new issue for visibility, since that one is quite old.
### Automation YAML config
```yaml
-
```
### To Reproduce
Upgrade to Z2M 2.0
### Expected behavior
Blueprints supporting MQTT device triggers.
### Actual Behaviour
Currently no support for MQTT device triggers.
### Additional Details
- [ ] I'd like to help developing a fix for this issue.
### Screenshots
_No response_
### Additional context
_No response_
It would be great to see a fix
1 Like
I faced the same issue and managed to fix the blueprint. I hope it works for you, too.
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!
Routout
(Routout)
January 7, 2025, 3:02pm
10
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!
Makis
(Makis)
January 18, 2025, 1:02pm
12
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?