-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEcoWattScreenVertical_White.yaml
executable file
·284 lines (256 loc) · 6.96 KB
/
EcoWattScreenVertical_White.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
esphome:
name: lilygoscreens3
#platformio_options:
# board_build.mcu: esp32s3
# board_build.name: "LilyGO T-Embed ESP32-S3"
# board_build.upload.flash_size: "16MB"
# board_build.upload.maximum_size: 16777216
# board_build.vendor: "LilyGO"
platformio_options:
board_upload.flash_size: 16MB
board_upload.maximum_ram_size: 327680
board_upload.maximum_size: 16777216
board_build.partitions: "../../../custom_partitions.csv"
external_components:
- source: github://landonr/lilygo-tdisplays3-esphome
components: [tdisplays3]
esp32:
board: esp32-s3-devkitc-1
variant: esp32s3
framework:
type: arduino
#esp32:
# board: esp32-s3-devkitc-1
# variant: esp32s3
#framework:
# type: arduino
# version: 2.0.3
# platform_version: 5.0.0
# Enable logging
logger:
level: INFO
# Enable Home Assistant API
#api:
#ota:
# password: "6ada29f6f41ce1685d29d406efd25fa4"
api:
encryption:
key: "ylBsQ2GLtmw8UInDd3umS7LuiCuPF1c1ng8jG14Qzy0="
ota:
password: "ec3b42291a5141421db188ef86cbf4f7"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "S3ScreenHotSpot"
password: "Passworddd"
time:
- platform: homeassistant
id: ha_time
animation:
# - file: "gif/emoji_19.gif"
# id: waiting
# resize: 100x100
# type: RGB565
- file: "gif/emoji_21.gif"
id: hot
resize: 100x100
type: RGB565
- file: "gif/emoji_22.gif"
id: very_hot
resize: 100x100
type: RGB565
# - file: "gif/emoji_27.gif"
# id: angry
# resize: 100x100
# type: RGB565
- file: "gif/emoji_28.gif"
id: start_hot
resize: 100x100
type: RGB565
- file: "gif/emoji_9.gif"
id: very_happy
resize: 100x100
type: RGB565
- file: "gif/emoji_3.gif"
id: happy
resize: 100x100
type: RGB565
# - file: "gif/emoji_13.gif"
# id: smilling
# resize: 100x100
# type: RGB565
# - file: "gif/emoji_18.gif"
# id: shy
# resize: 100x100
# type: RGB565
- file: "gif/emoji_6.gif"
id: neutral
resize: 100x100
type: RGB565
- file: "gif/solar-panel.gif"
id: solar_panel
resize: 25x25
type: GRAYSCALE
- file: "gif/bitcoin.gif"
id: bitcoin
resize: 25x25
type: GRAYSCALE
- file: "gif/electric-tower.png"
id: electric_tower
resize: 25x25
type: GRAYSCALE
sensor:
- platform: homeassistant
name: "Shelly channel 1 power"
id: consumption_power
entity_id: sensor.shelly_channel_1_power
- platform: homeassistant
name: "Puissance Sunology"
id: sun_power
entity_id: sensor.shelly_channel_2_power
- platform: homeassistant
name: "Mining Monitor Power"
id: mining_power
entity_id: sensor.mining_monitor_power
binary_sensor:
- platform: gpio
pin:
number: GPIO0
inverted: true
mode:
input: true
pullup: true
name: "short press button0"
id: tdisplay_button_0
on_click:
min_length: 1ms
max_length: 1000ms
then:
- display.page.show_previous: disp
- component.update: disp
font:
- file:
type: gfonts
family: Nunito Sans
weight: 600
id: nunito_25
size: 25
- file:
type: gfonts
family: Nunito Sans
weight: 600
id: nunito_12
size: 12
- file:
type: gfonts
family: Nunito Sans
weight: 600
id: nunito_10
size: 10
color:
- id: RED
red: 100%
green: 33%
blue: 33%
- id: RED2
red: 54%
green: 19%
blue: 19%
- id: BLUE
red: 0%
green: 0%
blue: 100%
- id: WHITE
red: 100%
green: 100%
blue: 100%
- id: GREEN
red: 0%
green: 69%
blue: 31%
- id: BLACK
red: 0%
green: 0%
blue: 0%
display:
- platform: tdisplays3
id: disp
#update_interval: 1s
update_interval: 0.01s
rotation: 180
pages:
- id: energy_dashboard
lambda: |-
it.fill(COLOR_ON);
if (id(consumption_power).has_state()) {
it.print(53, 22, id(nunito_12), BLACK, TextAlign::LEFT, "PUISSANCE");
it.print(57, 34, id(nunito_12), BLACK, TextAlign::LEFT, "ACTUELLE");
it.print(53, 105, id(nunito_12), BLACK, TextAlign::LEFT, "PUISSANCE");
it.print(62, 117, id(nunito_12), BLACK, TextAlign::LEFT, "SOLAIRE");
float cons = id(consumption_power).state;
float mining = 0.0;
if (id(mining_power).has_state()) {
float mining = id(mining_power).state;
if (mining > 15.0) {
it.image(140, 285, id(bitcoin), COLOR_ON, COLOR_OFF);
id(bitcoin).next_frame();
}
}
if (cons < 0.0) {
if (mining > 15.0) {
it.image(35, 193, id(very_happy), COLOR_ON, COLOR_OFF);
id(very_happy).next_frame();
}
else {
it.image(35, 193, id(happy), COLOR_ON, COLOR_OFF);
id(happy).next_frame();
}
it.printf(42, 51, id(nunito_25), GREEN, "%.0f W", id(consumption_power).state);
}
else {
if (cons < 200.0) {
it.image(35, 193, id(neutral), COLOR_ON, COLOR_OFF);
id(neutral).next_frame();
it.printf(42, 51, id(nunito_25), RED2, "%.0f W", id(consumption_power).state);
}
else {
it.printf(42, 51, id(nunito_25), RED, "%.0f W", id(consumption_power).state);
if (cons < 450.0) {
it.image(35, 193, id(start_hot), COLOR_ON, COLOR_OFF);
id(start_hot).next_frame();
}
else {
if (cons < 1000.0) {
it.image(35, 193, id(hot), COLOR_ON, COLOR_OFF);
id(hot).next_frame();
}
else {
it.image(35, 193, id(very_hot), COLOR_ON, COLOR_OFF);
id(very_hot).next_frame();
}
}
}
}
float sunpower = id(sun_power).state;
if (sunpower > 0.0) {
if (sunpower > 600.0) {
it.printf(42, 134, id(nunito_25), GREEN, "%.1f W", id(sun_power).state);
}
else {
it.printf(42, 134, id(nunito_25), BLACK, "%.1f W", id(sun_power).state);
}
it.image(5, 285, id(solar_panel), COLOR_ON, COLOR_OFF);
id(solar_panel).next_frame();
}
else {
it.image(5, 285, id(electric_tower));
}
}
else {
it.print(42, 134, id(nunito_25), BLACK, TextAlign::LEFT, "WAITING...");
}
- id: other_dashboard
lambda: |-
it.print(53, 22, id(nunito_12), WHITE, TextAlign::LEFT, "PUISSANCE");