I used following blueprint for my shellyForHass Shellies, based:
Now I have switched to the integrated Shelly Plugin of HASS. Now I have the problem, that there any switches anymore, just events.
How can I wait for events during the blueprint automation, like I did for additional clicks?
blueprint:
name: Shelly multi and long click
description: Different Actions on short, long, double and triple clicks
domain: automation
input:
device_id:
name: Shelly entity
description: The Shelly used to trigger the automation
selector:
device:
integration: shelly
multiple: false
button_id:
name: Button, which is clicked
description: ...
default: 1.0
selector:
number:
min: 1
max: 4
unit_of_measurement: "1=UL, 2=UR, 3=OR, 4=OL"
mode: box
step: 1
short_click_action:
name: Short click action
description: The action(s) to launch for a single short click
default: []
selector:
action: {}
double_click_action:
name: Double click action
description: The action(s) to launch for a double click
default: []
selector:
action: {}
triple_click_action:
name: Triple click action
description: The action(s) to launch for a triple click
default: []
selector:
action: {}
long_click_action:
name: Long click action
description: The action(s) to launch for a long click
default: []
selector:
action: {}
delay_long:
name: Long click delay in seconds
description: The time in seconds (can contain decimals) used as a delay for
the long click detection
default: 1.0
selector:
number:
min: 0.1
max: 10.0
unit_of_measurement: seconds
mode: slider
step: 0.1
delay_multi:
name: Multi click delay in seconds
description: The time in seconds (can contain decimals) used as a delay for
the multi click detection
default: 0.8
selector:
number:
min: 0.1
max: 10.0
unit_of_measurement: seconds
mode: slider
step: 0.1
source_url: https://community.home-assistant.io/t/trigger-different-actions-on-a-single-double-or-double-click-on-a-binary-sensor/255902
trigger:
- platform: device
device_id: !input device_id
domain: shelly
type: btn_down
subtype: button1
- platform: device
device_id: !input device_id
domain: shelly
type: btn_down
subtype: button2
- platform: device
device_id: !input device_id
domain: shelly
type: btn_down
subtype: button3
- platform: device
device_id: !input device_id
domain: shelly
type: btn_down
subtype: button4
condition:
- condition: template
value_template: '{{ trigger.event.data.channel == button_id }}'
action:
- variables:
device_id: !input device_id
button_id: !input button_id
short_click: !input short_click_action
double_click: !input double_click_action
triple_click: !input triple_click_action
- wait_template: '{{ is_state(switch_id, ''off'') }}'
timeout: !input delay_long
- choose:
- conditions: '{{ not wait.completed }}'
sequence: !input long_click_action
default:
- choose:
- conditions: '{{ double_click | length > 0 }}'
sequence:
- wait_template: '{{ is_state(switch_id, ''on'') }}'
timeout: !input delay_multi
- choose:
- conditions: '{{ not wait.completed }}'
sequence: !input short_click_action
default:
- choose:
- conditions: '{{ triple_click | length > 0 }}'
sequence:
- wait_template: '{{ is_state(switch_id, ''off'') }}'
timeout: !input delay_multi
- wait_template: '{{ is_state(switch_id, ''on'') }}'
timeout: !input delay_multi
- choose:
- conditions: '{{ not wait.completed }}'
sequence: !input double_click_action
default: !input triple_click_action
default: !input double_click_action
default: !input short_click_action