Skip to content

Instantly share code, notes, and snippets.

@01-Scripts
Last active November 2, 2024 20:13
Show Gist options
  • Save 01-Scripts/78ce42966fcffdeafb4a058573f8018c to your computer and use it in GitHub Desktop.
Save 01-Scripts/78ce42966fcffdeafb4a058573f8018c to your computer and use it in GitHub Desktop.
Shelly BLU Button1 Button Control (Press shortly once, twice, or three times, or press and hold for about 2 sec to emit a signal)
blueprint:
name: Shelly BLU Button1 Button Control (Press shortly once, twice, or three times, or press and hold for about 2 sec to emit a signal)
description: Automate actions using Shelly BLU Button1 with different press types.
domain: automation
input:
button_device:
name: Shelly BLU Button1
description: Select the Shelly BLU Button1 device.
selector:
device:
integration: bthome
multiple: false
button1_short:
name: Button Short Press Action
description: Action when button is short pressed.
default: []
selector:
action: {}
button1_double:
name: Button 1 Double Press Action
description: Action when button 1 is double pressed.
default: []
selector:
action: {}
button1_triple:
name: Button 1 Triple Press Action
description: Action when button 1 is triple pressed.
default: []
selector:
action: {}
button1_long:
name: Button 1 Long Press Action
description: Action when button is long 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'' and trigger.event.data.event_type
== ''press'' }}'
sequence: !input button1_short
- conditions:
- condition: template
value_template: '{{ trigger.event.data.event_class == ''button'' and trigger.event.data.event_type
== ''double_press'' }}'
sequence: !input button1_double
- conditions:
- condition: template
value_template: '{{ trigger.event.data.event_class == ''button'' and trigger.event.data.event_type
== ''triple_press'' }}'
sequence: !input button1_triple
- conditions:
- condition: template
value_template: '{{ trigger.event.data.event_class == ''button'' and trigger.event.data.event_type
== ''long_press'' }}'
sequence: !input button1_long
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment