forked from BigBobbas/ESP32-S3-Box3-Custom-ESPHome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
s3b_import.yaml
1975 lines (1797 loc) · 64.9 KB
/
s3b_import.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
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
## You can change the friendly name if you wish on line 7 below. The friendly name is how the device will show in HA
## However the <name:> is how HA connects to the device eg. esp32-s3-box-3.local is the mDNS hostname for the device.
## Once added to HA changing the device name can lead to connection issues, between HA and the device.
substitutions:
name: esp32-s3box-3
friendly_name: ESP32-S3-Box-3
####################################################################
#### change the micro wake word to be used on the line below #####
#### options are okay_nabu, hey_jarvis, alexa #####
####################################################################
micro_wake_word_model: okay_nabu
####################################################################
#### Days and months ####
## Change the values on the right to match your locale ##
monday: Monday
tuesday: Tuesday
wednesday: Wednesday
thursday: Thursday
friday: Friday
saturday: Saturday
sunday: Sunday
jan: January
feb: February
mar: March
apr: April
may: May
jun: June
jul: July
aug: August
sept: September
oct: October
nov: November
dec: December
esphome:
name: ${name}
friendly_name: ${friendly_name}
min_version: 2024.6.0
platformio_options:
board_build.flash_mode: dio
on_boot:
priority: 600
then:
- light.turn_on:
id: led
brightness: 100%
- display.page.show: loading_page
- component.update: s3_box_lcd
project:
name: "BigBobbas.s3box"
version: "2024.06.01"
esp32:
board: esp32s3box
flash_size: 16MB
framework:
type: esp-idf
sdkconfig_options:
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"
CONFIG_AUDIO_BOARD_CUSTOM: "y"
CONFIG_ESP32_S3_BOX_3_BOARD: "y"
components:
- name: esp32_s3_box_3_board
source: github://jesserockz/esp32-s3-box-3-board@main
refresh: 0s
psram:
mode: octal
speed: 80MHz
external_components:
- source:
type: git
url: https://github.com/gnumpi/esphome_audio
ref: dev-next
components: [ adf_pipeline, i2s_audio ]
refresh: 0s
api:
on_client_connected:
- lambda: |-
id(api_connection) = true;
- component.update: s3_box_lcd
- script.execute: saver_enabled
on_client_disconnected:
- lambda: |-
id(api_connection) = false;
ota:
- platform: esphome
logger:
hardware_uart: USB_SERIAL_JTAG
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: ${name}
password: s3box123
on_connect:
- lambda: |-
id(wifi_connection) = true;
- display.page.show: idle_page
- component.update: s3_box_lcd
on_disconnect:
- lambda: |-
id(wifi_connection) = false;
time:
- platform: homeassistant
id: ha_time
interval:
- interval: 10s
then:
- if:
condition:
- lambda: 'return { (id(api_connection) != true) };'
then:
- if:
condition:
api.connected:
then:
- lambda: "id(api_connection) = true;"
else:
- if:
condition:
not:
api.connected:
then:
- lambda: "id(api_connection) = false;"
- interval: 10s
then:
- if:
condition:
- lambda: 'return { (id(wifi_connection) != true) };'
then:
- if:
condition:
wifi.connected:
then:
- lambda: "id(wifi_connection) = true;"
else:
- if:
condition:
not:
wifi.connected:
then:
- lambda: "id(wifi_connection) = false;"
- interval: 20s
then:
- component.update: s3_box_lcd
select:
- platform: template
entity_category: config
name: Wake word engine location
id: wake_word_engine_location
optimistic: true
restore_value: true
options:
- In Home Assistant
- On device
initial_option: In Home Assistant
on_value:
- if:
condition:
lambda: return x == "In Home Assistant";
then:
- micro_wake_word.stop
- delay: 500ms
- lambda: id(va).set_use_wake_word(true);
- voice_assistant.start_continuous:
- text_sensor.template.publish:
id: wakeword_location
state: !lambda 'return "Home Assistant";'
- component.update: s3_box_lcd
- if:
condition:
lambda: return x == "On device";
then:
- text_sensor.template.publish:
id: wakeword_location
state: !lambda 'return "On Device";'
- lambda: id(va).set_use_wake_word(false);
- voice_assistant.stop
- delay: 500ms
- micro_wake_word.start
- component.update: s3_box_lcd
script:
- id: set_volume
then:
- media_player.volume_set:
volume: !lambda return 0.5 + id(speaker_volume) * 0.05 ;
- id: saver_enabled
then:
- if:
condition:
switch.is_on: s_saver
then:
- light.turn_on:
id: led
brightness: 100%
- delay: 30s
- light.turn_on:
id: led
brightness: 30%
- display.page.show: saver_page
- component.update: s3_box_lcd
- if:
condition:
- switch.is_on: s_saver_mode
then:
- delay: 180s
- light.turn_off: led
mode: restart
- id: saver_enabled_manual
then:
- if:
condition:
switch.is_on: s_saver
then:
- light.turn_on:
id: led
brightness: 30%
- display.page.show: saver_page
- component.update: s3_box_lcd
- if:
condition:
- switch.is_on: s_saver_mode
then:
- delay: 180s
- light.turn_off: led
mode: restart
globals:
- id: wifi_connection
type: bool
restore_value: no
initial_value: "false"
- id: api_connection
type: bool
restore_value: no
initial_value: "false"
- id: mute_value
type: bool
restore_value: no
initial_value: "false"
- id: speaker_volume
type: int
restore_value: no
initial_value: '5'
button:
- platform: restart
id: reboot
name: "Reboot"
switch:
- platform: template
name: Mute
id: mute_switch
optimistic: True
on_turn_on:
- voice_assistant.stop:
- micro_wake_word.stop:
- delay: 50ms
- lambda: id(va).set_use_wake_word(false);
- media_player.volume_set: 0%
on_turn_off:
- media_player.volume_set: 100%
- if:
condition:
lambda: return id(wake_word_engine_location).state == "In Home Assistant";
then:
- lambda: id(va).set_use_wake_word(true);
- delay: 50ms
- voice_assistant.start_continuous:
else:
- delay: 50ms
- micro_wake_word.start
restore_mode: RESTORE_DEFAULT_OFF
- platform: template
name: Screensaver
id: s_saver
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
# on_turn_on:
# - script.execute: saver_enabled
# on_turn_off:
# - script.execute: saver_enabled
- platform: template
name: Screensaver_mode
id: s_saver_mode
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
# on_turn_on:
# - script.execute: saver_enabled
# on_turn_off:
# - script.execute: saver_enabled
- platform: template
name: Screensaver_mode
id: s_saver_presc
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
# on_turn_on:
# - script.execute: saver_enabled
# on_turn_off:
# - script.execute: saver_enabled
output:
- platform: ledc
pin: GPIO47
id: backlight_output
light:
- platform: monochromatic
id: led
name: LCD Backlight
entity_category: config
output: backlight_output
restore_mode: RESTORE_DEFAULT_ON
default_transition_length: 500ms
sensor:
- platform: aht10
i2c_id: bus_b
variant: AHT20
temperature:
name: "Temperature"
id: s3temp
humidity:
name: "Humidity"
update_interval: 60s
- platform: adc
pin: GPIO10
name: "Battery voltage"
id: battery_voltage
unit_of_measurement: "V"
accuracy_decimals: 1
device_class: "voltage"
entity_category: "diagnostic"
disabled_by_default: true
update_interval: 30s
attenuation: auto
filters:
- multiply: 4.11
- platform: copy
id: battery_percent
source_id: battery_voltage
name: "Battery level"
unit_of_measurement: "%"
accuracy_decimals: 0
device_class: "battery"
entity_category: "diagnostic"
filters:
- lambda: return (x - 2.7) / (4.2 - 2.7) * 100;
- clamp:
min_value: 0
max_value: 100
text_sensor:
- platform: wifi_info
ip_address:
name: ESP IP Address
address_0:
name: ESP IP Address 0
id: ip_addr
- platform: template
id: wakeword_location
i2s_audio:
- id: i2s_shared
i2s_lrclk_pin: GPIO45
i2s_bclk_pin: GPIO17
i2s_mclk_pin: GPIO2
access_mode: duplex
adf_pipeline:
- platform: i2s_audio
type: audio_out
id: adf_i2s_out
i2s_audio_id: i2s_shared
i2s_dout_pin: GPIO15
adf_alc: false
dac:
i2c_id: bus_a
model: es8311
address: 0x18
enable_pin: GPIO46
sample_rate: 16000
bits_per_sample: 16bit
fixed_settings: true
- platform: i2s_audio
type: audio_in
id: adf_i2s_in
i2s_audio_id: i2s_shared
i2s_din_pin: GPIO16
pdm: false
adc:
i2c_id: bus_a
model: es7210
address: 0x40
sample_rate: 16000
bits_per_sample: 16bit
fixed_settings: true
media_player:
- platform: adf_pipeline
id: adf_media_player
name: s3-box_media_player
internal: false
keep_pipeline_alive: true
announcement_audio:
sample_rate: 24000
bits_per_sample: 16
num_channels: 1
pipeline:
- self
- resampler
- adf_i2s_out
on_play:
- display.page.show: media_page
- component.update: s3_box_lcd
microphone:
- platform: adf_pipeline
id: box_mic
keep_pipeline_alive: true
pipeline:
- adf_i2s_in
- resampler
- self
micro_wake_word:
model: ${micro_wake_word_model}
on_wake_word_detected:
- voice_assistant.start:
wake_word: !lambda return wake_word;
voice_assistant:
id: va
microphone: box_mic
media_player: adf_media_player
use_wake_word: true
noise_suppression_level: 2
auto_gain: 31dBFS
volume_multiplier: 4.0
on_listening:
- script.execute: saver_enabled
- display.page.show: listening_page
- component.update: s3_box_lcd
on_stt_vad_end:
- display.page.show: thinking_page
- component.update: s3_box_lcd
on_tts_end:
- display.page.show: replying_page
- component.update: s3_box_lcd
on_end:
- if:
condition:
lambda: return id(wake_word_engine_location).state == "On device";
then:
- wait_until:
not:
voice_assistant.is_running:
- display.page.show: idle_page
- component.update: s3_box_lcd
- micro_wake_word.start
else:
- wait_until:
not:
voice_assistant.is_running:
- lambda: id(va).set_use_wake_word(false);
- voice_assistant.stop:
- delay: 100ms
- lambda: id(va).set_use_wake_word(true);
- delay: 100ms
- voice_assistant.start_continuous:
on_client_connected:
- if:
condition:
lambda: return id(wake_word_engine_location).state == "On device";
then:
- micro_wake_word.start
else:
- lambda: id(va).set_use_wake_word(true);
- voice_assistant.start_continuous:
image:
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/error.png"
id: error_img
resize: 320x240
type: RGB24
use_transparency: true
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/idle.png"
id: idle_img
resize: 320x240
type: RGB24
use_transparency: true
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/listening.png"
id: listening_img
resize: 320x240
type: RGB24
use_transparency: true
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/thinking.png"
id: thinking_img
resize: 320x240
type: RGB24
use_transparency: true
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/replying.png"
id: replying_img
resize: 320x240
type: RGB24
use_transparency: true
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/images/loading.png"
id: loading_img
resize: 320x240
type: RGB24
use_transparency: true
font:
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/consola.ttf"
id: my_font
size: 14
glyphs:
'&@!"''%()+=,-_.:°/$€£¥?0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzÀàÁáÂâÃãÄäĀāĂăÅåǺǻẠạĄąÆæǼǽĆćĈĉČčĊċÇçĎďĐđÐðÈèÉéÊêẼẽĚěËëĒēĔĕĖėẸẹĘęĜĝǦǧĞğĠġĢģĤĥĦħıÌìÍíÎîĨĩÏïĪīĬĭİỊịĮįȷĴĵĶķĸĹ弾ĻļŁłĿŀŃńÑñŇňŅņƝɲŊŋʼnÒòÓóÔôÕõÖöŌōŎŏŐőỌọǪǫØøǾǿŒœŔŕŘřŖŗŚśŜŝŠšŞşȘșẞߍťŢţȚțŦŧÞþÙùÚúÛûŨũÜüŪūŬŭŮůŰűỤụŲųẀẁẂẃŴŵẄẅỲỳÝýŶŷỸỹŸÿȲȳŹźŽžŻżIJijƏə'
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/consola.ttf"
id: my_font2
size: 72
glyphs:
'&@!"''%()+=,-_.:°/$€£¥?0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzÀàÁáÂâÃãÄäĀāĂăÅåǺǻẠạĄąÆæǼǽĆćĈĉČčĊċÇçĎďĐđÐðÈèÉéÊêẼẽĚěËëĒēĔĕĖėẸẹĘęĜĝǦǧĞğĠġĢģĤĥĦħıÌìÍíÎîĨĩÏïĪīĬĭİỊịĮįȷĴĵĶķĸĹ弾ĻļŁłĿŀŃńÑñŇňŅņƝɲŊŋʼnÒòÓóÔôÕõÖöŌōŎŏŐőỌọǪǫØøǾǿŒœŔŕŘřŖŗŚśŜŝŠšŞşȘșẞߍťŢţȚțŦŧÞþÙùÚúÛûŨũÜüŪūŬŭŮůŰűỤụŲųẀẁẂẃŴŵẄẅỲỳÝýŶŷỸỹŸÿȲȳŹźŽžŻżIJijƏə'
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/consola.ttf"
id: my_font3
size: 28
glyphs:
'&@!"''%()+=,-_.:°/$€£¥?0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzÀàÁáÂâÃãÄäĀāĂăÅåǺǻẠạĄąÆæǼǽĆćĈĉČčĊċÇçĎďĐđÐðÈèÉéÊêẼẽĚěËëĒēĔĕĖėẸẹĘęĜĝǦǧĞğĠġĢģĤĥĦħıÌìÍíÎîĨĩÏïĪīĬĭİỊịĮįȷĴĵĶķĸĹ弾ĻļŁłĿŀŃńÑñŇňŅņƝɲŊŋʼnÒòÓóÔôÕõÖöŌōŎŏŐőỌọǪǫØøǾǿŒœŔŕŘřŖŗŚśŜŝŠšŞşȘșẞߍťŢţȚțŦŧÞþÙùÚúÛûŨũÜüŪūŬŭŮůŰűỤụŲųẀẁẂẃŴŵẄẅỲỳÝýŶŷỸỹŸÿȲȳŹźŽžŻżIJijƏə'
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/consola.ttf"
id: my_font4
size: 40
glyphs:
'&@!"''%()+=,-_.:°/$€£¥?0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzÀàÁáÂâÃãÄäĀāĂăÅåǺǻẠạĄąÆæǼǽĆćĈĉČčĊċÇçĎďĐđÐðÈèÉéÊêẼẽĚěËëĒēĔĕĖėẸẹĘęĜĝǦǧĞğĠġĢģĤĥĦħıÌìÍíÎîĨĩÏïĪīĬĭİỊịĮįȷĴĵĶķĸĹ弾ĻļŁłĿŀŃńÑñŇňŅņƝɲŊŋʼnÒòÓóÔôÕõÖöŌōŎŏŐőỌọǪǫØøǾǿŒœŔŕŘřŖŗŚśŜŝŠšŞşȘșẞߍťŢţȚțŦŧÞþÙùÚúÛûŨũÜüŪūŬŭŮůŰűỤụŲųẀẁẂẃŴŵẄẅỲỳÝýŶŷỸỹŸÿȲȳŹźŽžŻżIJijƏə'
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/consola.ttf"
id: my_font5
size: 22
glyphs:
'&@!"''%()+=,-_.:°/$€£¥?0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzÀàÁáÂâÃãÄäĀāĂăÅåǺǻẠạĄąÆæǼǽĆćĈĉČčĊċÇçĎďĐđÐðÈèÉéÊêẼẽĚěËëĒēĔĕĖėẸẹĘęĜĝǦǧĞğĠġĢģĤĥĦħıÌìÍíÎîĨĩÏïĪīĬĭİỊịĮįȷĴĵĶķĸĹ弾ĻļŁłĿŀŃńÑñŇňŅņƝɲŊŋʼnÒòÓóÔôÕõÖöŌōŎŏŐőỌọǪǫØøǾǿŒœŔŕŘřŖŗŚśŜŝŠšŞşȘșẞߍťŢţȚțŦŧÞþÙùÚúÛûŨũÜüŪūŬŭŮůŰűỤụŲųẀẁẂẃŴŵẄẅỲỳÝýŶŷỸỹŸÿȲȳŹźŽžŻżIJijƏə'
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/materialdesignicons-webfont.ttf"
id: icon_font_55
size: 45
glyphs: [
"\U000F0079",#battery 100%
"\U000F0082",#battery 90%
"\U000F0081",#battery 80%
"\U000F0080",#battery 70%
"\U000F007F",#battery 60%
"\U000F007E",#battery 50%
"\U000F007D",#battery 40%
"\U000F007C",#battery 30%
"\U000F007B",#battery 20%
"\U000F007A",#battery 10%
"\U000F10CD",#battery warning
"\U000F050F",#temp sensor
"\U000F024A",#garden/flower
"\U000F16BD",#wifi connected
"\U000F16BC",#wifidisconnected
"\U000F07D0",#api connected
"\U000F12A8",#touch button
"\U000F0EBA",#stats
"\U000F087B",#api disconnected
"\U000F0B6C",#car
"\U000F057E",#speaker on
"\U000F0581",#speaker off
"\U000F0493",#settings cog
"\U000F1C6F",#info
"\U000F06E8",#light bulb illuminated
"\U000F0335",#light bulb off
"\U000F075A",#music
"\U000F0A19",#toggle off
"\U000F0521",#toggle on
]
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/materialdesignicons-webfont.ttf"
id: icon_font_80
size: 75
glyphs: [
"\U000F1322",#tools
"\U000F12D4",#garage open
"\U000F12D3",#garage closed
"\U000F0238",#heating
"\U000F0B2C",#up
"\U000F0B26",#down
"\U000F024A",#garden
"\U000F1987",#floods
"\U000F04C8",#spots
"\U000F1722",#fire off
"\U000F068A",#alarm unarmed
"\U000F099D",#alarm armed
"\U000F1A12",#home button
"\U000F0D90",#monitor_off
"\U000F0B28",#left
"\U000F192D",#electricity
"\U000F1A1B",#gas
"\U000F0B6C",#car battery
"\U000F0873",#car miles non
"\U000F0875",#car miles low
"\U000F0874",#car miles full
"\U000F0B2A",#right
"\U000F04B9",#living room
"\U000F1061",#dining
"\U000F06E8",#light bulb illuminated
"\U000F0335",#light bulb off
"\U000F07F4",#tv
"\U000F1160",#kitchen
"\U000F0210",#fan
"\U000F050F",#temp
"\U000F01AE",#gbp pound symbol
"\U000F1747",#tall lamp
"\U000F0769",#ceiling
"\U000F075A",#music
"\U000F05CB",#voice
"\U000F0FCE",#scene
"\U000F040A",#play
"\U000F03E4",#pause
"\U000F04DB",#stop
"\U000F04AD",#next track
"\U000F04AE",#previous track
"\U000F075E",#vol minus
"\U000F075D",#vol plus
"\U000F040E",#play/pause
]
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/DSEG14Classic-Regular.ttf"
id: my_fontseg
size: 72
- file: "https://github.com/BigBobbas/ESP32-S3-Box3-Custom-ESPHome/raw/main/fonts/DSEG7Classic-Regular.ttf"
id: my_fontseg2
size: 72
color:
- id: green
hex: '75D15F'
- id: red
hex: 'FF3131'
- id: blue
hex: '47B7E9'
- id: blue_drk
hex: '085296'
- id: amber
hex: 'FBAB35'
- id: lime
hex: '20FC30'
- id: pink
hex: 'D92BBC'
- id: yellow
hex: 'FFC000'
- id: black
hex: '000000'
- id: white
hex: 'ffffff'
- id: purple
hex: '73264D'
- id: light_blue
hex: 'CFE2F3'
spi:
clk_pin: 7
mosi_pin: 6
display:
- platform: ili9xxx
id: s3_box_lcd
model: S3BOX
data_rate: 40MHz
cs_pin: 5
dc_pin: 4
reset_pin:
number: 48
inverted: true
update_interval: never
##################################################################################################
################ The below section defines, what is displayed on the screen, ##############
################ the colours and mdi icons are defined above under font: and Color: ##############
################ they are then referenced in the config below. ##############
##################################################################################################
pages:
- id: idle_page ##### home page ######
lambda: |-
it.fill(id(black));
if(id(api_connection) == true) {
it.printf(15, 5, id(icon_font_55), blue, "\U000F07D0");
} else {
it.printf(15, 5, id(icon_font_55), red, "\U000F087B");
}
if(id(wifi_connection) == true) {
it.printf(80, 5, id(icon_font_55), lime, "\U000F16BD");
} else {
it.printf(80, 5, id(icon_font_55), red, "\U000F16BC");
}
if(id(battery_voltage).has_state ()) {
if(id(battery_voltage).state <= 2.7) {
// Replace battery, less than 10% 420, 558 / 87
it.printf(135, 5, id(icon_font_55), "\U000F10CD");
} else if (id(battery_percent).state >= 98) {
// "\U000F0079" # mdi-battery
it.printf(135, 5, id(icon_font_55), green, "\U000F0079");
} else if (id(battery_percent).state >= 90) {
// "\U000F0082" # mdi-battery-90
it.printf(135, 5, id(icon_font_55), green, "\U000F0082");
} else if (id(battery_percent).state >= 80) {
// "\U000F0081" # mdi-battery-80
it.printf(135, 5, id(icon_font_55), green, "\U000F0081");
} else if (id(battery_percent).state >= 70) {
// "\U000F0080" # mdi-battery-70
it.printf(135, 5, id(icon_font_55), green, "\U000F0080");
} else if (id(battery_percent).state >= 60) {
// "\U000F007F" # mdi-battery-60
it.printf(135, 5, id(icon_font_55), green, "\U000F007F");
} else if (id(battery_percent).state >= 50) {
// "\U000F007E" # mdi-battery-50
it.printf(135, 5, id(icon_font_55), amber, "\U000F007E");
} else if (id(battery_percent).state >= 40) {
// "\U000F007D" # mdi-battery-40
it.printf(135, 5, id(icon_font_55), amber, "\U000F007D");
} else if (id(battery_percent).state >= 30) {
// "\U000F007C" # mdi-battery-30
it.printf(135, 5, id(icon_font_55), red, "\U000F007C");
} else if (id(battery_percent).state >= 20) {
// "\U000F007B" # mdi-battery-20
it.printf(135, 5, id(icon_font_55), red, "\U000F007B");
} else if (id(battery_percent).state >= 10) {
// "\U000F007A" # mdi-battery-10
it.printf(135, 5, id(icon_font_55), red, "\U000F007A");
}
}
if(id(mute_switch).state) {
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
} else {
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
}
it.printf(250, 5, id(icon_font_55), pink, "\U000F1C6F");
it.printf(20, 75, id(icon_font_80), blue,"\U000F050F");
it.printf(40, 120, id(my_font3), white, "%.f", id(s3temp).state);
it.printf(120, 75, id(icon_font_80), yellow,"\U000F06E8" );
it.printf(220, 75, id(icon_font_80), purple,"\U000F0210");
it.printf(20, 155, id(icon_font_80), red,"\U000F075A");
it.printf(120, 155, id(icon_font_80), blue,"\U000F0FCE");
it.printf(220, 155, id(icon_font_80), lime,"\U000F05CB");
- id: template_page
lambda: |-
it.fill(id(black));
if(id(api_connection) == true) {
it.printf(15, 5, id(icon_font_55), blue, "\U000F07D0");
} else {
it.printf(15, 5, id(icon_font_55), red, "\U000F087B");
}
if(id(wifi_connection) == true) {
it.printf(80, 5, id(icon_font_55), lime, "\U000F16BD");
} else {
it.printf(80, 5, id(icon_font_55), red, "\U000F16BC");
}
if(id(battery_voltage).has_state ()) {
if(id(battery_voltage).state <= 2.7) {
// Replace battery, less than 10% 420, 558 / 87
it.printf(135, 5, id(icon_font_55), "\U000F10CD");
} else if (id(battery_percent).state >= 98) {
// "\U000F0079" # mdi-battery
it.printf(135, 5, id(icon_font_55), green, "\U000F0079");
} else if (id(battery_percent).state >= 90) {
// "\U000F0082" # mdi-battery-90
it.printf(135, 5, id(icon_font_55), green, "\U000F0082");
} else if (id(battery_percent).state >= 80) {
// "\U000F0081" # mdi-battery-80
it.printf(135, 5, id(icon_font_55), green, "\U000F0081");
} else if (id(battery_percent).state >= 70) {
// "\U000F0080" # mdi-battery-70
it.printf(135, 5, id(icon_font_55), green, "\U000F0080");
} else if (id(battery_percent).state >= 60) {
// "\U000F007F" # mdi-battery-60
it.printf(135, 5, id(icon_font_55), green, "\U000F007F");
} else if (id(battery_percent).state >= 50) {
// "\U000F007E" # mdi-battery-50
it.printf(135, 5, id(icon_font_55), amber, "\U000F007E");
} else if (id(battery_percent).state >= 40) {
// "\U000F007D" # mdi-battery-40
it.printf(135, 5, id(icon_font_55), amber, "\U000F007D");
} else if (id(battery_percent).state >= 30) {
// "\U000F007C" # mdi-battery-30
it.printf(135, 5, id(icon_font_55), red, "\U000F007C");
} else if (id(battery_percent).state >= 20) {
// "\U000F007B" # mdi-battery-20
it.printf(135, 5, id(icon_font_55), red, "\U000F007B");
} else if (id(battery_percent).state >= 10) {
// "\U000F007A" # mdi-battery-10
it.printf(135, 5, id(icon_font_55), red, "\U000F007A");
}
}
if(id(mute_switch).state) {
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
} else {
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
}
if(id(mute_switch).state) {
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
} else {
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
}
it.printf(250, 5, id(icon_font_55), pink, "\U000F1C6F");
it.printf(20, 75, id(icon_font_80), light_blue,"\U000F06E8");
it.printf(120, 75, id(icon_font_80), light_blue,"\U000F06E8");
it.printf(220, 75, id(icon_font_80), light_blue, "\U000F06E8");
it.printf(20, 155, id(icon_font_80), light_blue,"\U000F06E8");
it.printf(120, 155, id(icon_font_80), light_blue,"\U000F06E8");
it.printf(220, 155, id(icon_font_80), light_blue, "\U000F06E8");
- id: info_page
lambda: |-
it.fill(id(black));
if(id(api_connection) == true) {
it.printf(15, 5, id(icon_font_55), blue, "\U000F07D0");
} else {
it.printf(15, 5, id(icon_font_55), red, "\U000F087B");
}
if(id(wifi_connection) == true) {
it.printf(80, 5, id(icon_font_55), lime, "\U000F16BD");
} else {
it.printf(80, 5, id(icon_font_55), red, "\U000F16BC");
}
if(id(battery_voltage).has_state ()) {
if(id(battery_voltage).state <= 2.7) {
// Replace battery, less than 10% 420, 558 / 87
it.printf(135, 5, id(icon_font_55), "\U000F10CD");
} else if (id(battery_percent).state >= 98) {
// "\U000F0079" # mdi-battery
it.printf(135, 5, id(icon_font_55), green, "\U000F0079");
} else if (id(battery_percent).state >= 90) {
// "\U000F0082" # mdi-battery-90
it.printf(135, 5, id(icon_font_55), green, "\U000F0082");
} else if (id(battery_percent).state >= 80) {
// "\U000F0081" # mdi-battery-80
it.printf(135, 5, id(icon_font_55), green, "\U000F0081");
} else if (id(battery_percent).state >= 70) {
// "\U000F0080" # mdi-battery-70
it.printf(135, 5, id(icon_font_55), green, "\U000F0080");
} else if (id(battery_percent).state >= 60) {
// "\U000F007F" # mdi-battery-60
it.printf(135, 5, id(icon_font_55), green, "\U000F007F");
} else if (id(battery_percent).state >= 50) {
// "\U000F007E" # mdi-battery-50
it.printf(135, 5, id(icon_font_55), amber, "\U000F007E");
} else if (id(battery_percent).state >= 40) {
// "\U000F007D" # mdi-battery-40
it.printf(135, 5, id(icon_font_55), amber, "\U000F007D");
} else if (id(battery_percent).state >= 30) {
// "\U000F007C" # mdi-battery-30
it.printf(135, 5, id(icon_font_55), red, "\U000F007C");
} else if (id(battery_percent).state >= 20) {
// "\U000F007B" # mdi-battery-20
it.printf(135, 5, id(icon_font_55), red, "\U000F007B");
} else if (id(battery_percent).state >= 10) {
// "\U000F007A" # mdi-battery-10
it.printf(135, 5, id(icon_font_55), red, "\U000F007A");
}
}
if(id(mute_switch).state) {
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
} else {
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
}
if(id(mute_switch).state) {
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
} else {
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
}
it.printf(250, 5, id(icon_font_55), pink, "\U000F1C6F");
it.printf(160, 66, id(my_font5), yellow, TextAlign::CENTER, "IP: %s", id(ip_addr).state.c_str());
it.printf(155, 90, id(my_font5), lime, TextAlign::CENTER, "tap to change");
it.printf(20, 105, id(my_font5), yellow, "WakeWord: ");
it.printf(220, 115, id(my_font5), light_blue, TextAlign::CENTER, "%s", id(wakeword_location).state.c_str());
it.printf(90, 145, id(my_font5), yellow, "screensaver :");
if(id(s_saver).state) {
it.printf(255, 135, id(icon_font_55), lime, "\U000F0521");
} else {
it.printf(255, 135, id(icon_font_55), blue_drk, "\U000F0A19");
}
it.printf(35, 205, id(my_font5), yellow, "Timeout to blank :");
if(id(s_saver_mode).state) {
it.printf(255, 195, id(icon_font_55), lime, "\U000F0521");
} else {
it.printf(255, 195, id(icon_font_55), blue_drk, "\U000F0A19");
}
it.printf(10, 175, id(my_font5), yellow, "wake on presence :");
if(id(s_saver_presc).state) {
it.printf(255, 165, id(icon_font_55), lime, "\U000F0521");
} else {
it.printf(255, 165, id(icon_font_55), blue_drk, "\U000F0A19");
}
- id: climate_page
lambda: |-
it.fill(id(black));
if(id(api_connection) == true) {
it.printf(15, 5, id(icon_font_55), blue, "\U000F07D0");
} else {
it.printf(15, 5, id(icon_font_55), red, "\U000F087B");
}
if(id(wifi_connection) == true) {
it.printf(80, 5, id(icon_font_55), lime, "\U000F16BD");
} else {
it.printf(80, 5, id(icon_font_55), red, "\U000F16BC");
}
if(id(battery_voltage).has_state ()) {
if(id(battery_voltage).state <= 2.7) {
// Replace battery, less than 10% 420, 558 / 87
it.printf(135, 5, id(icon_font_55), "\U000F10CD");
} else if (id(battery_percent).state >= 98) {
// "\U000F0079" # mdi-battery
it.printf(135, 5, id(icon_font_55), green, "\U000F0079");
} else if (id(battery_percent).state >= 90) {
// "\U000F0082" # mdi-battery-90
it.printf(135, 5, id(icon_font_55), green, "\U000F0082");
} else if (id(battery_percent).state >= 80) {
// "\U000F0081" # mdi-battery-80
it.printf(135, 5, id(icon_font_55), green, "\U000F0081");
} else if (id(battery_percent).state >= 70) {
// "\U000F0080" # mdi-battery-70
it.printf(135, 5, id(icon_font_55), green, "\U000F0080");
} else if (id(battery_percent).state >= 60) {
// "\U000F007F" # mdi-battery-60
it.printf(135, 5, id(icon_font_55), green, "\U000F007F");
} else if (id(battery_percent).state >= 50) {
// "\U000F007E" # mdi-battery-50
it.printf(135, 5, id(icon_font_55), amber, "\U000F007E");
} else if (id(battery_percent).state >= 40) {
// "\U000F007D" # mdi-battery-40
it.printf(135, 5, id(icon_font_55), amber, "\U000F007D");
} else if (id(battery_percent).state >= 30) {
// "\U000F007C" # mdi-battery-30
it.printf(135, 5, id(icon_font_55), red, "\U000F007C");
} else if (id(battery_percent).state >= 20) {
// "\U000F007B" # mdi-battery-20
it.printf(135, 5, id(icon_font_55), red, "\U000F007B");
} else if (id(battery_percent).state >= 10) {
// "\U000F007A" # mdi-battery-10
it.printf(135, 5, id(icon_font_55), red, "\U000F007A");
}
}
if(id(mute_switch).state) {
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
} else {
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
}
if(id(mute_switch).state) {
it.printf(190, 5, id(icon_font_55), red, "\U000F0581");
} else {
it.printf(190, 5, id(icon_font_55), lime, "\U000F057E");
}