-
Notifications
You must be signed in to change notification settings - Fork 7
/
discovery-topgreener_TGWFSC8-W.yaml
144 lines (137 loc) · 6.33 KB
/
discovery-topgreener_TGWFSC8-W.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
138
139
140
141
142
143
144
blueprint:
name: 'Tasmota Discovery: TopGreener Smart Scene Controller (TGWFSC8-W)'
description: |
Requires some rules configured in Tasmota. See your device template page for rules:
- [TopGreener Smart Scene Controller (TGWFSC8-W)](https://templates.blakadder.com/topgreener_TGWFSC8-W)
domain: automation
input:
topic:
name: Tasmota MQTT Topic
description: "Found in Information tab of the webUI."
selector:
text:
mac_address:
name: Tasmota MAC Address
description: "Found in Information tab of the webUI."
mode: single
max_exceeded: silent
variables:
topic: !input topic
mac_address: !input mac_address
macaddr: '{{- mac_address.split(":") | join -}}'
payload_btn1short: >-
{{ '{"automation_type":"trigger","topic":"' ~ topic ~ '/btn1","subtype":"button_1","type":"button_short_press","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn1double: >-
{{ '{"automation_type":"trigger","subtype":"button_1","type":"button_double_press","topic":"' ~ topic ~ '/btn1","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn2short: >-
{{ '{"automation_type":"trigger","subtype":"button_2","type":"button_short_press","topic":"' ~ topic ~ '/btn2","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn2double: >-
{{ '{"automation_type":"trigger","subtype":"button_2","type":"button_double_press","topic":"' ~ topic ~ '/btn2","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn3short: >-
{{ '{"automation_type":"trigger","subtype":"button_3","type":"button_short_press","topic":"' ~ topic ~ '/btn3","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn3double: >-
{{ '{"automation_type":"trigger","subtype":"button_3","type":"button_double_press","topic":"' ~ topic ~ '/btn3","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn4short: >-
{{ '{"automation_type":"trigger","subtype":"button_4","type":"button_short_press","topic":"' ~ topic ~ '/btn4","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn4double: >-
{{ '{"automation_type":"trigger","subtype":"button_4","type":"button_double_press","topic":"' ~ topic ~ '/btn4","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn5short: >-
{{ '{"automation_type":"trigger","subtype":"button_5","type":"button_short_press","topic":"' ~ topic ~ '/btn5","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn5double: >-
{{ '{"automation_type":"trigger","subtype":"button_5","type":"button_double_press","topic":"' ~ topic ~ '/btn5","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn6short: >-
{{ '{"automation_type":"trigger","subtype":"button_6","type":"button_short_press","topic":"' ~ topic ~ '/btn6","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn6double: >-
{{ '{"automation_type":"trigger","subtype":"button_6","type":"button_double_press","topic":"' ~ topic ~ '/btn6","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn7short: >-
{{ '{"automation_type":"trigger","subtype":"button_7","type":"button_short_press","topic":"' ~ topic ~ '/btn7","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
payload_btn7double: >-
{{ '{"automation_type":"trigger","subtype":"button_7","type":"button_double_press","topic":"' ~ topic ~ '/btn7","device":{"connections":[["mac","' ~ macaddr ~ '"]]}} '}}
trigger_variables:
topic: !input topic
trigger:
- platform: homeassistant
event: start
- platform: mqtt
topic: '{{ "tele/" ~ topic ~ "/LWT" }}'
payload: "Online"
action:
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn1short/config"
retain: true
payload: "{{ payload_btn1short }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn1double/config"
retain: true
payload: "{{ payload_btn1double }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn2short/config"
retain: true
payload: "{{ payload_btn2short }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn2double/config"
retain: true
payload: "{{ payload_btn2double }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn3short/config"
retain: true
payload: "{{ payload_btn3short }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn3double/config"
retain: true
payload: "{{ payload_btn3double }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn4short/config"
retain: true
payload: "{{ payload_btn4short }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn4double/config"
retain: true
payload: "{{ payload_btn4double }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn5short/config"
retain: true
payload: "{{ payload_btn5short }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn5double/config"
retain: true
payload: "{{ payload_btn5double }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn6short/config"
retain: true
payload: "{{ payload_btn6short }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn6double/config"
retain: true
payload: "{{ payload_btn6double }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn7short/config"
retain: true
payload: "{{ payload_btn7short }}"
- service: mqtt.publish
data:
topic: "homeassistant/device_automation/{{ macaddr }}/btn7double/config"
retain: true
payload: "{{ payload_btn7double }}"
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: mqtt.publish
data:
topic: "cmnd/{{ topic }}/tuyasend0"
payload: ""