generated from esphome/esphome-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesphome-gauhartas204-esp8266.yaml
255 lines (219 loc) · 5.51 KB
/
esphome-gauhartas204-esp8266.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
esphome:
name: esphome-gauhartas204
friendly_name: ESPHome Gauhartas 204
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
# name_add_mac_suffix: true
includes:
- uart_read_line_sensor.h
esp8266:
board: d1_mini
framework:
version: recommended
# To be able to get logs from the device via serial and api.
logger:
baud_rate: 0
# API is a requirement of the dashboard import.
api:
# OTA is required for Over-the-Air updating
ota:
- platform: esphome
wifi:
# Set up a wifi access point using the device name above
ap:
# In combination with the `ap` this allows the user
# to provision wifi credentials to the device.
captive_portal:
web_server:
port: 80
version: 3
uart:
- id: uart_bus
baud_rate: 19200
tx_pin: GPIO1
rx_pin: GPIO3
switch:
# - platform: uart
# name: "prt10"
# id: "prt10"
# data:
# turn_on: "*1 PRT 0 1 $\r\n"
# turn_off: "*1 PRT 0 0 $\r\n"
- platform: uart
name: "BathroomLight"
id: "BathroomLight"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*1 PRT 1 1 $\r\n"
turn_off: "*1 PRT 1 0 $\r\n"
- platform: uart
name: "BathroomHall"
id: "BathroomHall"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*1 PRT 2 1 $\r\n"
turn_off: "*1 PRT 2 0 $\r\n"
- platform: uart
name: "KitchenLight"
id: "KitchenLight"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*1 PRT 3 1 $\r\n"
turn_off: "*1 PRT 3 0 $\r\n"
- platform: uart
name: "KitchenTable"
id: "KitchenTable"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*1 PRT 4 1 $\r\n"
turn_off: "*1 PRT 4 0 $\r\n"
- platform: uart
name: "LobbyLight"
id: "LobbyLight"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*1 PRT 5 1 $\r\n"
turn_off: "*1 PRT 5 0 $\r\n"
- platform: uart
name: "LivingroomSubLight"
id: "LivingroomSubLight"
icon: "mdi:wall-sconce"
data:
turn_on: "*1 PRT 6 1 $\r\n"
turn_off: "*1 PRT 6 0 $\r\n"
- platform: uart
name: "BathroomSubLight"
id: "BathroomSubLight"
icon: "mdi:wall-sconce"
data:
turn_on: "*1 PRT 7 1 $\r\n"
turn_off: "*1 PRT 7 0 $\r\n"
# - platform: uart
# name: "prt20"
# id: "prt20"
# data:
# turn_on: "*2 PRT 0 1 $\r\n"
# turn_off: "*2 PRT 0 0 $\r\n"
- platform: uart
name: "SleepingroomRight"
id: "SleepingroomRight"
icon: "mdi:wall-sconce"
data:
turn_on: "*2 PRT 1 1 $\r\n"
turn_off: "*2 PRT 1 0 $\r\n"
- platform: uart
name: "BalconyLight"
id: "BalconyLight"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*2 PRT 2 1 $\r\n"
turn_off: "*2 PRT 2 0 $\r\n"
- platform: uart
name: "SleepingroomLight"
id: "SleepingroomLight"
icon: "mdi:bed-king-outline"
data:
turn_on: "*2 PRT 3 1 $\r\n"
turn_off: "*2 PRT 3 0 $\r\n"
# - platform: uart
# name: "prt24"
# id: "prt24"
# data:
# turn_on: "*2 PRT 4 1 $\r\n"
# turn_off: "*2 PRT 4 0 $\r\n"
- platform: uart
name: "SleepingroomLeft"
id: "SleepingroomLeft"
icon: "mdi:wall-sconce"
data:
turn_on: "*2 PRT 5 1 $\r\n"
turn_off: "*2 PRT 5 0 $\r\n"
- platform: uart
name: "LivingroomLight"
id: "LivingroomLight"
icon: "mdi:ceiling-light-multiple-outline"
data:
turn_on: "*2 PRT 6 1 $\r\n"
turn_off: "*2 PRT 6 0 $\r\n"
- platform: uart
name: SleepingroomWardrobe
id: SleepingroomWardrobe
icon: "mdi:wardrobe-outline"
data:
turn_on: "*2 PRT 7 1 $\r\n"
turn_off: "*2 PRT 7 0 $\r\n"
button:
- platform: uart
name: "Выключить всё"
data: "*999998$\r\n"
id: "alloff"
icon: "mdi:power"
# Вода перекрывается, сигнал об утечке
- platform: uart
entity_category: "diagnostic"
name: "wm_alr"
data: "*WM ALR$\r\n"
- platform: uart
entity_category: "diagnostic"
name: "wm_on"
data: "*WM ON$\r\n"
- platform: uart
entity_category: "diagnostic"
name: "wm_off"
data: "*WM OFF$\r\n"
# - platform: uart
# entity_category: "diagnostic"
# name: "wm_wsd"
# data: "*WM WSD$\r\n"
# - platform: uart
# entity_category: "diagnostic"
# name: "rk_wm_low"
# data: "*RK WM LOW$\r\n"
# - platform: uart
# entity_category: "diagnostic"
# name: "wm_reb"
# data: "*WM REB$\r\n"
- platform: restart
entity_category: "diagnostic"
name: "Restart ESPHOME"
valve:
- platform: template
name: "water"
id: "rkwm"
device_class: water
icon: "mdi:water"
optimistic: false
has_position: false
open_action:
- uart.write:
data: "*WM ON$\r\n"
close_action:
- uart.write:
data: "*WM OFF$\r\n"
# Сенсор, считывающий ответы из UART
text_sensor:
- platform: custom
lambda: |-
auto uart_readline_sensor = new UartReadLineSensor(id(uart_bus));
App.register_component(uart_readline_sensor);
return {uart_readline_sensor};
text_sensors:
- name: "latestSerial"
entity_category: "diagnostic"
- platform: version
name: "ESPHome Version"
interval:
- interval: 120s
then:
- uart.write:
data: "*1 STS$\r\n"
- delay: 3s
- uart.write:
data: "*2 STS$\r\n"
- delay: 3s
- uart.write:
data: "*WM INF$\r\n"
status_led:
pin:
number: D4
inverted: true