-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzha-tuya-2-button-scene-switch-ts0042.yml
82 lines (82 loc) · 2.5 KB
/
zha-tuya-2-button-scene-switch-ts0042.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
blueprint:
name: ZHA - Tuya 2-Button Scene Switch
description: Automate your Tuya 2-Button Scene Switch using ZHA events.
domain: automation
input:
tuya_2button_scene_switch:
name: Tuya 2-Button Scene Switch
description: Tuya 2-Button Scene Switch to use
selector:
device:
integration: zha
manufacturer: _TZ3000_dfgbtub0
model: TS0042
button_one_short_press:
name: Single Press
description: Action to run on button 1 (left) single press
default: []
selector:
action: {}
button_one_double_press:
name: Double Press
description: Action to run on button 1 left) double press
default: []
selector:
action: {}
button_one_long_press:
name: Long Press
description: Action to run on button 1 (left) long press
default: []
selector:
action: {}
button_two_short_press:
name: Single Press
description: Action to run on button 2 (right) single press
default: []
selector:
action: {}
button_two_double_press:
name: Double Press
description: Action to run on button 2 (right) double press
default: []
selector:
action: {}
button_two_long_press:
name: Long Press
description: Action to run on button 2 (right) long press
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'tuya_2button_scene_switch'
action:
- variables:
command: '{{ trigger.event.data.command }}'
endpoint_id: '{{ trigger.event.data.endpoint_id }}'
- choose:
- conditions: "{{ command == 'remote_button_short_press' }}"
sequence:
- choose:
- conditions: '{{ endpoint_id == 1 }}'
sequence: !input 'button_one_short_press'
- conditions: '{{ endpoint_id == 2 }}'
sequence: !input 'button_two_short_press'
- conditions: "{{ command == 'remote_button_double_press' }}"
sequence:
- choose:
- conditions: '{{ endpoint_id == 1 }}'
sequence: !input 'button_one_double_press'
- conditions: '{{ endpoint_id == 2 }}'
sequence: !input 'button_two_double_press'
- conditions: "{{ command == 'remote_button_long_press' }}"
sequence:
- choose:
- conditions: '{{ endpoint_id == 1 }}'
sequence: !input 'button_one_long_press'
- conditions: '{{ endpoint_id == 2 }}'
sequence: !input 'button_two_long_press'