I created a blueprint for using Shelly BLU RC Button 4 US ZB. When connecting on zigbee it didn’t bring the buttons in, so I created a blueprint to make it easier, Here it is: Full disclosure, I don’t code so gemini did the heavy lifting.
blueprint:
name: Shelly 4-Button Remote (ZHA)
description: Automate your Shelly 4-Button remote using ZHA events.
domain: automation
input:
remote:
name: Remote
description: Select the Shelly Wall Switch to use
selector:
device:
integration: zha
manufacturer: Shelly
# --- BUTTON 1 INPUTS ---
button_1_single:
name: Button 1 - Single Press
default: []
selector:
action: {}
button_1_double:
name: Button 1 - Double Press
default: []
selector:
action: {}
button_1_long:
name: Button 1 - Long Press
default: []
selector:
action: {}
button_1_release:
name: Button 1 - Release
default: []
selector:
action: {}
# --- BUTTON 2 INPUTS ---
button_2_single:
name: Button 2 - Single Press
default: []
selector:
action: {}
button_2_double:
name: Button 2 - Double Press
default: []
selector:
action: {}
button_2_long:
name: Button 2 - Long Press
default: []
selector:
action: {}
button_2_release:
name: Button 2 - Release
default: []
selector:
action: {}
# --- BUTTON 3 INPUTS ---
button_3_single:
name: Button 3 - Single Press
default: []
selector:
action: {}
button_3_double:
name: Button 3 - Double Press
default: []
selector:
action: {}
button_3_long:
name: Button 3 - Long Press
default: []
selector:
action: {}
button_3_release:
name: Button 3 - Release
default: []
selector:
action: {}
# --- BUTTON 4 INPUTS ---
button_4_single:
name: Button 4 - Single Press
default: []
selector:
action: {}
button_4_double:
name: Button 4 - Double Press
default: []
selector:
action: {}
button_4_long:
name: Button 4 - Long Press
default: []
selector:
action: {}
button_4_release:
name: Button 4 - Release
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote
action:
- variables:
command: "{{ trigger.event.data.command }}"
args: "{{ trigger.event.data.args }}"
endpoint: "{{ trigger.event.data.endpoint_id }}"
- choose:
# --- BUTTON 1 LOGIC ---
- conditions:
- "{{ endpoint == 1 }}"
- "{{ command == 'on' }}"
sequence: !input button_1_single
- conditions:
- "{{ command == 'recall' }}"
- "{{ args == [1, 1, 10] }}"
sequence: !input button_1_double
- conditions:
- "{{ command == 'step' }}"
- "{{ args == [0, 20, 10, 0, 0] }}"
sequence: !input button_1_long
- conditions:
- "{{ command == 'recall' }}"
- "{{ args == [1, 11, 10] }}"
sequence: !input button_1_release
# --- BUTTON 2 LOGIC ---
- conditions:
- "{{ endpoint == 1 }}"
- "{{ command == 'off' }}"
sequence: !input button_2_single
- conditions:
- "{{ command == 'recall' }}"
- "{{ args == [2, 1, 10] }}"
sequence: !input button_2_double
- conditions:
- "{{ command == 'step' }}"
- "{{ args == [1, 20, 10, 0, 0] }}"
sequence: !input button_2_long
- conditions:
- "{{ command == 'recall' }}"
- "{{ args == [2, 11, 10] }}"
sequence: !input button_2_release
# --- BUTTON 3 LOGIC ---
- conditions:
- "{{ endpoint == 2 }}"
- "{{ command == 'on' }}"
sequence: !input button_3_single
- conditions:
- "{{ command == 'recall' }}"
- "{{ args == [3, 1, 10] }}"
sequence: !input button_3_double
- conditions:
- "{{ command == 'step' }}"
- "{{ args == [0, 20, 10, 0, 0] }}"
sequence: !input button_3_long
- conditions:
- "{{ command == 'recall' }}"
- "{{ args == [3, 11, 10] }}"
sequence: !input button_3_release
# --- BUTTON 4 LOGIC ---
- conditions:
- "{{ endpoint == 2 }}"
- "{{ command == 'off' }}"
sequence: !input button_4_single
- conditions:
- "{{ command == 'recall' }}"
- "{{ args == [4, 1, 10] }}"
sequence: !input button_4_double
- conditions:
- "{{ command == 'step' }}"
- "{{ args == [1, 20, 10, 0, 0] }}"
sequence: !input button_4_long
- conditions:
- "{{ command == 'recall' }}"
- "{{ args == [4, 11, 10] }}"
sequence: !input button_4_release