Shelly Button1 press with multiple inputs (single, double, triple, long)

A small blueprint to get the different Shelly button 1 inputs (single, double, triple, long) working in one automation. With inspiration from this post that didn’t work for me.

First time working with blueprints so feedback is always welcome!

My Home Assistant

blueprint:
  name: Shelly Button1 press
  description: Control anything from a Shelly Button1
  domain: automation
  input:
    remote:
      name: Shelly Button1 Switch
      description: Button to use
      selector:
        entity:
          domain: binary_sensor
          integration: shelly
    button_single:
      name: Short click
      default: []
      selector:
        action: {}
    button_double:
      name: Double click
      default: []
      selector:
        action: {}
    button_triple:
      name: Triple click
      default: []
      selector:
        action: {}
    button_long:
      name: Long click
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/shelly-button1-press-with-multiple-inputs-single-double-triple-long/338986
mode: restart
max_exceeded: silent
trigger:
- platform: state
  entity_id: !input 'remote'
  to: "on"
action:
- variables:
    event: '{{ trigger.to_state.attributes.click_type }}'
- choose:
  - conditions:
    - '{{ event == "single" }}'
    sequence: !input 'button_single'
  - conditions:
    - '{{ event == "double" }}'
    sequence: !input 'button_double'
  - conditions:
    - '{{ event == "triple" }}'
    sequence: !input 'button_triple'
  - conditions:
    - '{{ event == "long" }}'
    sequence: !input 'button_long'
1 Like