-
Notifications
You must be signed in to change notification settings - Fork 0
/
display-pool.yaml
385 lines (323 loc) · 12.2 KB
/
display-pool.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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
esphome:
name: display-pool
friendly_name: Display_Pool
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "**********"
ota:
password: "**********"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Display-Pool Fallback Hotspot"
password: "**********"
captive_portal:
font:
- file: 'fonts/ConsolaMono-Bold.ttf'
id: consolaMono_bold_15
size: 15
glyphs:
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'ä', 'ö', '/','º','µ','³']
- file: 'fonts/ConsolaMono-Bold.ttf'
id: consolaMono_bold_22
size: 22
glyphs:
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'ä', 'ö', '/','º','µ','³']
- file: 'fonts/ConsolaMono-Bold.ttf'
id: consolaMono_bold_25
size: 25
glyphs:
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'ä', 'ö', '/','º','µ','³']
- file: 'fonts/ConsolaMono-Bold.ttf'
id: consolaMono_bold_35
size: 35
glyphs:
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'ä', 'ö', '/','º','µ','³']
- file: 'fonts/materialdesignicons-webfont.ttf'
id: wifi_font_30
size: 30
glyphs: [
# Wifi
"\U000F092F", # mdi-wifi-strength-outline
"\U000F091F", # mdi-wifi-strength-1
"\U000F0922", # mdi-wifi-strength-2
"\U000F0925", # mdi-wifi-strength-3
"\U000F0928", # mdi-wifi-strength-4
]
- file: 'fonts/materialdesignicons-webfont.ttf'
id: display_font_30
size: 30
glyphs: [
"\U000F18D6", # mdi-sun-thermometer
"\U000F1A5F", # mdi-pool-thermometer
"\U000F0606", # mdi-pool
"\U000F1A73", # mdi-pv
"\U000F1402", # mdi-pump
"\U000F1B22", # mdi-pump-off
"\U000F06E9", # mdi-light
"\U000F0E50", # mdi-light-off
]
- file: 'fonts/materialdesignicons-webfont.ttf'
id: display_font_50
size: 50
glyphs: [
"\U000F18D6", # mdi-sun-thermometer
"\U000F1A5F", # mdi-pool-thermometer
"\U000F0606", # mdi-pool
"\U000F1A73", # mdi-pv
"\U000F1402", # mdi-pump
"\U000F1B22", # mdi-pump-off
"\U000F06E9", # mdi-light
"\U000F0E50", # mdi-light-off
]
time:
- platform: homeassistant
id: homeassistant_time
timezone: Europe/Berlin
on_time:
- seconds: 0
minutes: /1 # Update jede Minute
hours: 8-22
then:
- component.update: epaperdisplay
- seconds: 0
minutes: /30 # Update alle 30 Minuten
hours: 0-7, 23
then:
- component.update: epaperdisplay
spi:
clk_pin: 14
mosi_pin: 13
binary_sensor:
- platform: homeassistant
id: Schalter_Pumpe
entity_id: switch.**********
internal: true
- platform: homeassistant
id: Schalter_Licht
entity_id: switch.**********
internal: true
- platform: homeassistant
id: Schalter_PH
entity_id: switch.**********
internal: true
- platform: homeassistant
id: Schalter_ORP
entity_id: switch.**********
internal: true
- platform: homeassistant
id: Schalter_WP
entity_id: switch.**********
internal: true
sensor:
- platform: wifi_signal
name: "WiFi Signal Sensor"
id: wifisignal
- platform: homeassistant
id: temp_aussen
entity_id: sensor.**********
- platform: homeassistant
id: temp_wasser
entity_id: sensor.**********
- platform: homeassistant
id: pv_anlage
entity_id: sensor.**********
- platform: homeassistant
id: pool_orp
entity_id: sensor.**********
- platform: homeassistant
id: pool_ph
entity_id: sensor.**********h
- platform: homeassistant
id: pool_ph_min
entity_id: sensor.**********
- platform: homeassistant
id: pool_ph_max
entity_id: sensor.**********
- platform: homeassistant
id: pool_orp_min
entity_id: sensor.**********
- platform: homeassistant
id: pool_orp_max
entity_id: sensor.**********
- platform: homeassistant
id: aussentemperatur_min
entity_id: sensor.**********
- platform: homeassistant
id: aussentemperatur_max
entity_id: sensor.**********
- platform: homeassistant
id: wassertemperatur_min
entity_id: sensor.**********
- platform: homeassistant
id: wassertemperatur_max
entity_id: sensor.**********
graph:
- id: temp_aussen_graph
sensor: temp_aussen
duration: 12h
width: 100
height: 60
border: true
line_thickness: 2
line_type: solid
- id: temp_wasser_graph
sensor: temp_wasser
duration: 12h
width: 100
height: 60
border: true
line_thickness: 2
line_type: solid
- id: temp_pool_ph
sensor: pool_ph
duration: 12h
width: 100
height: 60
border: true
line_thickness: 2
line_type: solid
- id: temp_pool_orp
sensor: pool_orp
duration: 12h
width: 100
height: 60
border: true
line_thickness: 2
line_type: solid
display:
- platform: waveshare_epaper
id: epaperdisplay
cs_pin: 15
dc_pin: 12
busy_pin: 16
reset_pin: 4
model: 4.20in
update_interval: never
lambda: |-
/* V Linie */
it.line(120, 0, 120, 300);
/* H Linie */
it.line(120, 75, 400, 75);
it.line(0, 150, 400, 150);
it.line(120, 225, 400, 225);
it.strftime(60, 40 , id(consolaMono_bold_35), TextAlign::BASELINE_CENTER , "%H:%M", id(homeassistant_time).now());
/* Aussentemperatur */
it.printf(155,55, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F18D6");
it.printf(240,45, id(consolaMono_bold_25), TextAlign::BASELINE_CENTER, "%.1f°C", id(temp_aussen).state);
it.graph(295,5, id(temp_aussen_graph));
it.printf(240,15, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "%.1f°C", id(aussentemperatur_max).state);
it.printf(240,65, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "%.1f°C", id(aussentemperatur_min).state);
/* Wassertemperatur */
it.printf(155,130, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F1A5F");
it.printf(240,125, id(consolaMono_bold_25), TextAlign::BASELINE_CENTER, "%.1f°C", id(temp_aussen).state);
it.graph(295,85, id(temp_wasser_graph));
it.printf(240,95, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "%.1f°C", id(wassertemperatur_max).state);
it.printf(240,145, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "%.1f°C", id(wassertemperatur_min).state);
/* PH */
it.printf(155,205, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F0606");
it.printf(155,220, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "PH");
it.printf(240,200, id(consolaMono_bold_25), TextAlign::BASELINE_CENTER, "%.1f", id(pool_ph).state);
it.graph(295,160, id(temp_pool_ph));
it.printf(240,170, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "%.1f", id(pool_ph_max).state);
it.printf(240,220, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "%.1f", id(pool_ph_min).state);
/* ORP */
it.printf(155,280, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F0606");
it.printf(155,295, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "ORP");
it.printf(240,275, id(consolaMono_bold_25), TextAlign::BASELINE_CENTER, "%.1fmV", id(pool_orp).state);
it.graph(295,235, id(temp_pool_ph));
it.printf(240,245, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "%.1fmV", id(pool_orp_max).state);
it.printf(240,295, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "%.1fmV", id(pool_orp_min).state);
/* PV */
it.printf(90,130, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F1A73");
it.printf(90,145, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "%.1fkw", id(pv_anlage).state);
/* Pumpe Symbol An/Aus*/
if(id(Schalter_Pumpe).state) {
it.print(30,205, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F1402");
} else {
it.print(30,205, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F1B22");
}
it.printf(30,220, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "Pumpe");
/* Licht Symbol An/Aus*/
if(id(Schalter_Licht).state) {
it.print(30,130, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F06E9");
} else {
it.print(30,130, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F0E50");
}
it.printf(30,145, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "Licht");
/* PH Pumpe Symbol An/Aus*/
if(id(Schalter_PH).state) {
it.print(90,205, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F1402");
} else {
it.print(90,205, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F1B22");
}
it.printf(90,220, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "PH");
/* ORP Pumpe Symbol An/Aus*/
if(id(Schalter_ORP).state) {
it.print(90,280, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F1402");
} else {
it.print(90,280, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F1B22");
}
it.printf(90,295, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "ORP");
/* Wärmepumpe Symbol An/Aus*/
if(id(Schalter_WP).state) {
it.print(30,280, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F1402");
} else {
it.print(30,280, id(display_font_50), TextAlign::BASELINE_CENTER, "\U000F1B22");
}
it.printf(30,295, id(consolaMono_bold_15), TextAlign::BASELINE_CENTER, "WP");
/* WIFI SIGNAL */
if(id(wifisignal).has_state()) {
int wifi_x = 60;
int wifi_y = 80;
if (id(wifisignal).state >= -50) {
// Excellent
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F0928");
ESP_LOGI("WiFi", "Exellent");
} else if (id(wifisignal).state >= -60) {
// Good
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F0925");
ESP_LOGI("WiFi", "Good");
} else if (id(wifisignal).state >= -75) {
// Fair
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F0922");
ESP_LOGI("WiFi", "Fair");
} else if (id(wifisignal).state >= -100) {
// Weak
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F091F");
ESP_LOGI("WiFi", "Weak");
} else {
// Unlikely working signal
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F092F");
ESP_LOGI("WiFi", "Unlikely");
}
}