blueprint:
name: Z2M - IKEA STYRBAR 4-button remote
description: "This blueprint is for the IKEA STYRBAR square, 4-button remote when used with zigbee2mqtt.
It is for general use so all buttons can be connected to any action of your choice"
domain: automation
input:
remote:
name: Remote
description: IKEA STYRBAR remote to use
selector:
entity:
integration: mqtt
domain: sensor
button_on:
name: Brightness up button - short press
description: Action to run when SHORT press on brighness UP button
default: []
selector:
action: {}
button_off:
name: Brightness down button - short press
description: Action to run when SHORT press on brighness DOWN button
default: []
selector:
action: {}
button_brightness_move_up:
name: Brightness up button - long press
description: Action to run when LONG press on brighness UP button
default: []
selector:
action: {}
button_brightness_move_down:
name: Brightness down button - long press
description: Action to run when LONG press on brighness DOWN button
default: []
selector:
action: {}
button_brightness_stop:
name: Brightness stop button - long release press
description: Action to run when LONG press on brighness (up or down) is released
default: []
selector:
action: {}
button_left_click:
name: Left button - short press
description: Action to run when SHORT press on LEFT arrow button
default: []
selector:
action: {}
button_left_hold:
name: Left button - hold
description: Action to run when HOLD press on LEFT arrow button
default: []
selector:
action: {}
button_left_release:
name: Left button - release
description: Action to run when RELEASE press on LEFT arrow button
default: []
selector:
action: {}
button_right_click:
name: Right button - short press
description: Action to run when SHORT press on RIGHT arrow button
default: []
selector:
action: {}
button_right_hold:
name: Right button - hold
description: Action to run when HOLD press on RIGHT button
default: []
selector:
action: {}
button_right_release:
name: Right button - release
description: Action to run when RELEASE press on RIGHT arrow button
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input "remote"
attribute: action
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- "{{ command == 'on' }}"
sequence: !input "button_on"
- conditions:
- "{{ command == 'off' }}"
sequence: !input "button_off"
- conditions:
- "{{ command == 'brightness_move_up' }}"
sequence: !input "button_brightness_move_up"
- conditions:
- "{{ command == 'brightness_move_down' }}"
sequence: !input "button_brightness_move_down"
- conditions:
- "{{ command == 'brightness_stop' }}"
sequence: !input "button_brightness_stop"
- conditions:
- "{{ command == 'arrow_left_click' }}"
sequence: !input "button_left_click"
- conditions:
- "{{ command == 'arrow_left_hold' }}"
sequence: !input "button_left_hold"
- conditions:
- "{{ command == 'arrow_left_release' }}"
sequence: !input "button_left_release"
- conditions:
- "{{ command == 'arrow_right_click' }}"
sequence: !input "button_right_click"
- conditions:
- "{{ command == 'arrow_right_hold' }}"
sequence: !input "button_right_hold"
- conditions:
- "{{ command == 'arrow_right_release' }}"
sequence: !input "button_right_release"
New to HA, so I have added the blueprint (Thanks OP) ive put the entity to the switch action, of the styrbar remote. Action type - I clicked the device and then added each bulb x 4 (Cant work out how to use a lighting group for this) Action set to brightness up for brightness button etc…
So I also noticed the automation is entered into the automations.yaml rather than the UI, which it has and is all present. However the button is not controlling anything, I know it is connected as i can see the button click responses on the device info.
Hey Wavs,
Could you maybe update the Blueprint a bit?
Just disabled the legacy option in z2mqtt to see what changed and the remotes stopping working.
The new triggers are
on, off, arrow_right_click, arrow_left_click, brightness_move_down, brightness_move_up, brightness_stop
example payload {"action":"brightness_stop","battery":100,"linkquality":48,"update":{"state":"idle"},"update_available":false}'
Can someone tell me what I’m supposed to do with the Blueprint above.
I cannot see where I can paste into a new empty blueprint!
(I have imported a few using buttons on this forum, but never copied/pasted)
I didn’t think of that as i thought this community page would not e structured enough for HA to pick out the Blueprint.
Anyway, I discovered where the Blueprints are stored in HA (config/blueprints) so just copied and pasted the code into a new file in that area. That worked, but as it happens, I discovered a more recent and versatile blueprint for the Ikea Styrbar button with the conventional ‘Import Blueprint’ button.
Hmm. still struggling a bit. Fast double click on left and right is working well, but on up and down I have to wait between the clients or it will trigger a single click. Left and right long press is triggering a double click and long up and down is not triggering at all.
I’m new to home assistant and blueprints.
This blueprint does not seem to work for me. What am I not understanding?
Do I also need to set make a state entity such as for the " Controller - IKEA E2001/E2002 STYRBAR Remote control" blueprint?
*Edit: It seems to be related to “Home Assistant legacy entity attributes” but what changed here ?
Hello all, just for your information. This blueprint stopped working around Aug’23.
Message was: Stopped because of unknown reason “null”
Context: Ikea STYRBAR 4-button remote, with Zigbee2MQTT.
After some investigation, and browsing MQTT messages, I found after every “on” action, there was a “” action:
Don’t understand why it started happening: Firmware upgrade in the remote, Z2M changes, HA version, anyhow the current behaviour is the correct one, and the issue was in the blueprint. By the way: Big thanks to it, it’s awesome.