pour des icônes, la doc :
tu peux rechercher les icônes sur ce site Material Design Icons - Icon Library - Pictogrammers
un exemple, que j'utilise :
image:
- file: mdi:weather-pouring
id: pouring
type: BINARY
resize: 70x70
- file: mdi:weather-partly-cloudy
id: partly_cloudy
type: BINARY
resize: 70x70
- file: mdi:weather-sunny
id: sunny
type: BINARY
resize: 70x70
- file: mdi:close
id: croix
type: BINARY
resize: 70x70
- file: mdi:battery-high
id: battery
type: BINARY
resize: 30x30
- file: mdi:wifi
id: wifi_icon
type: BINARY
resize: 30x30
color:
- id: my_white
red: 100%
green: 100%
blue: 100%
- id: my_blue
red: 0%
green: 0%
blue: 100%
- id: my_red
red: 100%
green: 0%
blue: 0%
- id: my_green
red: 0%
green: 100%
blue: 0%
- id: my_yellow
red: 100%
green: 100%
blue: 0%
- id: my_orange
red: 100%
green: 50%
blue: 0%
# 1.14 inch, 135*240 Colorful TFT LCD, ST7789v2
display:
- platform: ili9xxx
model: st7789v
cs_pin: GPIO5
dc_pin: GPIO14
reset_pin: GPIO12
rotation: 90
color_palette: NONE
dimensions:
height: 240
width: 135
offset_height: 40
offset_width: 52
# Required or the colors are all inverted, and Black screen is White
invert_colors: true
lambda: |-
it.strftime(30, 2, id(roboto), id(my_blue), "%H:%M:%S %d/%m/%y", id(my_time).now());
if ((id(pression_state).state >= 960) && (id(pression_state).state < 990)) {it.image(14, 30, id(pouring), id(my_red));}
else if ((id(pression_state).state >= 990) && (id(pression_state).state < 1020)) {it.image(14, 30, id(partly_cloudy), id(my_yellow));}
else if ((id(pression_state).state >= 1020) && (id(pression_state).state < 1060)) {it.image(14, 30, id(sunny), id(my_green));}
else {it.image(14, 30, id(croix), id(my_red));}
it.printf(94, 40, id(roboto), id(my_green), "%.0fhpa", id(pression_state).state);
it.printf(94, 66, id(roboto), id(my_blue), "%.1f°C", id(temp_state).state);
it.printf(173, 66, id(roboto), id(my_blue), "%.0f%%", id(hum_state).state);
if (id(battery_percent).state < 11) { it.image(20, 102, id(battery), id(my_red));}
else {it.image(20, 102, id(battery), id(my_green));}
it.printf(54, 106, id(roboto), id(my_white), "%.0f%%", id(battery_percent).state);
if ((id(wifi_signal_pct).state >= 1) && (id(wifi_signal_pct).state < 25)) {it.image(123, 102, id(wifi_icon), id(my_red));}
else if ((id(wifi_signal_pct).state >= 25) && (id(wifi_signal_pct).state < 50)) {it.image(123, 102, id(wifi_icon), id(my_orange));}
else if ((id(wifi_signal_pct).state >= 50) && (id(wifi_signal_pct).state < 75)) {it.image(123, 102, id(wifi_icon), id(my_yellow));}
else {it.image(123, 102, id(wifi_icon), id(my_green));}
it.printf(161, 106, id(roboto), id(my_white), "%.0f%%", id(wifi_signal_pct).state);
résultat :