-
Notifications
You must be signed in to change notification settings - Fork 0
/
4button.yml
130 lines (130 loc) · 4.1 KB
/
4button.yml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
blueprint:
name: Zigbee2MQTT - LoraTap (Tuya) 4-Button Scene Switch
description: Automate your LoraTap (Tuya) 4-Button Scene Switch via Zigbee2MQTT.
domain: automation
input:
switch:
name: LoraTap (Tuya) 4-Button Scene Switch
description: LoraTap (Tuya) 4-Button Scene Switch to use
selector:
entity:
integration: mqtt
domain: sensor
button_one_short_press:
name: Single Press - Button 1
description: Action to run on button 1 (upper-left) single press
default: []
selector:
action: {}
button_one_double_press:
name: Double Press - Button 1
description: Action to run on button 1 (upper-left) double press
default: []
selector:
action: {}
button_one_long_press:
name: Long Press - Button 1
description: Action to run on button 1 (upper-left) long press
default: []
selector:
action: {}
button_two_short_press:
name: Single Press - Button 2
description: Action to run on button 2 (upper-right) single press
default: []
selector:
action: {}
button_two_double_press:
name: Double Press - Button 2
description: Action to run on button 2 (upper-right) double press
default: []
selector:
action: {}
button_two_long_press:
name: Long Press - Button 2
description: Action to run on button 2 (upper-right) long press
default: []
selector:
action: {}
button_three_short_press:
name: Single Press - Button 3
description: Action to run on button 3 (middle-left) single press
default: []
selector:
action: {}
button_three_double_press:
name: Double Press - Button 3
description: Action to run on button 3 (middle-left) double press
default: []
selector:
action: {}
button_three_long_press:
name: Long Press - Button 3
description: Action to run on button 3 (middle-left) long press
default: []
selector:
action: {}
button_four_short_press:
name: Single Press - Button 4
description: Action to run on button 4 (middle-right) single press
default: []
selector:
action: {}
button_four_double_press:
name: Double Press - Button 4
description: Action to run on button 4 (middle-right) double press
default: []
selector:
action: {}
button_four_long_press:
name: Long Press - Button 4
description: Action to run on button 4 (middle-right) long press
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input 'switch'
attribute: action
action:
- variables:
command: '{{ trigger.to_state.state }}'
- choose:
- conditions:
- "{{ command == '1_single' }}"
sequence: !input 'button_one_short_press'
- conditions:
- "{{ command == '2_single' }}"
sequence: !input 'button_two_short_press'
- conditions:
- "{{ command == '3_single' }}"
sequence: !input 'button_three_short_press'
- conditions:
- "{{ command == '4_single' }}"
sequence: !input 'button_four_short_press'
- conditions:
- "{{ command == '1_double' }}"
sequence: !input 'button_one_double_press'
- conditions:
- "{{ command == '2_double' }}"
sequence: !input 'button_two_double_press'
- conditions:
- "{{ command == '3_double' }}"
sequence: !input 'button_three_double_press'
- conditions:
- "{{ command == '4_double' }}"
sequence: !input 'button_four_double_press'
- conditions:
- "{{ command == '1_hold' }}"
sequence: !input 'button_one_long_press'
- conditions:
- "{{ command == '2_hold' }}"
sequence: !input 'button_two_long_press'
- conditions:
- "{{ command == '3_hold' }}"
sequence: !input 'button_three_long_press'
- conditions:
- "{{ command == '4_hold' }}"
sequence: !input 'button_four_long_press'