-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdashboard.yaml
651 lines (615 loc) · 24.4 KB
/
dashboard.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
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
substitutions:
esp_name: ESP Dashboard
esp_hostname: esp-dashboard
ip_address: 192.168.0.234
ip_gw: 192.168.0.1
ip_netmask: 255.255.255.0
esphome:
name: dashboard
includes:
- common.h
esp32:
board: esp32dev
framework:
type: arduino
logger:
api:
password: ""
ota:
password: ""
wifi:
ssid: "Cruiser"
password: !secret wifi_password
manual_ip:
static_ip: ${ip_address}
gateway: ${ip_gw}
subnet: ${ip_netmask}
ap:
ssid: "${esp_name} Fallback Hotspot"
password: !secret wifi_password
web_server:
port: 80
include_internal: true
sun:
latitude: 47.498406°
longitude: 19.040758°
time:
- platform: homeassistant
id: ntp
timezone: Europe/Budapest
on_time_sync:
- then:
- component.update: sunrise
- component.update: sunset
external_components:
# - source: github://ashald/esphome@lilygo-t5-47
# components:
# - lilygo_t5_47
# - source:
# type: git
# url: https://github.com/vbaksa/esphome
# ref: dev
# components:
# - lilygo_t5_47_battery
# - lilygo_t5_47_display
# - source: github://tiaanv/esphome-components
# components:
# - t547
- source:
type: git
url: https://github.com/kaweksl/esphome
ref: dev
components:
- lilygo_t5_47_battery
- lilygo_t5_47_display
script:
- id: all_data_received
then:
- component.update: t5_display
sensor:
# weather
- platform: homeassistant
entity_id: sensor.idokep_temperature
id: temperature
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day1_min
id: day1_min
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day1_max
id: day1_max
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day1_prec_mm
id: day1_prec
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day2_min
id: day2_min
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day2_max
id: day2_max
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day2_prec_mm
id: day2_prec
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day3_min
id: day3_min
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day3_max
id: day3_max
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day3_prec_mm
id: day3_prec
internal: true
# temperature/humidity sensors
- platform: homeassistant
entity_id: sensor.halo_hmer_temperature
id: temp_halo
internal: true
- platform: homeassistant
entity_id: sensor.halo_hmer_humidity
id: humidity_halo
internal: true
- platform: homeassistant
entity_id: sensor.living_room_sensor_temperature
id: temp_nappali
internal: true
- platform: homeassistant
entity_id: sensor.living_room_sensor_humidity
id: humidity_nappali
internal: true
- platform: homeassistant
entity_id: sensor.bedroom_sensor_temperature
id: temp_dani
internal: true
- platform: homeassistant
entity_id: sensor.bedroom_sensor_humidity
id: humidity_dani
internal: true
- platform: homeassistant
entity_id: sensor.matthew_sensor_temperature
id: temp_mate
internal: true
- platform: homeassistant
entity_id: sensor.matthew_sensor_humidity
id: humidity_mate
internal: true
- platform: homeassistant
entity_id: sensor.lucy_sensor_temperature
id: temp_luca
internal: true
- platform: homeassistant
entity_id: sensor.lucy_sensor_humidity
id: humidity_luca
internal: true
binary_sensor:
- platform: gpio
pin:
number: GPIO39
inverted: true
name: "lilygo-t5 Button 1"
on_press:
then:
- component.update: t5_display
- platform: homeassistant
entity_id: binary_sensor.idokep_temp_falling
id: temp_falling
internal: true
- platform: homeassistant
entity_id: binary_sensor.idokep_temp_rising
id: temp_rising
internal: true
text_sensor:
# sun/moon
- platform: sun
id: sunrise
name: Sun Next Sunrise
type: sunrise
format: "%H:%M"
internal: true
- platform: sun
id: sunset
name: Sun Next Sunset
type: sunset
format: "%H:%M"
internal: true
- platform: homeassistant
entity_id: sun.sun
id: hasun
internal: true
- platform: homeassistant
entity_id: sensor.moon
id: moon
internal: true
# weather
- platform: homeassistant
entity_id: sensor.idokep_condition
id: condition
internal: true
on_value: # Actions to perform once data for the last sensor has been received
then:
- script.execute: all_data_received
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day1_dow
id: day1_dow
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day1_condition
id: day1_condition
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day2_dow
id: day2_dow
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day2_condition
id: day2_condition
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day3_dow
id: day3_dow
internal: true
- platform: homeassistant
entity_id: sensor.idokep_daily_data
attribute: day3_condition
id: day3_condition
internal: true
# spotify
# - platform: homeassistant
# entity_id: media_player.spotify_totesz
# id: spotify_playing_status
# internal: true
# - platform: homeassistant
# entity_id: media_player.spotify_totesz
# attribute: media_title
# id: spotify_playing_title
# internal: true
# - platform: homeassistant
# entity_id: media_player.spotify_totesz
# attribute: media_artist
# id: spotify_playing_artist
# internal: true
# on_value: # Actions to perform once data for the last sensor has been received
# then:
# - script.execute: all_data_received
# calendar
- platform: homeassistant
entity_id: calendar.nevnapok
attribute: message
id: nevnap
internal: true
# zone tracking
- platform: homeassistant
entity_id: device_tracker.gabor_fon
id: gabor_location
internal: true
- platform: homeassistant
entity_id: sensor.gabor_distance
id: gabor_distance
internal: true
- platform: homeassistant
entity_id: device_tracker.verus_fon_3
id: verus_location
internal: true
- platform: homeassistant
entity_id: sensor.verus_distance
id: verus_distance
internal: true
font:
- file: "fonts/OpenSans-Medium.ttf"
id: font_small
size: 28
glyphs: |-
!"%()+=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz'/&|ÁÉÍÓÖŐÚÜŰáéíóöőúüű
- file: "fonts/OpenSans-Medium.ttf"
id: font_medium
size: 38
glyphs: |-
!"%()+=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz'/&|ÁÉÍÓÖŐÚÜŰáéíóöőúüű
- file: "fonts/OpenSans-Bold.ttf"
id: font_medium_bold
size: 38
glyphs: |-
!"%()+=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz'/&|ÁÉÍÓÖŐÚÜŰáéíóöőúüű
- file: "fonts/OpenSans-Medium.ttf"
id: font_big
size: 48
glyphs: |-
!"%()+=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz'/&|ÁÉÍÓÖŐÚÜŰáéíóöőúüű
- file: "fonts/OpenSans-Medium.ttf"
id: font_large
size: 56
glyphs: |-
!"%()+=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz'/&|ÁÉÍÓÖŐÚÜŰáéíóöőúüű
- file: "fonts/OpenSans-Bold.ttf"
id: font_xlarge_bold
size: 72
glyphs: |-
!"%()+=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz'/&|ÁÉÍÓÖŐÚÜŰáéíóöőúüű
# material UI icons - from https://pictogrammers.github.io/@mdi/font/5.3.45/
- file: 'fonts/materialdesignicons-webfont.ttf'
id: font_icons
size: 130
glyphs:
- "\U000F0594" # clear-night
- "\U000F0590" # cloudy
- "\U000F0591" # fog
- "\U000F0592" # hail
- "\U000F0593" # lightning
- "\U000F067E" # lightning-rainy
- "\U000F0F31" # night-partly-cloudy
- "\U000F0595" # partly-cloudy
- "\U000F0596" # pouring
- "\U000F0597" # rainy
- "\U000F0F36" # snowy
- "\U000F067F" # snowy-rainy
- "\U000F0599" # sunny
- "\U000F059D" # windy
- "\U000F059E" # windy-variant
- "\U000F0F38" # exCentereptional
- file: 'fonts/materialdesignicons-webfont.ttf'
id: font_icons_small
size: 56
glyphs:
# weather
- "\U000F0594" # clear-night
- "\U000F0590" # cloudy
- "\U000F0591" # fog
- "\U000F0592" # hail
- "\U000F0593" # lightning
- "\U000F067E" # lightning-rainy
- "\U000F0F31" # night-partly-cloudy
- "\U000F0595" # partly-cloudy
- "\U000F0596" # pouring
- "\U000F0597" # rainy
- "\U000F0F36" # snowy
- "\U000F067F" # snowy-rainy
- "\U000F0599" # sunny
- "\U000F059D" # windy
- "\U000F059E" # windy-variant
- "\U000F0F38" # exceptional
# moon phases
- "\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-crescent
- "\U000F0F68" # moon-waxing-gibbous
# other icons
- "\U000F10C2" # Temperature High
- "\U000F10C3" # Temperature Low
- "\U000F054B" # umbrella
- "\U000F02E3" # Bed
- "\U000F064D" # human-male
- "\U000F0649" # human-female
- "\U000F04B9" # sofa
- "\U000F04DB" # stop
- "\U000F040A" # play
- "\U000F03E4" # pause
- "\U000F0643" # man
- "\U000F1078" # woman
- "\U000F0E7C" # baby-face
- file: 'fonts/materialdesignicons-webfont.ttf'
id: font_icons_tiny
size: 32
glyphs:
- "\U000F005E" # arrow-up-thick
- "\U000F0046" # arrow-down-thick
- "\U000F059C" # Sunrise
- "\U000F059B" # Sunset
display:
- platform: lilygo_t5_47_display
full_update_every: 2 # optional (default: 1): 0 - never, 1 (default) - every, 2+ - throttled
#cycles_render: 20 # optional (default: 20): higher number -> less ghosting, crisper image, more time
#cycles_invert: 20 # optional (default: 20): higher number -> more timef or full update, but mor burn-in protection
id: t5_display
rotation: 0
update_interval: 60s
lambda: |-
// icon constants
#define ICON_temp_high "\U000F10C2"
#define ICON_temp_low "\U000F10C3"
#define ICON_umbrella "\U000F054B"
#define ICON_bed "\U000F02E3"
#define ICON_human_male "\U000F064D"
#define ICON_human_female "\U000F0649"
#define ICON_sofa "\U000F04B9"
#define ICON_man "\U000F0643"
#define ICON_woman "\U000F1078"
#define ICON_baby "\U000F0E7C"
#define ICON_up "\U000F005E"
#define ICON_down "\U000F0046"
#define ICON_sunrise "\U000F059C"
#define ICON_sunset "\U000F059B"
// positioning constants
#define xRes 960
#define yRes 540
#define xCenter (xRes/2 + 40) // X position center
#define pad 10
#define celsiusSuperscript 12
#define rowHeight 75
#define temperatureCol 195
#define humidityCol 300
#define weatherCol 120
#define weatherTempCorr 15
// helper variables
int y = 0;
// === Date ===
// time
auto time = id(ntp).now();
auto dayTime = id(hasun).state == "above_horizon";
it.strftime(pad, 0, id(font_xlarge_bold), TextAlign::TOP_LEFT, "%H:%M", time);
// date + nameday
std::string dateFormat = generateDateFormat(time, id(nevnap).state);
it.strftime(xRes - pad - 55, pad, id(font_medium_bold), TextAlign::TOP_RIGHT, dateFormat.c_str(), time);
// moon phase
auto moonIcon = moonToIcon(id(moon).state);
it.printf(xRes - pad/2, pad, id(font_icons_small), TextAlign::TOP_RIGHT, moonIcon.c_str());
// === LEFT - Spotify ===
/*
y = 150;
auto playing = id(spotify_playing_status).state == "playing";
auto paused = id(spotify_playing_status).state == "paused";
auto spotifyIcon = playbackStatusToIcon(playing, paused);
it.printf(pad, y, id(font_icons_small), TextAlign::BASELINE_LEFT, spotifyIcon.c_str());
if (playing || paused) {
it.printf(77, y, id(font_big), TextAlign::BASELINE_LEFT, "%.25s", id(spotify_playing_title).state.c_str());
it.printf(77, y + 46, id(font_medium), TextAlign::BASELINE_LEFT, "%.40s", id(spotify_playing_artist).state.c_str());
} else {
it.printf(77, y - 5, id(font_big), TextAlign::BASELINE_LEFT, "-");
}
*/
// === RIGHT - Weather ===
y = 135;
// current temperature
if (!isnan(id(temperature).state)) {
it.printf(xRes - 210, y, id(font_xlarge_bold), TextAlign::CENTER_RIGHT, "%.0f", id(temperature).state);
it.printf(xRes - 210, y - celsiusSuperscript, id(font_large), TextAlign::CENTER_LEFT, "°C");
if (id(temp_rising).state) {
it.printf(xRes - 210, y + 3, id(font_icons_tiny), TextAlign::TOP_LEFT, ICON_up);
}
else if (id(temp_falling).state) {
it.printf(xRes - 210, y + 3, id(font_icons_tiny), TextAlign::TOP_LEFT, ICON_down);
}
}
// current condition icon
auto conditionIcon = conditionToIcon(id(condition).state, dayTime);
it.printf(xRes - pad, y, id(font_icons), TextAlign::CENTER_RIGHT, conditionIcon.c_str());
y = 200;
it.printf(xCenter + weatherCol, y, id(font_icons_tiny), TextAlign::BASELINE_RIGHT, ICON_sunrise);
it.printf(xCenter + weatherCol, y, id(font_small), TextAlign::BASELINE_LEFT, "%s", id(sunrise).state.c_str());
it.printf(xCenter + weatherCol*2, y, id(font_icons_tiny), TextAlign::BASELINE_RIGHT, ICON_sunset);
it.printf(xCenter + weatherCol*2, y, id(font_small), TextAlign::BASELINE_LEFT, "%s", id(sunset).state.c_str());
// === LEFT - room info ===
// Living room / Nappali
y = 215;
it.printf(pad, y, id(font_icons_small), TextAlign::BASELINE_LEFT, ICON_sofa);
if (!isnan(id(temp_nappali).state)) {
it.printf(temperatureCol, y, id(font_large), TextAlign::BASELINE_RIGHT, "%.1f", id(temp_nappali).state);
it.printf(temperatureCol, y - celsiusSuperscript, id(font_medium), TextAlign::BASELINE_LEFT, "°C");
}
if (!isnan(id(humidity_nappali).state)) {
it.printf(humidityCol, y, id(font_medium), TextAlign::BASELINE_RIGHT, "%.0f", id(humidity_nappali).state);
it.printf(humidityCol, y, id(font_small), TextAlign::BASELINE_LEFT, "%%");
}
// Bedroom / Háló
y += rowHeight; // 290
it.printf(pad, y, id(font_icons_small), TextAlign::BASELINE_LEFT, ICON_bed);
if (!isnan(id(temp_halo).state)) {
it.printf(temperatureCol, y, id(font_large), TextAlign::BASELINE_RIGHT, "%.1f", id(temp_halo).state);
it.printf(temperatureCol, y - celsiusSuperscript, id(font_medium), TextAlign::BASELINE_LEFT, "°C");
}
if (!isnan(id(humidity_halo).state)) {
it.printf(humidityCol, y, id(font_medium), TextAlign::BASELINE_RIGHT, "%.0f", id(humidity_halo).state);
it.printf(humidityCol, y, id(font_small), TextAlign::BASELINE_LEFT, "%%");
}
// Kid 3 / Dani
y += rowHeight; // 350
it.printf(pad, y, id(font_icons_small), TextAlign::BASELINE_LEFT, ICON_baby);
if (!isnan(id(temp_dani).state)) {
it.printf(temperatureCol, y, id(font_large), TextAlign::BASELINE_RIGHT, "%.1f", id(temp_dani).state);
it.printf(temperatureCol, y - celsiusSuperscript, id(font_medium), TextAlign::BASELINE_LEFT, "°C");
}
if (!isnan(id(humidity_dani).state)) {
it.printf(humidityCol, y, id(font_medium), TextAlign::BASELINE_RIGHT, "%.0f", id(humidity_dani).state);
it.printf(humidityCol, y, id(font_small), TextAlign::BASELINE_LEFT, "%%");
}
// Kid 1 / Máté
y += rowHeight; // 425
it.printf(pad, y, id(font_icons_small), TextAlign::BASELINE_LEFT, ICON_human_male);
if (!isnan(id(temp_mate).state)) {
it.printf(temperatureCol, y, id(font_large), TextAlign::BASELINE_RIGHT, "%.1f", id(temp_mate).state);
it.printf(temperatureCol, y - celsiusSuperscript, id(font_medium), TextAlign::BASELINE_LEFT, "°C");
}
if (!isnan(id(humidity_mate).state)) {
it.printf(humidityCol, y, id(font_medium), TextAlign::BASELINE_RIGHT, "%.0f", id(humidity_mate).state);
it.printf(humidityCol, y, id(font_small), TextAlign::BASELINE_LEFT, "%%");
}
// Kid 2 / Luca
y += rowHeight; // 500
it.printf(pad, y, id(font_icons_small), TextAlign::BASELINE_LEFT, ICON_human_female);
if (!isnan(id(temp_luca).state)) {
it.printf(temperatureCol, y, id(font_large), TextAlign::BASELINE_RIGHT, "%.1f", id(temp_luca).state);
it.printf(temperatureCol, y - celsiusSuperscript, id(font_medium), TextAlign::BASELINE_LEFT, "°C");
}
if (!isnan(id(humidity_luca).state)) {
it.printf(humidityCol, y, id(font_medium), TextAlign::BASELINE_RIGHT, "%.0f", id(humidity_luca).state);
it.printf(humidityCol, y, id(font_small), TextAlign::BASELINE_LEFT, "%%");
}
// === MIDDLE - Locations ===
it.line(humidityCol + 40, 220, humidityCol + 40, yRes);
auto centerCol = (humidityCol + 40 + xCenter - 10) / 2;
y = 290;
it.printf(centerCol, y + rowHeight/4, id(font_icons_small), TextAlign::BASELINE_CENTER, ICON_man);
y += rowHeight; // 350
auto gaborLocationText = locationToHungarian(id(gabor_location).state, id(gabor_distance).state);
it.printf(centerCol, y - rowHeight/4, id(font_medium), TextAlign::BASELINE_CENTER, "%s", gaborLocationText.c_str());
y += rowHeight; // 425
it.printf(centerCol, y + rowHeight/4, id(font_icons_small), TextAlign::BASELINE_CENTER, ICON_woman);
y += rowHeight; // 500
auto verusLocationText = locationToHungarian(id(verus_location).state, id(verus_distance).state);
it.printf(centerCol, y - rowHeight/4, id(font_medium), TextAlign::BASELINE_CENTER, "%s", verusLocationText.c_str());
it.line(xCenter - 10, 220, xCenter - 10, yRes);
// === RIGHT - Forecast ===
// Day of week
y = 240;
it.printf(xCenter + weatherCol, y, id(font_medium), TextAlign::BASELINE_CENTER, "%s", id(day1_dow).state.c_str());
it.printf(xCenter + weatherCol*2, y, id(font_medium), TextAlign::BASELINE_CENTER, "%s", id(day2_dow).state.c_str());
it.printf(xCenter + weatherCol*3, y, id(font_medium), TextAlign::BASELINE_CENTER, "%s", id(day3_dow).state.c_str());
// Condition
y += 65; // 295
auto day1Icon = conditionToIcon(id(day1_condition).state, dayTime);
auto day2Icon = conditionToIcon(id(day2_condition).state, dayTime);
auto day3Icon = conditionToIcon(id(day3_condition).state, dayTime);
it.printf(xCenter + weatherCol, y, id(font_icons_small), TextAlign::BASELINE_CENTER, day1Icon.c_str());
it.printf(xCenter + weatherCol*2, y, id(font_icons_small), TextAlign::BASELINE_CENTER, day2Icon.c_str());
it.printf(xCenter + weatherCol*3, y, id(font_icons_small), TextAlign::BASELINE_CENTER, day3Icon.c_str());
// High/low temperature
y += 60; // 350
it.printf(xCenter, y, id(font_icons_small), TextAlign::BASELINE_LEFT, ICON_temp_high);
if (!isnan(id(day1_max).state)) {
it.printf(xCenter + weatherCol + weatherTempCorr, y, id(font_large), TextAlign::BASELINE_RIGHT, "%.0f", id(day1_max).state);
it.printf(xCenter + weatherCol + weatherTempCorr, y - celsiusSuperscript, id(font_medium), TextAlign::BASELINE_LEFT, "°C");
}
if (!isnan(id(day2_max).state)) {
it.printf(xCenter + weatherCol*2 + weatherTempCorr, y, id(font_large), TextAlign::BASELINE_RIGHT, "%.0f", id(day2_max).state);
it.printf(xCenter + weatherCol*2 + weatherTempCorr, y - celsiusSuperscript, id(font_medium), TextAlign::BASELINE_LEFT, "°C");
}
if (!isnan(id(day3_max).state)) {
it.printf(xCenter + weatherCol*3 + weatherTempCorr, y, id(font_large), TextAlign::BASELINE_RIGHT, "%.0f", id(day3_max).state);
it.printf(xCenter + weatherCol*3 + weatherTempCorr, y - celsiusSuperscript, id(font_medium), TextAlign::BASELINE_LEFT, "°C");
}
y += rowHeight; // 425
it.printf(xCenter, y, id(font_icons_small), TextAlign::BASELINE_LEFT, ICON_temp_low);
if (!isnan(id(day1_min).state)) {
it.printf(xCenter + weatherCol + weatherTempCorr, y, id(font_large), TextAlign::BASELINE_RIGHT, "%.0f", id(day1_min).state);
it.printf(xCenter + weatherCol + weatherTempCorr, y - celsiusSuperscript, id(font_medium), TextAlign::BASELINE_LEFT, "°C");
}
if (!isnan(id(day2_min).state)) {
it.printf(xCenter + weatherCol*2 + weatherTempCorr, y, id(font_large), TextAlign::BASELINE_RIGHT, "%.0f", id(day2_min).state);
it.printf(xCenter + weatherCol*2 + weatherTempCorr, y - celsiusSuperscript, id(font_medium), TextAlign::BASELINE_LEFT, "°C");
}
if (!isnan(id(day3_min).state)) {
it.printf(xCenter + weatherCol*3 + weatherTempCorr, y, id(font_large), TextAlign::BASELINE_RIGHT, "%.0f", id(day3_min).state);
it.printf(xCenter + weatherCol*3 + weatherTempCorr, y - celsiusSuperscript, id(font_medium), TextAlign::BASELINE_LEFT, "°C");
}
// Precipitation
y += rowHeight; // 425
it.printf(xCenter, y, id(font_icons_small), TextAlign::BASELINE_LEFT, ICON_umbrella);
// 20mm precipitation is using the max bar height, which is 25px
if (!isnan(id(day1_prec).state)) {
auto prec1size = max(min(id(day1_prec).state * 25.0 / 20.0, 25.0), 1.0);
it.filled_rectangle(xCenter + weatherCol - 45, y - prec1size, weatherCol - pad*2, prec1size);
if (id(day1_prec).state > 1) {
it.printf(xCenter + weatherCol + 3, y-prec1size-pad/2, id(font_medium), TextAlign::BASELINE_RIGHT, "%.0f", id(day1_prec).state);
it.printf(xCenter + weatherCol + 3, y-prec1size-pad/2, id(font_small), TextAlign::BASELINE_LEFT, "mm");
} else if (id(day1_prec).state > 0) {
it.printf(xCenter + weatherCol + 3, y-prec1size-pad/2, id(font_medium), TextAlign::BASELINE_CENTER, ". . .");
}
}
if (!isnan(id(day2_prec).state)) {
auto prec2size = max(min(id(day2_prec).state * 25.0 / 20.0, 25.0), 1.0);
it.filled_rectangle(xCenter + weatherCol*2 - 45, y - prec2size, weatherCol - pad*2, prec2size);
if (id(day2_prec).state > 1) {
it.printf(xCenter + weatherCol*2 + 3, y-prec2size-pad/2, id(font_medium), TextAlign::BASELINE_RIGHT, "%.0f", id(day2_prec).state);
it.printf(xCenter + weatherCol*2 + 3, y-prec2size-pad/2, id(font_small), TextAlign::BASELINE_LEFT, "mm");
} else if (id(day2_prec).state > 0) {
it.printf(xCenter + weatherCol*2 + 3, y-prec2size-pad/2, id(font_medium), TextAlign::BASELINE_CENTER, ". . .");
}
}
if (!isnan(id(day3_prec).state)) {
auto prec3size = max(min(id(day3_prec).state * 25.0 / 20.0, 25.0), 1.0);
it.filled_rectangle(xCenter + weatherCol*3 - 45, y - prec3size, weatherCol - pad*2, prec3size);
if (id(day3_prec).state > 1) {
it.printf(xCenter + weatherCol*3 + 3, y-prec3size-pad/2, id(font_medium), TextAlign::BASELINE_RIGHT, "%.0f", id(day3_prec).state);
it.printf(xCenter + weatherCol*3 + 3, y-prec3size-pad/2, id(font_small), TextAlign::BASELINE_LEFT, "mm");
} else if (id(day3_prec).state > 0) {
it.printf(xCenter + weatherCol*3 + 3, y-prec3size-pad/2, id(font_medium), TextAlign::BASELINE_CENTER, ". . .");
}
}
// === Footer/debug ===
//it.printf(xRes - pad, yRes - pad/2, id(font_small), TextAlign::BASELINE_RIGHT, "%.2fV/%.0f%%", id(batt_volt).voltage->state, id(batt).state);
//it.printf(pad, yRes - pad/2, id(font_small), TextAlign::BASELINE_LEFT, "%s", icon);