-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathecran_raccourci
264 lines (236 loc) · 7.88 KB
/
ecran_raccourci
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
esphome:
name: ecran
friendly_name: Ecran
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
password: ""
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.indoor_exterieur_temperature
id: weather_temperature
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
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: 200ms
model: 7.50inV2alt
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", "Eclaircies"},
{"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"},
};
int minut = int(id(minuteur).state);
if (minut > 0) {
it.printf(240, 20, id(bold35), TextAlign::TOP_CENTER, "%s", id(date_fr).state.c_str());
it.filled_rectangle(20, 70, 440, 2);
it.printf(100, 80, id(mdi120), TextAlign::TOP_CENTER, "%s", weather_icon_map[id(meteo).state].c_str());
it.printf(175, 90, id(bold35), TextAlign::TOP_LEFT, "%s", weather_traduction[id(meteo).state].c_str());
it.printf(175, 132, id(bold55), TextAlign::TOP_LEFT, "%2.1f°C", id(weather_temperature).state);
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: