Skip to content

Instantly share code, notes, and snippets.

@01-Scripts
Forked from beeldubz/shelly_blu_rc4.yaml
Created November 2, 2024 19:53
Show Gist options
  • Save 01-Scripts/0d3a75ee4e0f709fb57e16092b45ecdc to your computer and use it in GitHub Desktop.
Save 01-Scripts/0d3a75ee4e0f709fb57e16092b45ecdc to your computer and use it in GitHub Desktop.
blueprint:
name: Shelly BLU RC-4 Button Control (Short, Long, and Double Press)
description: Automate actions using Shelly BLU RC-4's 4 buttons with different press types.
domain: automation
input:
button_device:
name: Shelly BLU RC-4
description: Select the Shelly BLU RC-4 remote.
selector:
device:
integration: bthome
button_1_short:
name: Button 1 Short Press Action
description: Action when button 1 is short pressed.
default: []
selector:
action: {}
button_1_long:
name: Button 1 Long Press Action
description: Action when button 1 is long pressed.
default: []
selector:
action: {}
button_1_double:
name: Button 1 Double Press Action
description: Action when button 1 is double pressed.
default: []
selector:
action: {}
button_2_short:
name: Button 2 Short Press Action
description: Action when button 2 is short pressed.
default: []
selector:
action: {}
button_2_long:
name: Button 2 Long Press Action
description: Action when button 2 is long pressed.
default: []
selector:
action: {}
button_2_double:
name: Button 2 Double Press Action
description: Action when button 2 is double pressed.
default: []
selector:
action: {}
button_3_short:
name: Button 3 Short Press Action
description: Action when button 3 is short pressed.
default: []
selector:
action: {}
button_3_long:
name: Button 3 Long Press Action
description: Action when button 3 is long pressed.
default: []
selector:
action: {}
button_3_double:
name: Button 3 Double Press Action
description: Action when button 3 is double pressed.
default: []
selector:
action: {}
button_4_short:
name: Button 4 Short Press Action
description: Action when button 4 is short pressed.
default: []
selector:
action: {}
button_4_long:
name: Button 4 Long Press Action
description: Action when button 4 is long pressed.
default: []
selector:
action: {}
button_4_double:
name: Button 4 Double Press Action
description: Action when button 4 is double pressed.
default: []
selector:
action: {}
trigger:
- platform: event
event_type: bthome_ble_event
event_data:
device_id: !input button_device
action:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_1' and trigger.event.data.event_type == 'press' }}"
sequence: !input button_1_short
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_1' and trigger.event.data.event_type == 'long_press' }}"
sequence: !input button_1_long
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_1' and trigger.event.data.event_type == 'double_press' }}"
sequence: !input button_1_double
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_2' and trigger.event.data.event_type == 'press' }}"
sequence: !input button_2_short
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_2' and trigger.event.data.event_type == 'long_press' }}"
sequence: !input button_2_long
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_2' and trigger.event.data.event_type == 'double_press' }}"
sequence: !input button_2_double
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_3' and trigger.event.data.event_type == 'press' }}"
sequence: !input button_3_short
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_3' and trigger.event.data.event_type == 'long_press' }}"
sequence: !input button_3_long
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_3' and trigger.event.data.event_type == 'double_press' }}"
sequence: !input button_3_double
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_4' and trigger.event.data.event_type == 'press' }}"
sequence: !input button_4_short
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_4' and trigger.event.data.event_type == 'long_press' }}"
sequence: !input button_4_long
- conditions:
- condition: template
value_template: "{{ trigger.event.data.event_class == 'button_4' and trigger.event.data.event_type == 'double_press' }}"
sequence: !input button_4_double
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment