-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlilygo.yaml
More file actions
135 lines (120 loc) · 4.04 KB
/
Copy pathlilygo.yaml
File metadata and controls
135 lines (120 loc) · 4.04 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
esphome:
name: lilgo
friendly_name: LilGO
external_components:
- source: github://landonr/lilygo-tdisplays3-esphome
components: [tdisplays3]
globals:
- id: coords
type: int
restore_value: no
initial_value: '10'
- id: length
type: int
restore_value: no
initial_value: '10'
interval:
- interval: 1ms
then:
lambda: |-
if (id(coords) < -(id(length))) {
id(coords) = 10;
}
else {
id(coords) -= 6;
}
esp32:
board: esp32-s3-devkitc-1
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "enc-code"
ota:
password: "passwd"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: on
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Lilgo Fallback Hotspot"
password: "zdLcBeJSQtVu"
time:
- platform: sntp
id: sntp_time
servers: time.google.com
timezone: CST6
switch:
- platform: gpio
pin: GPIO38
name: "Backlight"
id: backlight
internal: true
restore_mode: RESTORE_DEFAULT_ON
font:
- file: "gfonts://Vina+Sans"
id: vinasans
size: 32
- file: "gfonts://Vina+Sans"
id: vinasans2
size: 36
- file: "gfonts://Roboto"
id: robotonto
size: 20
glyphs: |
! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz°{|}~¡¢£¤¥¦§¨©ª«¬®¯±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
# gfonts://family[@weight]
- file: "gfonts://Roboto"
id: roboto
size: 20
glyphs: |
! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz°{|}~¡¢£¤¥¦§¨©ª«¬®¯±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
- file:
type: gfonts
family: Roboto
weight: 900
id: roboto2
size: 16
glyphs: |
! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz°{|}~¡¢£¤¥¦§¨©ª«¬®¯±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
sensor:
- platform: homeassistant
id: tlalpan_temperature
entity_id: sensor.openweathermapmx_temperature
internal: true
text_sensor:
- platform: homeassistant
id: sonos_current_song
entity_id: sensor.reproduccion_sonos_estancia_principal
internal: True
animation:
- file: "images/sup-batman.gif"
id: my_animation
resize: 310x610
type: RGB565
display:
- platform: tdisplays3
id: disp
update_interval: 0.1s
rotation: 270
lambda: |-
//Ingress shown animation Frame.
id(my_animation).next_frame();
// Draw the animation my_animation at position [x=0,y=0]
it.image(0, 0, id(my_animation), COLOR_ON, COLOR_OFF);
it.printf(30, 135, id(vinasans), Color(255, 255, 255), id(sntp_time).now().strftime("%I:%M:%S %p %d-%m-%Y ").c_str());
if (id(tlalpan_temperature).has_state()) {
it.printf(302, 20, id(vinasans2), Color(10, 10, 10), TextAlign::TOP_RIGHT , "%.1f°", id(tlalpan_temperature).state);
it.printf(300, 20, id(vinasans), Color(255, 234, 0), TextAlign::TOP_RIGHT , "%.1f°", id(tlalpan_temperature).state);
}
if (id(sonos_current_song).has_state() && std::string(id(sonos_current_song)->state) != "OFF" && std::string(id(sonos_current_song)->state) != "None - None (None)") {
std::string printout = std::string(id(sonos_current_song)->state);
int clength = printout.length();
id(length) = clength*6;
it.printf(id(coords), 120, id(roboto2), Color(255, 234, 0), "%s", printout.c_str());
}
captive_portal: