Skip to content

Instantly share code, notes, and snippets.

@ahue
Last active October 24, 2024 05:05
Show Gist options
  • Save ahue/ffb705297c6becba34685ef54ad18627 to your computer and use it in GitHub Desktop.
Save ahue/ffb705297c6becba34685ef54ad18627 to your computer and use it in GitHub Desktop.
Home Assistant Shelly Plus 1 Button Actions Blueprint
blueprint:
name: Shelly Plus 1 Button actions
description: |
This blueprint is for the Shelly PLus 1 setup as button. It is for general
use.
Note: Best set the `Input/Output settings` to `Detached - Input is separated/not changing state of the output/relay` on the Shelly: `http:/<shelly-ip>/#/input/0/settings/io-settings`.
In case you still want to control the primary output directly from the Shelly, create a local action: `http:/<shelly-ip>/#/input/0/create-action`.
domain: automation
input:
button:
name: button
description: Choose Shelly Plus 1
selector:
device:
manufacturer: Shelly
#model: SNSW-001X16EU
multiple: false
down:
name: Down
description: Action to run when BUTTON DOWN
default: []
selector:
action: {}
up:
name: Up
description: Action to run when BUTTON UP
default: []
selector:
action: {}
single:
name: Single short press
description: Action to run when SHORT press
default: []
selector:
action: {}
double:
name: Double short press
description: Action to run when DOUBLE SHORT press
default: []
selector:
action: {}
tripple:
name: Tripple short press
description: Action to run when TRIPPLE SHORT press
default: []
selector:
action: {}
long:
name: Long press
description: Action to run when LONG press
default: []
selector:
action: {}
source_url: https://gist.github.com/ahue/ffb705297c6becba34685ef54ad18627
mode: restart
max_exceeded: silent
trigger:
- platform: device
device_id: !input button
domain: shelly
type: btn_down
subtype: button1
id: btn_down
- platform: device
device_id: !input button
domain: shelly
type: btn_up
subtype: button1
id: btn_up
- platform: device
device_id: !input button
domain: shelly
type: single_push
subtype: button1
id: btn_single
- platform: device
device_id: !input button
domain: shelly
type: double_push
subtype: button1
id: btn_double
- platform: device
device_id: !input button
domain: shelly
type: long_push
subtype: button1
id: btn_long
action:
- choose:
- conditions:
- condition: trigger
id: btn_down
sequence: !input down
- conditions:
- condition: trigger
id: btn_up
sequence: !input up
- conditions:
- condition: trigger
id: btn_single
sequence: !input single
- conditions:
- condition: trigger
id: btn_double
sequence: !input double
- conditions:
- condition: trigger
id: btn_tripple
sequence: !input tripple
- conditions:
- condition: trigger
id: btn_long
sequence: !input long
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment