-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEcoWattScreenVertical_Dark_V2.yaml
369 lines (323 loc) · 9.33 KB
/
EcoWattScreenVertical_Dark_V2.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
esphome:
name: lilygos3-ecowatt
friendly_name: LiLyGoS3-EcoWatt
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
# Enable logging
logger:
level: INFO
api:
encryption:
key: "e4AThsYUhxovYZmc6yat6NZuI/8JIgbUdz8glH5z+wU="
ota:
password: "5320cd818066e2aa7c12c485bfac33c3"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
time:
- platform: homeassistant
id: ha_time
output:
- platform: ledc
pin: GPIO38
id: gpio38
frequency: 2000
light:
- platform: monochromatic
output: gpio38
name: "Backlight"
restore_mode: RESTORE_DEFAULT_ON
# You can either setup the backlight as a switch like below or make it dimmable using a light output like above
# switch:
# - platform: gpio
# pin: GPIO38
# name: "Backlight"
# id: backlight
# internal: true
# restore_mode: RESTORE_DEFAULT_ON
animation:
- file: "gif_dark/hot.gif"
id: hot
resize: 100x100
type: RGB565
- file: "gif_dark/very_hot.gif"
id: very_hot
resize: 100x100
type: RGB565
- file: "gif_dark/weary.gif"
id: start_hot
resize: 100x100
type: RGB565
- file: "gif_dark/money.gif"
id: money
resize: 100x100
type: RGB565
- file: "gif_dark/sunglass.gif"
id: sunglass
resize: 100x100
type: RGB565
- file: "gif_dark/happy.gif"
id: happy
resize: 100x100
type: RGB565
- file: "gif_dark/relieved.gif"
id: neutral
resize: 100x100
type: RGB565
- file: "gif_dark/solar-panel.png"
id: solar_panel
type: RGB24
- file: "gif_dark/cloud-mining.png"
id: bitcoin
type: RGB24
- file: "gif_dark/tower.png"
id: electric_tower
type: RGB24
switch:
- platform: gpio
pin: GPIO38
name: "Backlight"
id: backlight
internal: true
restore_mode: RESTORE_DEFAULT_ON
sensor:
- platform: homeassistant
name: "Consommation Power"
id: consumption_power
entity_id: sensor.shelly_channel_1_power
- platform: homeassistant
name: "Sunology Power"
id: sun_power
entity_id: sensor.shelly_sunpower_channel_1_power
- platform: homeassistant
name: "Puissance Pompe Chaleur"
id: heat_pump_power
entity_id: sensor.shelly_channel_2_power
- platform: homeassistant
name: "Pompe Piscine Power"
id: swimming_pool_pump_power
entity_id: sensor.pompe_piscine_power
- platform: homeassistant
name: "Mining Monitor Power"
id: mining_power
entity_id: sensor.mining_monitor_power
- platform: homeassistant
name: "Energy_cost"
id: cost
entity_id: input_number.energy_cost
- platform: homeassistant
name: "Beam Solar Power"
id: beam_power
entity_id: sensor.smart_switch_23052956369568510d0748e1e9c82cd3_power
- platform: homeassistant
name: "Total Solar Power"
id: total_sun_power
entity_id: sensor.solar_panels
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
text_sensor:
- platform: wifi_info
ip_address:
name: ESP IP Address
ssid:
name: ESP Connected SSID
bssid:
name: ESP Connected BSSID
mac_address:
name: ESP Mac Wifi Address
scan_results:
name: ESP Latest Scan Results
font:
- file:
type: gfonts
family: Nunito Sans
weight: 600
id: nunito_25
size: 25
- file:
type: gfonts
family: Nunito Sans
weight: 600
id: nunito_15
size: 15
- 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
- file:
type: gfonts
family: Nunito Sans
weight: 600
id: nunito_8
size: 8
- file:
type: gfonts
family: Nunito Sans
weight: 600
id: nunito_9
size: 9
color:
- id: RED
red: 100%
green: 33%
blue: 33%
- id: RED2
red: 95%
green: 34%
blue: 0%
- id: BLUE
red: 0%
green: 0%
blue: 100%
- id: WHITE
red: 100%
green: 100%
blue: 100%
- id: GREEN
red: 35%
green: 100%
blue: 64%
- id: BLACK
red: 0%
green: 0%
blue: 0%
display:
- platform: tdisplays3
id: disp
update_interval: 0.001s
rotation: 0
pages:
- id: energy_dashboard
lambda: |-
it.print(51, 7, id(nunito_12), WHITE, TextAlign::LEFT, "PUISSANCE");
it.print(55, 19, id(nunito_12), WHITE, TextAlign::LEFT, "ACTUELLE");
it.print(51, 80, id(nunito_12), WHITE, TextAlign::LEFT, "PUISSANCE");
it.print(60, 95, id(nunito_12), WHITE, TextAlign::LEFT, "SOLAIRE");
it.print(26, 148, id(nunito_8), WHITE, TextAlign::LEFT, "SUNOLOGY");
it.print(110, 148, id(nunito_8), WHITE, TextAlign::LEFT, "BEAM");
it.rectangle(10, 176, 50, 40, WHITE);
it.rectangle(60, 176, 50, 40, WHITE);
it.rectangle(110, 176, 50, 40, WHITE);
it.printf(18, 180, id(nunito_9), GREEN, TextAlign::LEFT, "PISCINE");
it.printf(74, 180, id(nunito_9), GREEN, TextAlign::LEFT, "CLIM");
it.printf(118, 180, id(nunito_9), GREEN, TextAlign::LEFT, "MINING");
float heatPumpPower = id(heat_pump_power).state;
float swimPumpPower = id(swimming_pool_pump_power).state;
float miningPower = id(mining_power).state;
if (swimPumpPower > 4.0) {
it.printf(21, 200, id(nunito_9), GREEN, "%.0f W", id(swimming_pool_pump_power).state);
}
else {
it.printf(21, 200, id(nunito_9), WHITE, "%.0f W", id(swimming_pool_pump_power).state);
}
if (heatPumpPower > 4.0) {
it.printf(68, 200, id(nunito_9), GREEN, "%.0f W", id(heat_pump_power).state);
}
else {
it.printf(68, 200, id(nunito_9), WHITE, "%.0f W", id(heat_pump_power).state);
}
if (miningPower > 4.0) {
it.printf(120, 200, id(nunito_9), GREEN, "%.0f W", id(mining_power).state);
}
else {
it.printf(120, 200, id(nunito_9), WHITE, "%.0f W", id(mining_power).state);
}
float cons = id(consumption_power).state;
if (cons < 0.0) {
if (id(mining_power).has_state()) {
float mining = id(mining_power).state;
if (mining > 15.0) {
it.image(35, 218, id(money), COLOR_ON, COLOR_OFF);
id(money).next_frame();
}
else {
if (cons < -600.0) {
it.image(35, 218, id(sunglass), COLOR_ON, COLOR_OFF);
id(sunglass).next_frame();
}
else {
it.image(35, 218, id(happy), COLOR_ON, COLOR_OFF);
id(happy).next_frame();
}
}
}
else {
it.image(35, 218, id(sunglass), COLOR_ON, COLOR_OFF);
id(sunglass).next_frame();
}
it.printf(42, 36, id(nunito_25), GREEN, "%.0f W", id(consumption_power).state);
}
else {
if (cons < 200.0) {
it.image(35, 218, id(neutral), COLOR_ON, COLOR_OFF);
id(neutral).next_frame();
it.printf(42, 36, id(nunito_25), RED2, "%.0f W", id(consumption_power).state);
}
else {
it.printf(42, 36, id(nunito_25), RED, "%.0f W", id(consumption_power).state);
if (cons < 1000.0) {
it.image(35, 218, id(start_hot), COLOR_ON, COLOR_OFF);
id(start_hot).next_frame();
}
else {
if (cons < 1900.0) {
it.image(35, 218, id(hot), COLOR_ON, COLOR_OFF);
id(hot).next_frame();
}
else {
it.image(35, 218, id(very_hot), COLOR_ON, COLOR_OFF);
id(very_hot).next_frame();
}
}
}
}
float sunpower = id(total_sun_power).state;
if (sunpower > 4.0) {
if (sunpower > 600.0) {
it.printf(36, 109, id(nunito_25), GREEN, "%.1f W", id(total_sun_power).state);
}
else {
it.printf(36, 109, id(nunito_25), WHITE, "%.1f W", id(total_sun_power).state);
}
}
else {
it.printf(36, 109, id(nunito_25), RED2, "%.1f W", id(total_sun_power).state);
}
it.printf(25, 156, id(nunito_15), WHITE, "%.1f W", id(sun_power).state);
it.printf(98, 156, id(nunito_15), WHITE, "%.1f W", id(beam_power).state);
- id: other_dashboard
lambda: |-
it.print(50, 22, id(nunito_12), WHITE, TextAlign::LEFT, "HELLO");