-
Notifications
You must be signed in to change notification settings - Fork 0
/
esp32-display.yaml
365 lines (331 loc) · 12.9 KB
/
esp32-display.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
esphome:
name: esp32-display
platform: ESP32
board: esp32dev
wifi:
networks:
- ssid: !secret ssid
bssid: CC:CE:1E:D8:20:7D
password: !secret wlan_pwd
# fast_connect: true
# Optional manual IP
manual_ip:
static_ip: 192.168.0.141
gateway: 192.168.0.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Wemos Display Fallback Hotspot"
password: "dDES3QVg9Asp"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
spi:
clk_pin: GPIO13
mosi_pin: GPIO14
display:
- platform: waveshare_epaper
id: epaper
cs_pin: GPIO15
dc_pin: GPIO27
busy_pin: GPIO25
reset_pin: GPIO26
model: 2.90in
rotation: 90°
full_update_every: 180
pages:
- id: page1
lambda: |-
it.strftime(295, 0, id(comic15), TextAlign::TOP_RIGHT, "%H:%M", id(esptime).now());
it.strftime(140, 0, id(comic15), TextAlign::TOP_LEFT, "%d-%b-%y", id(esptime).now());
it.strftime(30, 0, id(comic15), TextAlign::TOP_LEFT, "%A", id(esptime).now());
// Print line underneath date and time
it.line(0, 20, 296, 20);
// Print Wetter Info
it.printf(20, 22, id(comic15), "Wetterinfo:");
it.printf(5, 38, id(comic15), "Heute:");
// Print Wetter Symbol
if (id(current_condition).has_state()) {
std::map<std::string, std::string> weather_icon_map
{
{"clear-night", "\U000F0594"},
{"cloudy", "\U000F0590"},
{"exceptional", "\U000F069B"},
{"fog", "\U000F0591"},
{"hail", "\U000F0592"},
{"lightning", "\U000F0593"},
{"lightning-rainy", "\U000F067E"},
{"partlycloudy", "\U000F0595"},
{"pouring", "\U000F0596"},
{"rainy", "\U000F0597"},
{"snwoy", "\U000F0598"},
{"snowy-rainy", "\U000F067F"},
{"sunny", "\U000F0599"},
{"windy", "\U000F059D"},
{"windy-variant", "\U000F059E"},
};
it.printf(20, 60, id(icon_font30), TextAlign::TOP_LEFT , weather_icon_map[id(current_condition).state.c_str()].c_str());
}
// Print Wetter Forecast
it.printf(65, 38, id(comic15), "Morgen:");
if (id(forecast_condition).has_state()) {
std::map<std::string, std::string> weather_icon_map2
{
{"clear-night", "\U000F0594"},
{"cloudy", "\U000F0590"},
{"exceptional", "\U000F069B"},
{"fog", "\U000F0591"},
{"hail", "\U000F0592"},
{"lightning", "\U000F0593"},
{"lightning-rainy", "\U000F067E"},
{"partlycloudy", "\U000F0595"},
{"pouring", "\U000F0596"},
{"rainy", "\U000F0597"},
{"snwoy", "\U000F0598"},
{"snowy-rainy", "\U000F067F"},
{"sunny", "\U000F0599"},
{"windy", "\U000F059D"},
{"windy-variant", "\U000F059E"},
};
it.printf(80, 60, id(icon_font30), TextAlign::TOP_LEFT, weather_icon_map2[id(forecast_condition).state.c_str()].c_str());
}
// Mondphase anzeigen
it.printf(135, 22, id(comic15), TextAlign::TOP_LEFT, "Mond-");
it.printf(135, 39, id(comic15), TextAlign::TOP_LEFT, "phase:");
if (id(moon).has_state()) {
std::map<std::string, std::string> moon_icon_map
{
{"new_moon", "\U000F0F64"},
{"full_moon", "\U000F0F62"},
{"waxing_crescent", "\U000F0F67"},
{"first_quarter", "\U000F0F61"},
{"waxing_gibbous", "\U000F0F68"},
{"waning_gibbous", "\U000F0F66"},
{"lightning-rainy", "\U000F067E"},
{"last_quarter", "\U000F0F63"},
{"waning_crescent", "\U000F0F65"},
};
it.printf(155, 80, id(icon_font30), TextAlign::CENTER, moon_icon_map[id(moon).state.c_str()].c_str());
}
// Print line behind moon phase
it.line(185, 20, 185, 128);
// Print sunrise and sun setting dates
it.printf(195, 25, id(icon_font25), TextAlign::TOP_LEFT, "\U000F059C");
if (id(next_sunrise).has_state()) {
it.printf(225, 22, id(comic15), TextAlign::TOP_LEFT, "%s", id(next_sunrise).state.c_str());
}
it.printf(195, 53, id(icon_font25), TextAlign::TOP_LEFT, "\U000F059B");
if (id(next_sunset).has_state()) {
it.printf(225, 55, id(comic15), TextAlign::TOP_LEFT, "%s", id(next_sunset).state.c_str());
}
// Print outside temperature (from homeassistant sensor)
if (id(outside_temperature).has_state()) {
it.printf(40, 100, id(comic15), TextAlign::CENTER, "%.1f°", id(outside_temperature).state);
}
it.printf(10, 100, id(icon_font15), TextAlign::CENTER, "\U000F0599");
// Print inside temperature (from homeassistant sensor)
if (id(inside_temperature).has_state()) {
it.printf(40, 120, id(comic15), TextAlign::CENTER, "%.1f°", id(inside_temperature).state);
}
it.printf(10, 120, id(icon_font15), TextAlign::CENTER, "\U000F04B9");
// Print forecast temperature (from homeassistant sensor)
if (id(forecast_temp).has_state()) {
it.printf(102, 100, id(comic15), TextAlign::CENTER, "%.1f°", id(forecast_temp).state);
}
it.printf(75, 100, id(icon_font15), TextAlign::CENTER, "\U000F0737");
// Print forecast_low temperature (from homeassistant sensor)
if (id(forecast_temp_low).has_state()) {
it.printf(102, 120, id(comic15), TextAlign::CENTER, "%.1f°", id(forecast_temp_low).state);
}
it.printf(75, 120, id(icon_font15), TextAlign::CENTER, "\U000F072E");
// Print line behind weather info
it.line(130, 20, 130, 128);
// Print inside temperature (from homeassistant sensor)
// if (id(inside_temperature).has_state()) {
// it.printf(127, 80, id(font3), TextAlign::TOP_RIGHT , "%.1f°", id(inside_temperature).state);
// }
- id: page2
lambda: |-
it.strftime(295, 0, id(comic15), TextAlign::TOP_RIGHT, "%H:%M", id(esptime).now());
it.strftime(140, 0, id(comic15), TextAlign::TOP_LEFT, "%d-%b-%y", id(esptime).now());
it.strftime(30, 0, id(comic15), TextAlign::TOP_LEFT, "%A", id(esptime).now());
// Print line underneath date and time
it.line(0, 20, 296, 20);
// Print Weather Warnings
it.printf(20, 22, id(comic15), "Wetterwarnungen:");
if (id(akt_warning_level).has_state()) {
it.printf(20,45, id(comic15), TextAlign::TOP_LEFT, "Die akt. Warnstufe ist: %s", id(akt_warning_level).state.c_str());
}
if (id(akt_warning_headline).has_state()) {
it.printf(20, 70, id(comic15), TextAlign::TOP_LEFT, "%s", id(akt_warning_headline).state.c_str());
}
//if (id(akt_warning_text).has_state()) {
// it.printf(20, 70, id(comic15), TextAlign::TOP_LEFT, "%s", id(akt_warning_text).state.c_str());
//}
interval:
- interval: 5s
then:
- display.page.show_next: epaper
- component.update: epaper
font:
- file: 'fonts/comicbd.ttf'
id: comic15
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/comic.ttf'
id: comic20
size: 20
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: icon_font30
size: 30
glyphs:
- "\U000F0590" # weather-cloudy
- "\U000F0F2F" # weather-cloudy-alert
- "\U000F0E6E" # weather-cloudy-arrow-right
- "\U000F0591" # weather-fog
- "\U000F0592" # weather-hail
- "\U000F0F30" # weather-hazy
- "\U000F0898" # weather-hurricane
- "\U000F0593" # weather-lightning
- "\U000F067E" # weather-lightning-rainy
- "\U000F0594" # weather-night
- "\U000F0F31" # weather-night-partly-cloudy
- "\U000F0595" # weather-partly-cloudy
- "\U000F0F32" # weather-partly-lightning
- "\U000F0F33" # weather-partly-rainy
- "\U000F0F34" # weather-partly-snowy
- "\U000F0F35" # weather-partly-snowy-rainy
- "\U000F0596" # weather-pouring
- "\U000F0597" # weather-rainy
- "\U000F0598" # weather-snowy
- "\U000F0F36" # weather-snowy-heavy
- "\U000F067F" # weather-snowy-rainy
- "\U000F0599" # weather-sunny
- "\U000F0F37" # weather-sunny-alert
- "\U000F14E4" # weather-sunny-off
- "\U000F059A" # weather-sunset
- "\U000F059B" # weather-sunset-down
- "\U000F059C" # weather-sunset-up
- "\U000F0F38" # weather-tornado
- "\U000F059D" # weather-windy
- "\U000F059E" # weather-windy-variant
- "\U000F069B" # emoticon-dead-outline for weather exeptional
- "\U000F0F61" # moon-first-quarter
- "\U000F0F62" # moon-full
- "\U000F0F63" # moon-last-quarter
- "\U000F0F64" # moon-new
- "\U000F0F65" # moon-waning-crescent
- "\U000F0F66" # moon-waning-gibbous
- "\U000F0F67" # moon-waxing-cresent
- "\U000F0F68" # moon-waxing-gibbous
- file: 'fonts/materialdesignicons-webfont.ttf'
id: icon_font20
size: 20
glyphs:
- "\U000F0F61" # moon-first-quarter
- "\U000F0F62" # moon-full
- "\U000F0F63" # moon-last-quarter
- "\U000F0F64" # moon-new
- "\U000F0F65" # moon-waning-crescent
- "\U000F0F66" # moon-waning-gibbous
- "\U000F0F67" # moon-waxing-cresent
- "\U000F0F68" # moon-waxing-gibbous
- "\U000F059B" # weather-sunset-down
- "\U000F059C" # weather-sunset-up
- file: 'fonts/materialdesignicons-webfont.ttf'
id: icon_font25
size: 25
glyphs:
- "\U000F059B" # weather-sunset-down
- "\U000F059C" # weather-sunset-up
- file: 'fonts/materialdesignicons-webfont.ttf'
id: icon_font15
size: 15
glyphs:
- "\U000F0737" # arrow-up-bold
- "\U000F072E" # arrow-down-bold
- "\U000F02DC" # home
- "\U000F04B9" # sofa
- "\U000F0599" # sun
time:
- platform: homeassistant
id: esptime
timezone: Europe/Berlin
sensor:
- platform: wifi_signal
name: "Wemos Display WiFi Signal"
update_interval: 900s
- platform: uptime
name: "Wemos Display Uptime"
- platform: homeassistant
id: outside_temperature
entity_id: sensor.aussentemperatur
internal: true
- platform: homeassistant
id: inside_temperature
entity_id: sensor.multisensor_wohnzimmer_2
internal: true
- platform: homeassistant
id: forecast_temp
entity_id: sensor.openweathermap_forecast_temperature
internal: true
- platform: homeassistant
id: forecast_temp_low
entity_id: sensor.openweathermap_forecast_temperature_low
internal: true
text_sensor:
- platform: homeassistant
id: akt_warning_headline
entity_id: sensor.act_weather_warning_headline
internal: true
- platform: homeassistant
id: akt_warning_level
entity_id: sensor.act_weather_warning_level
internal: true
- platform: homeassistant
id: next_sunset
entity_id: sensor.esphome_next_sunset
internal: true
- platform: homeassistant
id: next_sunrise
entity_id: sensor.esphome_next_sunrise
internal: true
- platform: homeassistant
id: moon
entity_id: sensor.moon
internal: true
- platform: homeassistant
id: forecast_condition
entity_id: sensor.openweathermap_forecast_condition
internal: true
- platform: homeassistant
id: current_condition
entity_id: sensor.openweathermap_condition
internal: true
- platform: wifi_info
ip_address:
name: "Wemos Dislpay IP"
- platform: version
name: Wemos Display ESPHome Version
hide_timestamp: True
switch:
- platform: restart
name: "Wemos Display Restart"
- platform: shutdown
name: "Wemos Display Shutdown"