-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtide_weather_clock.yaml
More file actions
636 lines (601 loc) · 22 KB
/
Copy pathtide_weather_clock.yaml
File metadata and controls
636 lines (601 loc) · 22 KB
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
---
# Substitution variables used through the codebase
substitutions:
icon_font: mdi_icons_40
text_font: nunito_20
text_color: black
bg_color: white
button_on_color: "ep_orange"
button_off_color: "very_dark_gray"
icon_on_color: "yellow"
icon_off_color: "gray"
label_on_color: "white"
label_off_color: "gray"
button_text_color: "white"
# LCD back light modes - Code in backlight_time.yaml
display_daytime_brightness: "100%"
display_nighttime_brightness: "50%"
display_night_hour: "0" # Hour for night mode (0-23)
display_night_minute: "0" # Minute for night mode (0-59)
display_backlight_timeout_always_enabled: "false" # Set true to dim/off in all modes, not just Night
display_backlight_timeout_initial: "5" # Initial backlight timeout in minutes (-1 to disable)
esphome:
name: "tide-weather-display"
friendly_name: "Tide Clock with weather"
on_boot:
- priority: 400
then:
- script.execute: update_loading_page
logger:
level: debug
logs:
lvgl: info
hardware_uart: UART0
# Some screens need little_endian byte order and some need big_endian
# this sets the byte order for all the images loaded in this file and the packages as well
image:
defaults:
byte_order: little_endian
# Time update script - This is run once per second. Use it to update any time related labels.
script:
# --------------------------------------------------------------------------
# This script is called once per minute.
# Any packages in this library will !extend time_update to update their own labels.
# You can add code here to update your own custom labels.
# --------------------------------------------------------------------------
- id: time_update
then:
- lambda: |-
// No operation
packages:
# Generic configuration for ESP32 screens
# SDL has no Wi-Fi
wifi: !include esphome-modular-lvgl-buttons/common/wifi.yaml
# Enable OTA updates with a status screen
ota_screen: !include esphome-modular-lvgl-buttons/common/ota.yaml
# All the colors
theme: !include esphome-modular-lvgl-buttons/common/theme/index.yaml
# Some nice basic fonts
# 1000s of glyphs
# Some basic sensors
sensors: !include esphome-modular-lvgl-buttons/common/sensors_base.yaml
# Styles + Themes
# Use this theme for debugging
# theme: !include esphome-modular-lvgl-buttons/common/theme/index_debug.yaml # uncomment to enable debug outlines
# Include if your touch screen has a backlight. Also sets the time from HA
backlight: !include esphome-modular-lvgl-buttons/common/backlight_time.yaml
# Hardware description file
hardware: !include
file: esphome-modular-lvgl-buttons/hardware/waveshare-esp32-p4-wifi6-touch-lcd-7b.yaml
vars:
rotation: "180" # set screen rotation 0, 90, 180, 270
# Basic boot screen with ESPHome logo and device diagnostic info
loading_screen: !include esphome-modular-lvgl-buttons/pages/loading.yaml
# info screen - WiFi login, IP address, MAC address etc
info_screen: !include esphome-modular-lvgl-buttons/pages/info.yaml
# Flip clock in upper right (row 0, columns 6-8)
flip_clock: !include
file: esphome-modular-lvgl-buttons/ui/clock/flip_clock.yaml
vars:
uid: flip_clock
page_id: main_page
row: 0
column: 6
row_span: 1
column_span: 3
height: 100%
font_size: 90
# Tide forecast package
tide_info: !include
file: esphome-modular-lvgl-buttons/ui/tides/NOAA_tide_update.yaml
vars:
noaa_station_id: "8454578" # Your station ID
noaa_unit_system: "english" # or "metric"
# Weather packages
# Display weather forecast using direct HA action (no template sensor needed!)
# Icons are included automatically in the action file
weather_forecast_80: !include
file: esphome-modular-lvgl-buttons/ui/weather/forecast.yaml
vars:
size: 100
weather_entity: weather.home
# Get todays weather and display it (icons included automatically)
weather_today_180: !include
file: esphome-modular-lvgl-buttons/ui/weather/today.yaml
vars:
size: 220
weather_entity: weather.home
weather_summary: sensor.home_hourly_summary
# Styles for Weather forecast
.forecast_styles:
- &forecast_obj_base
height: 100%
width: 100%
bg_color: gray200
bg_opa: cover
radius: 10
pad_top: 4
pad_bottom: 4
layout:
type: flex
flex_flow: COLUMN
flex_align_main: SPACE_EVENLY
flex_align_cross: center
flex_align_track: center
pad_column: 0
pad_row: 2
- &forecast_label_base
text_font: nunito_28
height: SIZE_CONTENT
- &forecast_label_base_lo
height: SIZE_CONTENT
text_font: nunito_24
text_color: dodgerblue
- &forecast_image_wrapper
height: 100
width: 100
bg_opa: TRANSP
scrollbar_mode: "OFF"
font:
- file: "esphome-modular-lvgl-buttons/assets/fonts/Nunito-SemiBold.ttf"
id: nunito_80
size: 80
bpp: 8
- file: "esphome-modular-lvgl-buttons/assets/fonts/Nunito-SemiBold.ttf"
id: nunito_28
size: 28
bpp: 8
- file: "gfonts://Roboto@700"
id: roboto36_bold
size: 36
bpp: 8
- file: 'https://github.com/Templarian/MaterialDesign-Webfont/raw/v7.4.47/fonts/materialdesignicons-webfont.ttf'
id: mdi_icons_60
size: 60
bpp: 8
glyphs: [
$mdi_weather_windy,
]
- file: 'https://github.com/Templarian/MaterialDesign-Webfont/raw/v7.4.47/fonts/materialdesignicons-webfont.ttf'
id: mdi_icons_40
size: 40
bpp: 8
glyphs: [
$mdi_weather_windy,
]
# -------------------------------------------------------------------------
# LVGL pages and buttons
# -------------------------------------------------------------------------
# This is the main LVGL section. We start with a simple 4x4 grid.
lvgl:
pages:
- id: main_page
bg_color: ${bg_color}
# layout: <rows>x<cols>
layout: 5x9
# <<: !include esphome-modular-lvgl-buttons/common/swipe_navigation.yaml
widgets:
- container:
grid_cell_x_align: stretch
grid_cell_y_align: stretch
grid_cell_row_pos: 0
grid_cell_column_pos: 0
grid_cell_row_span: 1
grid_cell_column_span: 2
widgets:
- label:
id: weather_temperature_today
text_font: nunito_80
align: left_mid
text: "100°"
- container:
grid_cell_x_align: stretch
grid_cell_y_align: stretch
grid_cell_row_pos: 0
grid_cell_column_pos: 2
grid_cell_row_span: 2
grid_cell_column_span: 2
widgets:
- image:
src: unknown_220
id: weather_condition_icon
align: center
- container:
grid_cell_x_align: stretch
grid_cell_y_align: stretch
grid_cell_row_pos: 1
grid_cell_column_pos: 0
grid_cell_row_span: 1
grid_cell_column_span: 2
layout:
type: grid
grid_columns: [CONTENT, FR(1)]
grid_rows: [CONTENT, CONTENT, CONTENT]
pad_row: 2
pad_column: 4
widgets:
- label:
text_font: nunito_28
text: "Humidity"
grid_cell_row_pos: 0
grid_cell_column_pos: 0
grid_cell_x_align: START
- label:
id: weather_humidity_today
text_font: nunito_28
text: "---%"
grid_cell_row_pos: 0
grid_cell_column_pos: 1
grid_cell_x_align: END
- label:
text_font: nunito_28
text: "BP"
grid_cell_row_pos: 1
grid_cell_column_pos: 0
grid_cell_x_align: START
- label:
id: weather_pressure_today
text_font: nunito_28
text: "-- hPa"
grid_cell_row_pos: 1
grid_cell_column_pos: 1
grid_cell_x_align: END
- label:
text_font: nunito_28
text: "Visibility"
grid_cell_row_pos: 2
grid_cell_column_pos: 0
grid_cell_x_align: START
- label:
id: weather_visibility_today
text_font: nunito_28
text: "-- mi"
grid_cell_row_pos: 2
grid_cell_column_pos: 1
grid_cell_x_align: END
- container:
grid_cell_x_align: stretch
grid_cell_y_align: stretch
grid_cell_row_pos: 0
grid_cell_column_pos: 4
grid_cell_row_span: 1
grid_cell_column_span: 2
height: 100%
pad_all: 0
layout:
type: flex
flex_flow: ROW
flex_align_main: CENTER
flex_align_cross: CENTER
flex_align_track: CENTER
pad_column: 12
widgets:
- label:
text_font: mdi_icons_60
text: $mdi_weather_windy
- obj:
bg_opa: TRANSP
width: SIZE_CONTENT
height: SIZE_CONTENT
pad_all: 0
layout:
type: flex
flex_flow: COLUMN
flex_align_main: CENTER
flex_align_cross: CENTER
pad_row: 0
widgets:
- label:
id: weather_wind_dir_today
text_font: nunito_28
text_align: CENTER
text: "---"
- label:
id: weather_wind_speed_today
text_font: nunito_28
text_align: CENTER
text: "--mph"
- container:
grid_cell_x_align: stretch
grid_cell_y_align: stretch
grid_cell_row_pos: 2
grid_cell_column_pos: 0
grid_cell_row_span: 1
grid_cell_column_span: 4
widgets:
- label:
id: weather_summary_today
text_font: $text_font
align: center
long_mode: WRAP
width: 100%
text: "forcast"
- container:
id: bottom_label_1
grid_cell_x_align: stretch
grid_cell_y_align: stretch
grid_cell_row_pos: 3
grid_cell_column_pos: 0
grid_cell_row_span: 2
grid_cell_column_span: 1
widgets:
- obj:
<<: *forecast_obj_base
widgets:
- label:
id: forecast_day_0
<<: *forecast_label_base
text: ???
- obj:
<<: *forecast_image_wrapper
widgets:
- image:
id: forecast_condition_icon_0
src: unknown_100
align: center
- label:
id: forecast_temperature_hi_0
<<: *forecast_label_base
text: "---°"
- label:
id: forecast_temperature_lo_0
<<: *forecast_label_base_lo
text: "---°"
- container:
id: bottom_label_2
grid_cell_x_align: stretch
grid_cell_y_align: stretch
grid_cell_row_pos: 3
grid_cell_column_pos: 1
grid_cell_row_span: 2
grid_cell_column_span: 1
widgets:
- obj:
<<: *forecast_obj_base
widgets:
- label:
id: forecast_day_1
<<: *forecast_label_base
text: ???
- obj:
<<: *forecast_image_wrapper
widgets:
- image:
id: forecast_condition_icon_1
src: unknown_100
align: center
- label:
id: forecast_temperature_hi_1
<<: *forecast_label_base
text: "---°"
- label:
id: forecast_temperature_lo_1
<<: *forecast_label_base_lo
text: "---°"
- container:
id: bottom_label_3
grid_cell_x_align: stretch
grid_cell_y_align: stretch
grid_cell_row_pos: 3
grid_cell_column_pos: 2
grid_cell_row_span: 2
grid_cell_column_span: 1
widgets:
- obj:
<<: *forecast_obj_base
widgets:
- label:
id: forecast_day_2
<<: *forecast_label_base
text: ???
- obj:
<<: *forecast_image_wrapper
widgets:
- image:
id: forecast_condition_icon_2
src: unknown_100
align: center
- label:
id: forecast_temperature_hi_2
<<: *forecast_label_base
text: "---°"
- label:
id: forecast_temperature_lo_2
<<: *forecast_label_base_lo
text: "---°"
- container:
id: bottom_label_4
grid_cell_x_align: stretch
grid_cell_y_align: stretch
grid_cell_row_pos: 3
grid_cell_column_pos: 3
grid_cell_row_span: 2
grid_cell_column_span: 1
widgets:
- obj:
<<: *forecast_obj_base
widgets:
- label:
id: forecast_day_3
<<: *forecast_label_base
text: ???
- obj:
<<: *forecast_image_wrapper
widgets:
- image:
id: forecast_condition_icon_3
src: unknown_100
align: center
- label:
id: forecast_temperature_hi_3
<<: *forecast_label_base
text: "---°"
- label:
id: forecast_temperature_lo_3
<<: *forecast_label_base_lo
text: "---°"
- container:
grid_cell_x_align: stretch
grid_cell_y_align: stretch
grid_cell_row_pos: 1
grid_cell_column_pos: 4
grid_cell_row_span: 4
grid_cell_column_span: 1
widgets:
- obj:
width: SIZE_CONTENT
height: SIZE_CONTENT
align: TOP_LEFT
pad_all: 2
layout:
type: flex
flex_flow: ROW_WRAP
pad_column: 1
widgets:
- label:
id: high_tide_height
text_font: nunito_36
text: "0.00 ft"
- obj:
width: SIZE_CONTENT
height: SIZE_CONTENT
align: BOTTOM_LEFT
pad_all: 2
layout:
type: flex
flex_flow: ROW_WRAP
pad_column: 1
widgets:
- label:
id: low_tide_height
text_font: nunito_36
text: "-0.00 ft"
- container:
grid_cell_x_align: stretch
grid_cell_y_align: stretch
grid_cell_row_pos: 1
grid_cell_column_pos: 5
grid_cell_row_span: 4
grid_cell_column_span: 4
widgets:
# Square wrapper for the meter so it draws a true circle.
# The grid cell isn't square (cols are slightly narrower
# than rows on most panels), so we constrain the meter to
# an explicit square that fits inside the cell. 440px works
# well on a 1024x600 panel; tweak if your screen differs.
- container:
height: 100%
width: 100%
widgets:
- meter:
align: center
height: 440
width: 440
# radius: circle
text_font: nunito_24
outline_width: 3
outline_color: black
indicator:
opa: TRANSP # get rid of that black dot in the center of the meter
scales:
- range_from: 1
range_to: 100
angle_range: 360
rotation: 270
indicators:
- image:
id: tide_level
src: tide_pointer
pivot_x: 40
pivot_y: 40
value: 0
- range_from: 5
range_to: 1
angle_range: 120
rotation: 300
ticks:
width: 1
count: 5
major:
label_gap: 25
stride: 1
width: 2
length: 20
- range_from: 5
range_to: 1
angle_range: 120
rotation: 120
ticks:
width: 1
count: 5
major:
label_gap: 25
stride: 1
width: 2
length: 20
- obj:
align: TOP_LEFT
width: SIZE_CONTENT
height: SIZE_CONTENT
bg_opa: TRANSP
pad_all: 2
widgets:
- image:
src: high_tide
- obj:
align: TOP_MID
y: 35 # push down so labels clear the meter ring
width: 100%
height: SIZE_CONTENT
bg_opa: TRANSP
pad_all: 0
layout:
type: flex
flex_flow: COLUMN
flex_align_cross: center
pad_row: 0
widgets:
- label:
text_font: nunito_28
text_align: center
width: 100%
text: "High Tide"
- label:
id: high_tide_label
text_font: roboto36_bold
text_align: center
width: 100%
text: "00:00 am"
- obj:
align: BOTTOM_LEFT
width: SIZE_CONTENT
height: SIZE_CONTENT
bg_opa: TRANSP
pad_all: 2
widgets:
- image:
src: low_tide
- obj:
align: BOTTOM_MID
y: -35 # push up so labels clear the meter ring
width: 100%
height: SIZE_CONTENT
bg_opa: TRANSP
pad_all: 0
layout:
type: flex
flex_flow: COLUMN
flex_align_cross: center
pad_row: 0
widgets:
- label:
id: low_tide_label
text_font: roboto36_bold
text_align: center
width: 100%
text: "00:00 am"
- label:
text_font: nunito_28
text_align: center
width: 100%
text: "Low Tide"