-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvantage_button_press.yaml
66 lines (56 loc) · 1.64 KB
/
vantage_button_press.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
blueprint:
name: Vantage Button Pressed or Held
description: Perform an action when a Vantage button is pressed or held for more than a specified time.
domain: automation
input:
button_ids:
name: Vantage Button IDs
description: The Vantage IDs of the buttons to monitor.
selector:
text:
multiple: true
type: number
hold_time:
name: Hold Time (seconds)
description: Minimum duration the button must be held to trigger the hold action.
default: 1
selector:
number:
min: 1
max: 10
unit_of_measurement: seconds
press_action:
name: Press Action
description: The action to run when the button is briefly pressed.
selector:
action:
hold_action:
name: Hold Action
description: The action to run when the button is held for the specified time.
selector:
action:
trigger:
- platform: event
event_type: vantage_button_pressed
variables:
button_ids: !input button_ids
condition:
- condition: template
value_template: "{{ trigger.event.data.button_id | string in button_ids }}"
action:
- variables:
triggered_button_id: "{{ trigger.event.data.button_id }}"
- wait_for_trigger:
- platform: event
event_type: vantage_button_released
event_data:
button_id: "{{ triggered_button_id }}"
timeout:
seconds: !input hold_time
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger is none }}"
sequence: !input hold_action
- conditions: []
sequence: !input press_action