forked from andrevtcgn/Zigbee2MQTT---Tuya-Scene-Switches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTuya TS0043 Zigbee2MQTT
103 lines (103 loc) · 3.06 KB
/
Tuya TS0043 Zigbee2MQTT
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
blueprint:
name: Zigbee2MQTT - Tuya 3-Button Scene Switch
description: Automate your Tuya 3-Button Scene Switch via Zigbee2MQTT.
domain: automation
input:
switch:
name: Tuya 3-Button Scene Switch
description: Tuya 3-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 (lower-left) single press
default: []
selector:
action: {}
button_one_double_press:
name: Double Press - Button 1
description: Action to run on button 1 (lower-left) double press
default: []
selector:
action: {}
button_one_long_press:
name: Long Press - Button 1
description: Action to run on button 1 (lower-left) long press
default: []
selector:
action: {}
button_two_short_press:
name: Single Press - Button 2
description: Action to run on button 2 (lower-middle) single press
default: []
selector:
action: {}
button_two_double_press:
name: Double Press - Button 2
description: Action to run on button 2 (lower-middle) double press
default: []
selector:
action: {}
button_two_long_press:
name: Long Press - Button 2
description: Action to run on button 2 (lower-middle) long press
default: []
selector:
action: {}
button_three_short_press:
name: Single Press - Button 3
description: Action to run on button 3 (lower-right) single press
default: []
selector:
action: {}
button_three_double_press:
name: Double Press - Button 3
description: Action to run on button 3 (lower-right) double press
default: []
selector:
action: {}
button_three_long_press:
name: Long Press - Button 3
description: Action to run on button 3 (lower-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 == ''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 == ''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'