-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathECRAN EINK
361 lines (321 loc) · 12.4 KB
/
ECRAN EINK
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
esphome:
name: ecran
friendly_name: Ecran
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "n3DFk2Ltz3BvMPZJf6aHyiVJde6mrWWri6ySf6k3e/I="
ota:
password: "676f05a50b9d5d01fe01e206fcf357ea"
script:
- id: update_screen
then:
- component.update: eink_display
spi:
clk_pin: 13
mosi_pin: 14
font:
######### REGULAR #################
- file: "epaper/Utendo-Regular.ttf"
id: book20
size: 20
glyphs: &font-glyphs
['!', '"', '%', '(', ')', '+', '=', ',', '-', '_', '.', ':', '°', ' ', '''',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'é', 'à', 'è', 'ç', 'ù', 'É', 'À', 'È', 'Ç', 'Ù']
- file: "epaper/Utendo-Semibold.ttf"
id: book25
size: 25
glyphs : *font-glyphs
########## BOLD ##################
- file: "epaper/Utendo-Semibold.ttf"
id: bold15
size: 15
glyphs : *font-glyphs
- file: "epaper/Utendo-Semibold.ttf"
id: bold20
size: 20
glyphs : *font-glyphs
- file: "epaper/Utendo-Semibold.ttf"
id: bold25
size: 25
glyphs : *font-glyphs
- file: "epaper/Utendo-Semibold.ttf"
id: bold30
size: 30
glyphs : *font-glyphs
- file: "epaper/Utendo-Semibold.ttf"
id: bold35
size: 35
glyphs : *font-glyphs
- file: "epaper/Utendo-Semibold.ttf"
id: bold40
size: 40
glyphs : *font-glyphs
- file: "epaper/Utendo-Semibold.ttf"
id: bold55
size: 55
glyphs: ['.', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C', '-']
- file: 'epaper/materialdesignicons-webfont.ttf'
id: mdi120
size: 100
glyphs: &mdi-weather-glyphs
- "\U000F0590" # mdi-weather-cloudy
- "\U000F0F2F" # mdi-weather-cloudy-alert
- "\U000F0E6E" # mdi-weather-cloudy-arrow-right
- "\U000F0591" # mdi-weather-fog
- "\U000F0592" # mdi-weather-hail
- "\U000F0F30" # mdi-weather-hazy
- "\U000F0898" # mdi-weather-hurricane
- "\U000F0593" # mdi-weather-lightning
- "\U000F067E" # mdi-weather-lightning-rainy
- "\U000F0594" # mdi-weather-night
- "\U000F0F31" # mdi-weather-night-partly-cloudy
- "\U000F0595" # mdi-weather-partly-cloudy
- "\U000F0F32" # mdi-weather-partly-lightning
- "\U000F0F33" # mdi-weather-partly-rainy
- "\U000F0F34" # mdi-weather-partly-snowy
- "\U000F0F35" # mdi-weather-partly-snowy-rainy
- "\U000F0596" # mdi-weather-pouring
- "\U000F0597" # mdi-weather-rainy
- "\U000F0598" # mdi-weather-snowy
- "\U000F0F36" # mdi-weather-snowy-heavy
- "\U000F067F" # mdi-weather-snowy-rainy
- "\U000F0599" # mdi-weather-sunny
- "\U000F0F37" # mdi-weather-sunny-alert
- "\U000F14E4" # mdi-weather-sunny-off
- "\U000F059A" # mdi-weather-sunset
- "\U000F059B" # mdi-weather-sunset-down
- "\U000F059C" # mdi-weather-sunset-up
- "\U000F0F38" # mdi-weather-tornado
- "\U000F059D" # mdi-weather-windy
- "\U000F059E" # mdi-weather-windy-variant
- "\U000F00E9" # mdi-cake
- "\U000F0A70" # mdi-silverware-fork-knife
- "\U000F1A74" # mdi-solar-power-variant-outline
- "\U000F1904" # mdi-home-lightning-bolt-outline
- "\U000F05C3" # mdi-youtube
- "\U000F05D6" # mdi-alert-circle-outline
- file: 'epaper/materialdesignicons-webfont.ttf'
id: mdi36
size: 36
glyphs: *mdi-weather-glyphs
- file: 'epaper/materialdesignicons-webfont.ttf'
id: mdi20
size: 20
glyphs: *mdi-weather-glyphs
- file: 'epaper/materialdesignicons-webfont.ttf'
id: mdi25
size: 25
glyphs:
- "\U000F050F" # mdi-thermometer
- "\U000F01AD" # mdi-currency-eur
- "\U000F1A73" # mdi-solar-power-variant
- "\U000F192D" # transmission-tower-import
- "\U000F192C" # transmission-tower-export
sensor:
- platform: homeassistant
entity_id: sensor.cout_tempo_jour_total
id: cout_edf
- platform: homeassistant
entity_id: sensor.evol_cout_hier
id: evol_cout_edf
- platform: homeassistant
entity_id: sensor.conso_tempo_jour_total
id: conso_total
- platform: homeassistant
entity_id: sensor.evol_conso_hier
id: evol_conso
- platform: homeassistant
entity_id: sensor.prodution_kwh
id: production
- platform: homeassistant
entity_id: sensor.evol_production_hier
id: evol_production
- platform: homeassistant
entity_id: sensor.ecojoko_surplus_de_production
id: export_kwh
- platform: homeassistant
entity_id: weather.mantes_la_ville
attribute: temperature
id: weather_temperature
- platform: homeassistant
entity_id: sensor.netatmo_maison_indoor_temperature
id: temp_salon
- platform: homeassistant
entity_id: sensor.ble_temperature_temperature_chambre
id: temp_chambre
- platform: homeassistant
entity_id: sensor.ble_temperature_temperature_chambre_de_lucie
id: temp_lucie
- platform: homeassistant
entity_id: sensor.ble_temperature_temperature_chambre_chloe
id: temp_chloe
text_sensor:
- platform: homeassistant
entity_id: sensor.date_fr
id: date_fr
- platform: homeassistant
entity_id: sensor.jour_fr
id: jour_fr
- platform: homeassistant
entity_id: sensor.time_fr
id: time_fr
- platform: homeassistant
entity_id: weather.mantes_la_ville
id: meteo
- platform: homeassistant
entity_id: sensor.rte_tempo_couleur_actuelle
id: tempo_jour
- platform: homeassistant
entity_id: sensor.rte_tempo_prochaine_couleur
id: tempo_demain
- platform: homeassistant
entity_id: sensor.mode_chauffage
id: mode_chauffage
time:
- platform: sntp
id: sntp_time
display:
- platform: waveshare_epaper
id: eink_display
cs_pin: 15
dc_pin: 27
busy_pin: 25
reset_pin: 26
reset_duration: 2ms
model: 7.50inv2
rotation: 270°
update_interval: 300s
lambda: |
std::map<std::string, std::string> weather_icon_map
{
{"cloudy", "\U000F0590"},
{"cloudy-alert", "\U000F0F2F"},
{"cloudy-arrow-right", "\U000F0E6E"},
{"fog", "\U000F0591"},
{"hail", "\U000F0592"},
{"hazy", "\U000F0F30"},
{"hurricane", "\U000F0898"},
{"lightning", "\U000F0593"},
{"lightning-rainy", "\U000F067E"},
{"night", "\U000F0594"},
{"night-partly-cloudy", "\U000F0F31"},
{"partlycloudy", "\U000F0595"},
{"partly-lightning", "\U000F0F32"},
{"partly-rainy", "\U000F0F33"},
{"partly-snowy", "\U000F0F34"},
{"partly-snowy-rainy", "\U000F0F35"},
{"pouring", "\U000F0596"},
{"rainy", "\U000F0597"},
{"snowy", "\U000F0598"},
{"snowy-heavy", "\U000F0F36"},
{"snowy-rainy", "\U000F067F"},
{"sunny", "\U000F0599"},
{"sunny-alert", "\U000F0F37"},
{"sunny-off", "\U000F14E4"},
{"sunset", "\U000F059A"},
{"sunset-down", "\U000F059B"},
{"sunset-up", "\U000F059C"},
{"tornado", "\U000F0F38"},
{"windy", "\U000F059D"},
{"windy-variant", "\U000F059E"},
};
std::map<std::string, std::string> weather_traduction
{
{"cloudy", "Nuageux"},
{"cloudy-alert", "Alerte"},
{"cloudy-arrow-right", "--"},
{"fog", "Brouillard"},
{"hail", "Grêle"},
{"hazy", "Brume"},
{"hurricane", "Ouragan"},
{"lightning", "Orage"},
{"lightning-rainy", "Orageux"},
{"night", "Nuit"},
{"night-partly-cloudy", "Nuageux"},
{"partlycloudy", "Nuageux"},
{"partly-lightning", "Orageux"},
{"partly-rainy", "Pluvieux"},
{"partly-snowy", "Neigeux"},
{"partly-snowy-rainy", "Neigeux"},
{"pouring", "À verse"},
{"rainy", "Pluvieux"},
{"snowy", "Neigeux"},
{"snowy-heavy", "Neigeux"},
{"snowy-rainy", "Neigeux"},
{"sunny", "Ensoleillé"},
{"sunny-alert", "Alerte"},
{"sunny-off", "--"},
{"sunset", "Crépuscule"},
{"sunset-down", "Crépuscule"},
{"sunset-up", "Aube"},
{"tornado", "Tornade"},
{"windy", "Venteux"},
{"windy-variant", "Venteux"},
};
it.printf(240, 20, id(bold35), TextAlign::TOP_CENTER, "%s", id(date_fr).state.c_str());
it.filled_rectangle(20, 80, 440, 2);
it.printf(105, 100, id(mdi120), TextAlign::TOP_CENTER, "%s", weather_icon_map[id(meteo).state].c_str());
it.printf(180, 110, id(bold35), TextAlign::TOP_LEFT, "%s", weather_traduction[id(meteo).state].c_str());
it.printf(180, 152, id(bold55), TextAlign::TOP_LEFT, "%2.1f°C", id(weather_temperature).state);
it.filled_rectangle(20, 225, 440, 2);
it.print(240, 250, id(bold30), TextAlign::TOP_CENTER, "TEMPO");
it.print(120, 293, id(bold25), TextAlign::TOP_CENTER, "Aujourd hui");
it.printf(120, 320, id(bold20), TextAlign::TOP_CENTER, "%s", id(tempo_jour).state.c_str());
it.filled_rectangle(240, 293, 2, 50);
it.print(360, 293, id(bold25), TextAlign::TOP_CENTER, "Demain");
it.printf(360, 320, id(bold20), TextAlign::TOP_CENTER, "%s", id(tempo_demain).state.c_str());
it.filled_rectangle(20, 370, 440, 2);
it.print(60, 390, id(bold20), TextAlign::TOP_CENTER, "Salon");
it.print(20, 410, id(mdi25), TextAlign::TOP_CENTER, "\U000F050F");
it.printf(40, 415, id(bold20), TextAlign::TOP_LEFT, "%2.1f°C", id(temp_salon).state);
it.filled_rectangle(120, 390, 2, 50);
it.print(180, 390, id(bold20), TextAlign::TOP_CENTER, "Chambre");
it.print(140, 410, id(mdi25), TextAlign::TOP_CENTER, "\U000F050F");
it.printf(160, 415, id(bold20), TextAlign::TOP_LEFT, "%2.1f°C", id(temp_chambre).state);
it.filled_rectangle(240, 390, 2, 50);
it.print(300, 390, id(bold20), TextAlign::TOP_CENTER, "Lucie");
it.print(260, 410, id(mdi25), TextAlign::TOP_CENTER, "\U000F050F");
it.printf(280, 415, id(bold20), TextAlign::TOP_LEFT, "%2.1f°C", id(temp_lucie).state);
it.filled_rectangle(360, 390, 2, 50);
it.print(420, 390, id(bold20), TextAlign::TOP_CENTER, "Chloé");
it.print(380, 410, id(mdi25), TextAlign::TOP_CENTER, "\U000F050F");
it.printf(400, 415, id(bold20), TextAlign::TOP_LEFT, "%2.1f°C", id(temp_chloe).state);
it.filled_rectangle(20, 450, 440, 2);
it.print(240, 470, id(bold30), TextAlign::TOP_CENTER, "Mode Chauffage");
it.printf(240, 510, id(bold20), TextAlign::TOP_CENTER, "%s", id(mode_chauffage).state.c_str());
it.filled_rectangle(20, 540, 440, 2);
it.print(240, 560, id(bold30), TextAlign::TOP_CENTER, "Electricité");
it.print(120, 600, id(bold25), TextAlign::TOP_CENTER, "Import");
it.print(70, 630, id(mdi25), TextAlign::TOP_CENTER, "\U000F192D");
it.printf(90, 635, id(bold20), TextAlign::TOP_LEFT, "%2.1fkWh", id(conso_total).state);
it.filled_rectangle(240, 600, 2, 140);
it.print(360, 600, id(bold25), TextAlign::TOP_CENTER, "Cout");
it.print(310, 630, id(mdi25), TextAlign::TOP_CENTER, "\U000F01AD");
it.printf(330, 635, id(bold20), TextAlign::TOP_LEFT, "%2.1f EUR", id(cout_edf).state);
it.filled_rectangle(20, 670, 440, 2);
it.print(120, 690, id(bold25), TextAlign::TOP_CENTER, "Panneaux");
it.print(70, 720, id(mdi25), TextAlign::TOP_CENTER, "\U000F1A73");
it.printf(90, 725, id(bold20), TextAlign::TOP_LEFT, "%2.1f kWh", id(production).state);
it.print(360, 690, id(bold25), TextAlign::TOP_CENTER, "Export");
it.print(310, 720, id(mdi25), TextAlign::TOP_CENTER, "\U000F192C");
it.printf(330, 725, id(bold20), TextAlign::TOP_LEFT, "%2.1f kWh", id(export_kwh).state);
it.printf(250, 770, id(bold15), TextAlign::TOP_RIGHT, "Infos mises à jour : ");
it.strftime(255, 770, id(bold15), TextAlign::TOP_LEFT, "%d-%m-%Y %H:%M", id(sntp_time).now());
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Ecran Fallback Hotspot"
password: "C7U7ZJQ2S1eE"
captive_portal: