-
Notifications
You must be signed in to change notification settings - Fork 0
/
tuya-4-button.yaml
140 lines (135 loc) · 4.22 KB
/
tuya-4-button.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
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
131
132
133
134
135
136
137
# Zigbee2MQTT - Tuya 4-button Scene Switch (TS0044)
# Blueprint by Stringer
# Original work - https://community.home-assistant.io/t/zigbee2mqtt-tuya-4-button-scene-switch-ts0044/274735
blueprint:
name: Zigbee2MQTT - Tuya 4-Button Scene Switch
description: Automate your Tuya 4-Button Scene Switch via Zigbee2MQTT.
domain: automation
input:
switch:
name: Tuya 4-Button Scene Switch
description: 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 (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-right) single press
default: []
selector:
action: {}
button_two_double_press:
name: Double Press - Button 2
description: Action to run on button 2 (lower-right) double press
default: []
selector:
action: {}
button_two_long_press:
name: Long Press - Button 2
description: Action to run on button 2 (lower-right) long press
default: []
selector:
action: {}
button_three_short_press:
name: Single Press - Button 3
description: Action to run on button 3 (upper-right) single press
default: []
selector:
action: {}
button_three_double_press:
name: Double Press - Button 3
description: Action to run on button 3 (upper-right) double press
default: []
selector:
action: {}
button_three_long_press:
name: Long Press - Button 3
description: Action to run on button 3 (upper-right) long press
default: []
selector:
action: {}
button_four_short_press:
name: Single Press - Button 4
description: Action to run on button 4 (upper-left) single press
default: []
selector:
action: {}
button_four_double_press:
name: Double Press - Button 4
description: Action to run on button 4 (upper-left) double press
default: []
selector:
action: {}
button_four_long_press:
name: Long Press - Button 4
description: Action to run on button 4 (upper-left) long press
default: []
selector:
action: {}
source_url: https://github.com/AramidX/ha-blueprint/blob/4de1fb2c9fe1d96a58f09c28b1d4a7760e0e9d2b/blueprints/tuya/tuya_4button_scene_switch_z2m.yaml
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"
6