Last active
April 28, 2024 11:25
-
-
Save FabioR46/2f059bfb8ad08aac8beb38deedc3167d to your computer and use it in GitHub Desktop.
Cadre Connecté
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esphome: | |
name: cadre-connecte | |
friendly_name: Cadre Connecté | |
platform: ESP32 | |
board: esp32dev | |
on_boot: | |
- delay: 60s | |
- script.execute: update_screen | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_password | |
ap: | |
ssid: "Epaper-Esp32 Fallback Hotspot" | |
password: "xUrnzdTgzT" | |
captive_portal: | |
logger: | |
# Enable Home Assistant API | |
api: | |
encryption: | |
key: "APIKEY" | |
ota: | |
script: | |
- id: update_screen | |
then: | |
- component.update: eink_display | |
spi: | |
clk_pin: 13 | |
mosi_pin: 14 | |
font: | |
######### REGULAR ################# | |
- file: "epaper/GothamRnd-Book.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/GothamRnd-Book.ttf" | |
id: book25 | |
size: 25 | |
glyphs : *font-glyphs | |
########## BOLD ################## | |
- file: "epaper/GothamRnd-Bold.ttf" | |
id: bold15 | |
size: 15 | |
glyphs : *font-glyphs | |
- file: "epaper/GothamRnd-Bold.ttf" | |
id: bold20 | |
size: 20 | |
glyphs : *font-glyphs | |
- file: "epaper/GothamRnd-Bold.ttf" | |
id: bold25 | |
size: 25 | |
glyphs : *font-glyphs | |
- file: "epaper/GothamRnd-Bold.ttf" | |
id: bold30 | |
size: 30 | |
glyphs : *font-glyphs | |
- file: "epaper/GothamRnd-Bold.ttf" | |
id: bold35 | |
size: 35 | |
glyphs : *font-glyphs | |
- file: "epaper/GothamRnd-Bold.ttf" | |
id: bold40 | |
size: 40 | |
glyphs : *font-glyphs | |
- file: "epaper/GothamRnd-Bold.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: 120 | |
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 | |
- "\U000F05F1" # mdi-wallbox | |
- "\U000F0CD4" # mdi-boks-parcel | |
- "\U000F1A74" # mdi-solar-power-variant-outline | |
- "\U000F1904" # mdi-home-lightning-bolt-outline | |
- "\U000F067B" # mdi-tempoEDF | |
- "\U000F05D6" # mdi-alert-circle-outline | |
- "\U000F05D5" # mdi-plane | |
- "\U000F0531" # mdi-travel_france | |
- "\U000F0A7A" # mdi-trash | |
- "\U000F044C" # mdi-recycle | |
- "\U000F0438" # mdi-radiator_on | |
- "\U000F0902" # mdi-radiator_off | |
- "\U000F0E66" # mdi-carbonfree | |
- "\U000F1806" #mdi-waterboil | |
- 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 | |
sensor: | |
- platform: homeassistant | |
entity_id: weather.nantes | |
attribute: temperature | |
id: weather_temperature | |
- platform: homeassistant | |
entity_id: sensor.thc238_268_thn132_thwr288_thrn122_thn122_aw129_131_f8_04_temperature | |
id: temp_bedroom_1 | |
- platform: homeassistant | |
entity_id: sensor.family_room_temperature | |
id: temp_salon | |
- platform: homeassistant | |
entity_id: sensor.0xa4c1382031970609_temperature | |
id: temp_amis | |
- platform: homeassistant | |
entity_id: sensor.0x00158d00023942c6_device_temperature | |
id: temp_parentale | |
- platform: homeassistant | |
entity_id: sensor.0xa4c138be6370240d_temperature | |
id: temp_bureau | |
text_sensor: | |
- platform: homeassistant | |
entity_id: sensor.date_du_jour | |
id: date_fr_complete | |
- platform: homeassistant | |
entity_id: weather.nantes | |
id: weather_name | |
- platform: homeassistant | |
entity_id: sensor.rte_tempo_couleur_actuelle | |
id: color_today | |
- platform: homeassistant | |
entity_id: sensor.rte_tempo_prochaine_couleur | |
id: color_next | |
- platform: homeassistant | |
entity_id: binary_sensor.tesla_wall_connector_vehicule_connecte | |
id: tesla_wall_car_connected | |
- platform: homeassistant | |
entity_id: binary_sensor.tesla_wall_connector_contacteur_ferme | |
id: tesla_wall_car_charging | |
- platform: homeassistant | |
entity_id: input_boolean.colis_en_attente | |
id: boks_state | |
- platform: homeassistant | |
entity_id: sensor.compteur_pv | |
id: solar_panel | |
- platform: homeassistant | |
entity_id: sensor.cadre_linky_kwh | |
id: linky_cadre | |
- platform: homeassistant | |
entity_id: sensor.anniversary_voyage | |
id: long_travel | |
- platform: homeassistant | |
entity_id: sensor.anniversary_travel | |
id: parc_travel | |
- platform: homeassistant | |
entity_id: calendar.poubelle_verte | |
id: trash_out | |
- platform: homeassistant | |
entity_id: calendar.poubelle_jaune | |
id: recycle_out | |
- platform: homeassistant | |
entity_id: switch.vanne_etg | |
id: heat_up | |
- platform: homeassistant | |
entity_id: switch.vanne_crdc | |
id: heat_down | |
- platform: homeassistant | |
entity_id: switch.vanne_rdc | |
id: heat_rdc | |
- platform: homeassistant | |
entity_id: sensor.electricity_maps_pourcentage_d_energies_fossiles_du_reseau | |
id: carbon_stat | |
- platform: homeassistant | |
entity_id: sensor.suivi_eau | |
id: water_count | |
graph: | |
- id: weather_temperature_graph | |
sensor: weather_temperature | |
duration: 24h | |
width: 380 | |
height: 50 | |
min_value: 0 | |
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"}, | |
{"on", "Branché"}, | |
{"off", "Débranché"}, | |
}; | |
std::map<std::string, std::string> info_traduction | |
{ | |
{"on", "Livré"}, | |
{"off", "Vide"}, | |
}; | |
std::map<std::string, std::string> charge_traduction | |
{ | |
{"on", "En Charge"}, | |
{"off", "Stoppé"}, | |
}; | |
std::map<std::string, std::string> trash_traduction | |
{ | |
{"on", "à sortir"}, | |
{"off", " "}, | |
}; | |
std::map<std::string, std::string> heat_traduction | |
{ | |
{"on", "\U000F0438"}, | |
{"off", "\U000F0902"}, | |
}; | |
it.printf(240, 75, id(bold35), TextAlign::TOP_CENTER, "%s", id(date_fr_complete).state.c_str()); | |
it.filled_rectangle(50, 120, 380, 2); | |
it.printf(135, 135, id(mdi120), TextAlign::TOP_CENTER, "%s", weather_icon_map[id(weather_name).state].c_str()); | |
it.printf(215, 145, id(bold35), TextAlign::TOP_LEFT, "%s",weather_traduction[id(weather_name).state].c_str()); | |
it.printf(215, 187, id(bold55), TextAlign::TOP_LEFT, "%2.1f°C", id(weather_temperature).state); | |
it.filled_rectangle(50, 260, 380, 2); | |
it.printf(85, 265, id(mdi36), TextAlign::TOP_CENTER, "%s", heat_traduction[id(heat_up).state].c_str()); | |
it.printf(85, 305, id(bold20), TextAlign::TOP_CENTER, "%2.1f°C", id(temp_bedroom_1).state); | |
it.print(85, 325, id(book20), TextAlign::TOP_CENTER, "Chambre 1"); | |
it.printf(157, 265, id(mdi36), TextAlign::TOP_CENTER, "%s", heat_traduction[id(heat_rdc).state].c_str()); | |
it.printf(157, 305, id(bold20), TextAlign::TOP_CENTER, "%2.1f°C", id(temp_salon).state); | |
it.print(157, 325, id(book20), TextAlign::TOP_CENTER, "Salon"); | |
it.printf(233, 265, id(mdi36), TextAlign::TOP_CENTER, "%s", heat_traduction[id(heat_up).state].c_str()); | |
it.printf(233, 305, id(bold20), TextAlign::TOP_CENTER, "%2.1f°C", id(temp_amis).state); | |
it.print(233, 325, id(book20), TextAlign::TOP_CENTER, "Amis"); | |
it.printf(318, 265, id(mdi36), TextAlign::TOP_CENTER, "%s", heat_traduction[id(heat_down).state].c_str()); | |
it.printf(318, 305, id(bold20), TextAlign::TOP_CENTER, "%2.1f°C", id(temp_parentale).state); | |
it.print(318, 325, id(book20), TextAlign::TOP_CENTER, "Parents"); | |
it.printf(395, 265, id(mdi36), TextAlign::TOP_CENTER, "%s", heat_traduction[id(heat_up).state].c_str()); | |
it.printf(395, 305, id(bold20), TextAlign::TOP_CENTER, "%2.1f°C", id(temp_bureau).state); | |
it.print(395, 325, id(book20), TextAlign::TOP_CENTER, "Bureau"); | |
it.filled_rectangle(50, 350, 380, 2); | |
it.print(40, 370, id(bold25), TextAlign::TOP_LEFT, "Borne"); | |
it.print(150, 365, id(mdi36), TextAlign::TOP_LEFT, "\U000F05F1"); | |
it.printf(195, 370, id(book25), TextAlign::TOP_LEFT, "%s", weather_traduction[id(tesla_wall_car_connected).state].c_str()); | |
it.print(335, 370, id(bold25), TextAlign::TOP_LEFT, "|"); | |
it.printf(350, 370, id(book25), TextAlign::TOP_LEFT, "%s", charge_traduction[id(tesla_wall_car_charging).state].c_str()); | |
it.print(40, 405, id(bold25), TextAlign::TOP_LEFT, "Boks"); | |
it.print(150, 395, id(mdi36), TextAlign::TOP_LEFT, "\U000F0CD4"); | |
it.printf(210, 405, id(book25), TextAlign::TOP_LEFT, "%s", info_traduction[id(boks_state).state].c_str()); | |
it.print(40, 440, id(bold25), TextAlign::TOP_LEFT, "Poubelle"); | |
it.print(150, 430, id(mdi36), TextAlign::TOP_LEFT, "\U000F0A7A"); | |
it.printf(210, 435, id(book25), TextAlign::TOP_LEFT, "%s", trash_traduction[id(trash_out).state].c_str()); | |
it.print(305, 430, id(mdi36), TextAlign::TOP_LEFT, "\U000F044C"); | |
it.printf(350, 435, id(book25), TextAlign::TOP_LEFT, "%s", trash_traduction[id(recycle_out).state].c_str()); | |
it.print(40, 475, id(bold25), TextAlign::TOP_LEFT, "Voyage"); | |
it.print(210, 470, id(mdi36), TextAlign::TOP_LEFT, "\U000F05D5"); | |
it.printf(290, 475, id(book25), TextAlign::TOP_LEFT, "%s Jours", id(long_travel).state.c_str()); | |
it.print(40, 510, id(bold25), TextAlign::TOP_LEFT, "Vacances"); | |
it.print(210, 505, id(mdi36), TextAlign::TOP_LEFT, "\U000F0531"); | |
it.printf(290, 510, id(book25), TextAlign::TOP_LEFT, "%s Jours", id(parc_travel).state.c_str()); | |
it.filled_rectangle(50, 550, 380, 2); | |
it.print(70, 560, id(mdi36), TextAlign::TOP_CENTER, "\U000F1A74"); | |
it.printf(95, 565, id(bold30), TextAlign::TOP_LEFT, "%s Wh", id(solar_panel).state.c_str()); | |
it.filled_rectangle(235, 558, 2, 40); | |
it.print(265, 560, id(mdi36), TextAlign::TOP_CENTER, "\U000F1904"); | |
it.printf(285, 565, id(bold30), TextAlign::TOP_LEFT, "%s kWh", id(linky_cadre).state.c_str()); | |
it.filled_rectangle(50, 610, 380, 2); | |
it.print(70, 617, id(mdi36), TextAlign::TOP_CENTER, "\U000F0E66"); | |
it.printf(95, 625, id(bold30), TextAlign::TOP_LEFT, "%s", id(carbon_stat).state.c_str()); | |
it.print(200, 625, id(bold30), TextAlign::TOP_CENTER, "%"); | |
it.filled_rectangle(235, 618, 2, 40); | |
it.print(265, 620, id(mdi36), TextAlign::TOP_CENTER, "\U000F1806"); | |
it.printf(295, 625, id(bold30), TextAlign::TOP_LEFT, "%s L", id(water_count).state.c_str()); | |
it.filled_rectangle(50, 665, 380, 2); | |
it.print(58, 675, id(mdi36), TextAlign::TOP_CENTER, "\U000F067B"); | |
it.printf(80, 680, id(bold25), TextAlign::TOP_LEFT, "%s", id(color_today).state.c_str()); | |
it.print(177, 680, id(book25), TextAlign::TOP_LEFT, "Jour"); | |
it.filled_rectangle(242, 680, 2, 25); | |
it.printf(252, 680, id(bold25), TextAlign::TOP_LEFT, "%s", id(color_next).state.c_str()); | |
it.print(350, 680, id(book25), TextAlign::TOP_LEFT, "Demain"); | |
it.filled_rectangle(50, 720, 380, 2); | |
it.printf(250, 725, id(bold15), TextAlign::TOP_RIGHT, "Infos mises à jour : "); | |
it.strftime(255, 725, id(bold15), TextAlign::TOP_LEFT, "%d-%m-%Y %H:%M", id(sntp_time).now()); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment