From 3da69c19ab62b0ec582ce265772d5e78c03acece Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Sat, 11 Jul 2026 19:14:52 +0200 Subject: [PATCH] Base epaperframe config with Kinderzimmer --- esphome/epaperframe.yaml | 833 ++++++++++++++++++++++++++++++--------- 1 file changed, 644 insertions(+), 189 deletions(-) diff --git a/esphome/epaperframe.yaml b/esphome/epaperframe.yaml index eba92fd..e3485b5 100644 --- a/esphome/epaperframe.yaml +++ b/esphome/epaperframe.yaml @@ -15,7 +15,7 @@ esphome: priority: -10 then: - delay: 10s - - display.page.show: power # temporary for power page dev + - display.page.show: environment # temporary for power page dev - component.update: epaper esp32: @@ -23,13 +23,10 @@ esp32: framework: type: esp-idf -network: - enable_ipv6: true - wifi: ssid: "Voltage-legacy" password: !secret voltage_legacy_psk - #use_address: epaperframe.home + use_address: epaperframe.home power_save_mode: high fast_connect: on min_auth_mode: WPA2 @@ -81,7 +78,7 @@ binary_sensor: then: - logger.log: level: INFO - format: 'Button doubleclick, rendering next page!' + format: "Button doubleclick, rendering next page!" - display.page.show_next: epaper - component.update: epaper - timing: @@ -90,7 +87,7 @@ binary_sensor: then: - logger.log: level: INFO - format: 'Button click, refreshing screen!' + format: "Button click, refreshing screen!" - component.update: epaper # HA pushbutton configuration @@ -102,7 +99,7 @@ button: on_press: - logger.log: level: INFO - format: 'HA Button click, refreshing screen!' + format: "HA Button click, refreshing screen!" - component.update: epaper - platform: template name: Next screen @@ -111,7 +108,7 @@ button: on_press: - logger.log: level: INFO - format: 'HA Button click, rendering next page!' + format: "HA Button click, rendering next page!" - display.page.show_next: epaper - component.update: epaper @@ -122,10 +119,6 @@ sensor: id: wifisignal update_interval: 60s - - platform: homeassistant - entity_id: sensor.livingroom_wohnzimmer_feinstaub_pm_2_5_m - id: pm25_livingroom - - platform: homeassistant entity_id: sensor.wohnzimmer_temperatur id: temp_livingroom @@ -139,8 +132,8 @@ sensor: id: co2_livingroom - platform: homeassistant - entity_id: sensor.alpstuga_air_quality_monitor_pm25_2 - id: pm25_sleepingroom + entity_id: sensor.livingroom_wohnzimmer_feinstaub_pm_2_5_m + id: pm25_livingroom - platform: homeassistant entity_id: sensor.alpstuga_air_quality_monitor_temperatur_2 @@ -154,6 +147,26 @@ sensor: entity_id: sensor.alpstuga_air_quality_monitor_kohlendioxid_2 id: co2_sleepingroom + - platform: homeassistant + entity_id: sensor.alpstuga_air_quality_monitor_pm25_2 + id: pm25_sleepingroom + + - platform: homeassistant + entity_id: sensor.alpstuga_air_quality_monitor_temperatur + id: temp_childrensroom + + - platform: homeassistant + entity_id: sensor.alpstuga_air_quality_monitor_luftfeuchtigkeit + id: humid_childrensroom + + - platform: homeassistant + entity_id: sensor.alpstuga_air_quality_monitor_kohlendioxid + id: co2_childrensroom + + - platform: homeassistant + entity_id: sensor.alpstuga_air_quality_monitor_pm25 + id: pm25_childrensroom + - platform: homeassistant entity_id: sensor.aussentemperatur id: temp_outdoor @@ -189,11 +202,11 @@ sensor: - platform: homeassistant entity_id: sensor.schlafzimmer_bett_power id: bedlight_sleepingroom - + - platform: homeassistant entity_id: sensor.schlafzimmer_heimkino_power id: media_sleepingroom - + - platform: homeassistant entity_id: sensor.radioaktive_strahlungsleistung id: radiation @@ -205,7 +218,7 @@ text_sensor: entity_id: sensor.sun_rising_template id: sun_rising internal: true - + - platform: homeassistant name: "Sun Setting ESP" #entity_id: sensor.sun_next_setting @@ -221,22 +234,6 @@ text_sensor: entity_id: weather.zuhause id: weather - - platform: homeassistant - entity_id: sensor.schlafzimmer_co2_warnstufe - id: szco2 - - - platform: homeassistant - entity_id: sensor.schlafzimmer_feinstaub_warnstufe - id: szpm - - - platform: homeassistant - entity_id: sensor.wohnzimmer_co2_warnstufe - id: wzco2 - - - platform: homeassistant - entity_id: sensor.wohnzimmer_feinstaub_warnstufe - id: wzpm - graph: - id: line_power_graph sensor: power_total @@ -248,144 +245,476 @@ time: - platform: homeassistant id: homeassistant_time on_time: - # Every 10 seconds - - seconds: /10 - then: - - logger.log: - level: INFO - format: 'Power button press' - - output.turn_on: power_key - - delay: 0.5s - - output.turn_off: power_key - # Every 10 minutes - - seconds: 0 - minutes: /10 - then: - - logger.log: - level: INFO - format: 'Timer based screen refresh' - - component.update: epaper + # Every 10 seconds + - seconds: /10 + then: + - logger.log: + level: INFO + format: "Power button press" + - output.turn_on: power_key + - delay: 0.5s + - output.turn_off: power_key + # Every 10 minutes + - seconds: 0 + minutes: /10 + then: + - logger.log: + level: INFO + format: "Timer based screen refresh" + - component.update: epaper # Font definitions font: - - file: 'fonts/Roboto-Medium.ttf' + - file: "fonts/Roboto-Medium.ttf" id: roboto_med_30 size: 30 - - file: 'fonts/Roboto-Regular.ttf' + - file: "fonts/Roboto-Regular.ttf" id: footer_font size: 15 glyphs: - ['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', - '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', 'Ä', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß', - 'Ü', 'ü', 'Ö', '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", + "Ä", + "ä", + "ö", + "/", + "º", + "µ", + "³", + "ß", + "Ü", + "ü", + "Ö", + "0", + ] - - file: 'fonts/Roboto-Regular.ttf' + - file: "fonts/Roboto-Regular.ttf" id: sensor_unit size: 20 glyphs: - ['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', - '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', 'Ä', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß', - 'Ü', 'ü', 'Ö', '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", + "Ä", + "ä", + "ö", + "/", + "º", + "µ", + "³", + "ß", + "Ü", + "ü", + "Ö", + "0", + ] - - file: 'fonts/Roboto-Medium.ttf' + - file: "fonts/Roboto-Medium.ttf" id: sub_sensor_font size: 30 glyphs: - ['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', - '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', 'Ä', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß', - 'Ü', 'ü', 'Ö', '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", + "Ä", + "ä", + "ö", + "/", + "º", + "µ", + "³", + "ß", + "Ü", + "ü", + "Ö", + "0", + ] - - file: 'fonts/Roboto-Bold.ttf' + - file: "fonts/Roboto-Bold.ttf" id: big_sensor_font size: 50 glyphs: - ['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', - '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', 'Ä', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß', - 'Ü', 'ü', 'Ö', '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", + "Ä", + "ä", + "ö", + "/", + "º", + "µ", + "³", + "ß", + "Ü", + "ü", + "Ö", + "0", + ] - - file: 'fonts/materialdesignicons-webfont.ttf' - id: mdi_small + - file: "fonts/materialdesignicons-webfont.ttf" + id: mdi_small size: 31 glyphs: [ - '󰔏', # mdi-thermometer - '󰖎', # mdi-water-percent - '󰮬', # mdi-molecule (pm2.5) - '󰟤', # mdi-co2 - '󰊚', # mdi-gauge (air pressure) - '󰖙', # mdi-weather-sunny - '󰖛', # mdi-weather-sunset-down - '󰖜', # mdi-weather-sunset-up - '󱐋', # mdi-lightning-bolt - '󰴾', # mdi-transmission-tower - '󰚥', # mdi-power-plug - '󱈹', # mdi-desk - '󰔂', # mdi-television - '󰐼' # mdi-radiation + "󰔏", # mdi-thermometer + "󰖎", # mdi-water-percent + "󰮬", # mdi-molecule (pm2.5) + "󰟤", # mdi-co2 + "󰊚", # mdi-gauge (air pressure) + "󰖙", # mdi-weather-sunny + "󰖛", # mdi-weather-sunset-down + "󰖜", # mdi-weather-sunset-up + "󱐋", # mdi-lightning-bolt + "󰴾", # mdi-transmission-tower + "󰚥", # mdi-power-plug + "󱈹", # mdi-desk + "󰔂", # mdi-television + "󰐼", # mdi-radiation ] - - file: 'fonts/materialdesignicons-webfont.ttf' - id: mdi_weather + - file: "fonts/materialdesignicons-webfont.ttf" + id: mdi_weather size: 80 glyphs: [ - '󰽡', # mdi-moon-first-quarter - '󰽢', # mdi-moon-full - '󰽣', # mdi-moon-last-quarter - '󰽤', # mdi-moon-new - '󰽥', # mdi-moon-waning-crescent - '󰽦', # mdi-moon-waning-gibbous - '󰽧', # mdi-moon-waxing-crescent - '󰽨', # mdi-moon-waxing-gibbous - '󰖔', # mdi-weather-night - '󰖐', # mdi-weather-cloudy - '󰖑', # mdi-weather-fog - '󰖒', # mdi-weather-hail - '󰖓', # mdi-weather-lightning - '󰙾', # mdi-weather-lightning-rainy - '󰖕', # mdi-weather-partly-cloudy - '󰖖', # mdi-weather-pouring - '󰖗', # mdi-weather-rainy - '󰖘', # mdi-weather-snowy - '󰙿', # mdi-weather-snowy-rainy - '󰖙', # mdi-weather-sunny - '󰖝', # mdi-weather-windy - '󰖞', # mdi-weather-windy-variant - '󰳥' # mdi-weather-exceptional + "󰽡", # mdi-moon-first-quarter + "󰽢", # mdi-moon-full + "󰽣", # mdi-moon-last-quarter + "󰽤", # mdi-moon-new + "󰽥", # mdi-moon-waning-crescent + "󰽦", # mdi-moon-waning-gibbous + "󰽧", # mdi-moon-waxing-crescent + "󰽨", # mdi-moon-waxing-gibbous + "󰖔", # mdi-weather-night + "󰖐", # mdi-weather-cloudy + "󰖑", # mdi-weather-fog + "󰖒", # mdi-weather-hail + "󰖓", # mdi-weather-lightning + "󰙾", # mdi-weather-lightning-rainy + "󰖕", # mdi-weather-partly-cloudy + "󰖖", # mdi-weather-pouring + "󰖗", # mdi-weather-rainy + "󰖘", # mdi-weather-snowy + "󰙿", # mdi-weather-snowy-rainy + "󰖙", # mdi-weather-sunny + "󰖝", # mdi-weather-windy + "󰖞", # mdi-weather-windy-variant + "󰳥", # mdi-weather-exceptional ] - - file: 'fonts/materialdesignicons-webfont.ttf' - id: mdi_wifi + - file: "fonts/materialdesignicons-webfont.ttf" + id: mdi_wifi size: 20 glyphs: [ - # WiFi - '󰤫', # mdi-wifi-strength-alert-outline - '󰤟', # mdi-wifi-strength-1 - '󰤢', # mdi-wifi-strength-2 - '󰤥', # mdi-wifi-strength-3 - '󰤨' # mdi-wifi-strength-4 + # WiFi + "󰤫", # mdi-wifi-strength-alert-outline + "󰤟", # mdi-wifi-strength-1 + "󰤢", # mdi-wifi-strength-2 + "󰤥", # mdi-wifi-strength-3 + "󰤨", # mdi-wifi-strength-4 ] - - file: 'fonts/materialdesignicons-webfont.ttf' - id: mdi_med + - file: "fonts/materialdesignicons-webfont.ttf" + id: mdi_med size: 60 glyphs: [ - '󰀦' # mdi-alert + "󰀦", # mdi-alert ] image: @@ -412,20 +741,29 @@ display: pages: - id: environment lambda: |- - + /* Outdoor */ float outdoor_temp = id(temp_outdoor).state; int outdoor_humid = int(id(humid_outdoor).state); float air_pressure = id(airpressure).state; float outdoor_radiation = id(radiation).state; + /* Living room */ float livingroom_temp = id(temp_livingroom).state; int livingroom_humid = int(id(humid_livingroom).state); - int livingroom_pm25 = int(id(pm25_livingroom).state); float livingroom_co2 = id(co2_livingroom).state; + int livingroom_pm25 = int(id(pm25_livingroom).state); + /* Serverroom */ + float serverroom_temp = id(temp_serverroom).state; + /* Sleeping room */ float sleepingroom_temp = id(temp_sleepingroom).state; int sleepingroom_humid = int(id(humid_sleepingroom).state); - int sleepingroom_pm25 = int(id(pm25_sleepingroom).state); float sleepingroom_co2 = id(co2_sleepingroom).state; - float serverroom_temp = id(temp_serverroom).state; + int sleepingroom_pm25 = int(id(pm25_sleepingroom).state); + /* Children's room */ + float childrensroom_temp = id(temp_childrensroom).state; + int childrensroom_humid = int(id(humid_childrensroom).state); + float childrensroom_co2 = id(co2_childrensroom).state; + int childrensroom_pm25 = int(id(pm25_childrensroom).state); + int offsetX = 0; int offsetY = 0; @@ -477,90 +815,89 @@ display: it.print(225, 130, id(sensor_unit), TextAlign::BASELINE_LEFT, "hPa"); } - /* Livingroom */ offsetY = 127; it.print(10, 10 + offsetY, id(sensor_unit), "Wohnzimmer"); - it.filled_rectangle(136, 21 + offsetY, 247, 3); + it.filled_rectangle(136, 21 + offsetY, 169, 3); it.print(10, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰮬"); // PM2.5 - it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer - it.print(375, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent + it.print(305, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer + it.print(305, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent it.print(10, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰟤"); // CO2 if(livingroom_temp > -100 && livingroom_temp < 100) { - it.printf(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", livingroom_temp); + it.printf(287, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", livingroom_temp); } else { - it.print(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC"); + it.print(287, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC"); } if(livingroom_humid >=0 && livingroom_humid <= 100) { - it.printf(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", livingroom_humid); + it.printf(287, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", livingroom_humid); } else { - it.print(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %"); + it.print(287, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %"); } if(livingroom_co2 >=380 && livingroom_co2 <= 20000) { - it.printf(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", livingroom_co2); - it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm"); + it.printf(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", livingroom_co2); + it.print(155, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm"); } else { - it.print(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); - it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³"); + it.print(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); + it.print(155, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³"); } if(livingroom_pm25 < 255 && livingroom_pm25 >=0) { - it.printf(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", livingroom_pm25); - it.print(225, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); + it.printf(150, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", livingroom_pm25); + it.print(155, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); } else { - it.print(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); - it.print(225, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); + it.print(150, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); + it.print(155, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); } /* Sleepingroom */ offsetY = 247; it.print(10, 10 + offsetY, id(sensor_unit), "Schlafzimmer"); - it.filled_rectangle(144, 21 + offsetY, 239, 3); - it.print(10, 124 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰮬"); // PM2.5 - it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer - it.print(375, 124 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent + it.filled_rectangle(144, 21 + offsetY, 161, 3); + it.print(10, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰮬"); // PM2.5 + it.print(305, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer + it.print(305, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent it.print(10, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰟤"); // CO2 if(sleepingroom_temp > -100 && sleepingroom_temp < 100) { - it.printf(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", sleepingroom_temp); + it.printf(287, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", sleepingroom_temp); } else { - it.print(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC"); + it.print(287, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC"); } if(sleepingroom_humid >=0 && sleepingroom_humid <= 100) { - it.printf(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", sleepingroom_humid); + it.printf(287, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", sleepingroom_humid); } else { - it.print(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %"); + it.print(287, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %"); } if(sleepingroom_co2 >=380 && sleepingroom_co2 <= 20000) { - it.printf(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", sleepingroom_co2); - it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm"); + it.printf(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", sleepingroom_co2); + it.print(155, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm"); } else { - it.print(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); - it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³"); + it.print(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); + it.print(155, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³"); } if(sleepingroom_pm25 < 255 && sleepingroom_pm25 >=0) { - it.printf(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", sleepingroom_pm25); - it.print(225, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); + it.printf(150, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", sleepingroom_pm25); + it.print(155, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); } else { - it.print(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); - it.print(225, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); + it.print(150, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); + it.print(155, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); } /* Weather */ @@ -571,7 +908,7 @@ display: /* Current weather */ if(id(weather).has_state()) { int x = 227 + offsetX; - int y = 116; + int y = 96; if (id(weather).state == "clear-night") { // clear night it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "󰖔"); @@ -642,7 +979,7 @@ display: /* Moon phase display */ if(id(moonphase).has_state()) { int x = 10 + offsetX; - int y = 116; + int y = 96; if (id(moonphase).state == "new_moon") { // new moon it.print(x, y, id(mdi_weather), TextAlign::BASELINE_LEFT, "󰽤"); @@ -682,30 +1019,66 @@ display: } } - /* Warnings */ - if(id(szco2).state == "rot" || id(szpm).state == "rot" || id(wzco2).state == "rot" || id(wzpm).state == "rot") { - it.print(10 + offsetX, 200, id(mdi_med), TextAlign::BASELINE_LEFT, "󰀦"); - it.print(80 + offsetX, 200, id(big_sensor_font), TextAlign::BASELINE_LEFT, "Lüften!"); + it.print(10 + offsetX, 130, id(mdi_small), TextAlign::BASELINE_LEFT, "󰖜"); // sun-up + it.printf(50 + offsetX, 130, id(sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_rising).state.c_str()); + it.print(135 + offsetX, 130, id(mdi_small), TextAlign::BASELINE_LEFT, "󰖛"); // sun-down + it.printf(175 + offsetX, 130, id(sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_setting).state.c_str()); + + /* Children's room */ + offsetX = 320; + offsetY = 127; + it.print(10 + offsetX, 10 + offsetY, id(sensor_unit), "Kinderzimmer"); + it.filled_rectangle(148 + offsetX, 21 + offsetY, 157, 3); + it.print(10 + offsetX, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰮬"); // PM2.5 + it.print(305 + offsetX, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer + it.print(305 + offsetX, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent + it.print(10 + offsetX, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰟤"); // CO2 + + if(childrensroom_temp > -100 && childrensroom_temp < 100) { + it.printf(287 + offsetX, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", childrensroom_temp); + } + else { + it.print(287 + offsetX, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC"); } - it.print(10 + offsetX, 250, id(mdi_small), TextAlign::BASELINE_LEFT, "󰖜"); // sun-up - it.printf(50 + offsetX, 250, id(sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_rising).state.c_str()); - it.print(135 + offsetX, 250, id(mdi_small), TextAlign::BASELINE_LEFT, "󰖛"); // sun-down - it.printf(175 + offsetX, 250, id(sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_setting).state.c_str()); + if(childrensroom_humid >=0 && childrensroom_humid <= 100) { + it.printf(287 + offsetX, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", childrensroom_humid); + } + else { + it.print(287 + offsetX, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %"); + } + + if(childrensroom_co2 >=380 && childrensroom_co2 <= 20000) { + it.printf(150 + offsetX, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", childrensroom_co2); + it.print(155 + offsetX, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm"); + } + else { + it.print(150 + offsetX, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); + it.print(155 + offsetX, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³"); + } + + if(childrensroom_pm25 < 255 && childrensroom_pm25 >=0) { + it.printf(150 + offsetX, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", childrensroom_pm25); + it.print(155 + offsetX, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); + } + else { + it.print(150 + offsetX, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); + it.print(155 + offsetX, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); + } /* Serverroom */ offsetY = 247; it.print(10 + offsetX, 10 + offsetY, id(sensor_unit), "Serverraum"); - it.filled_rectangle(125 + offsetX, 21 + offsetY, 110, 3); + it.filled_rectangle(125 + offsetX, 21 + offsetY, 180, 3); - it.print(227 + offsetX, 110 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer + it.print(305 + offsetX, 110 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer if(serverroom_temp > -100 && serverroom_temp < 100) { - it.printf(207 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "ºC"); - it.printf(170 + offsetX, 110 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f", serverroom_temp); + it.printf(287 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "ºC"); + it.printf(250 + offsetX, 110 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f", serverroom_temp); } else { - it.print(207 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC"); + it.print(287 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC"); } /* FOOTER */ @@ -737,6 +1110,88 @@ display: ESP_LOGI("WiFi", "Unlikely"); } } + - id: calendar + lambda: |- + /* Fetch today and tomorrow dates */ + auto now = id(homeassistant_time).now(); + int today_day = now.day_of_month; + int today_month = now.month; + int today_wday = now.day_of_week; // 0=Sunday .. 6=Saturday + const char* weekdays[] = {"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"}; + const char* today_weekday_str = weekdays[today_wday]; + int today_year = now.year; + + /* Tomorrow's date */ + int tomorrow_day = today_day + 1; + int tomorrow_month = today_month; + int tomorrow_wday = (today_wday + 1) % 7; + const char* tomorrow_weekday_str = weekdays[tomorrow_wday]; + int tomorrow_year = today_year; + + /* C1024 logo */ + it.image(10, 37, id(c1024_logo)); + + /* ── LEFT PANE: Today ── */ + int leftX = 0; + int leftY = 85; // start below header row + + it.print(10 + leftX, 10 + leftY, id(sensor_unit), "Heute"); + it.filled_rectangle(64 + leftX, 21 + leftY, 370, 3); + + /* Today's date strip */ + it.printf(50 + leftX, 50 + leftY, id(big_sensor_font), "%d", today_day); + it.printf(130 + leftX, 45 + leftY, id(sub_sensor_font), "%s.", today_weekday_str); + it.printf(160 + leftX, 45 + leftY, id(sensor_unit), "%02d.%04d.", today_month, today_year); + + /* Event placeholder row (top) */ + int eventOffsetY = 90; + it.print(10 + leftX, 50 + leftY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "󰀦"); + it.print(40 + leftX, 50 + leftY + eventOffsetY, id(sub_sensor_font), "Eintrag 1"); + + /* Event placeholder row (bottom) */ + it.print(10 + leftX, 85 + leftY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "󰀦"); + it.print(40 + leftX, 85 + leftY + eventOffsetY, id(sub_sensor_font), "Eintrag 2"); + + /* ── RIGHT PANE: Tomorrow ── */ + int rightX = 390; + int rightY = 85; + + it.print(10 + rightX, 10 + rightY, id(sensor_unit), "Morgen"); + it.filled_rectangle(64 + rightX, 21 + rightY, 370, 3); + + /* Date strip */ + it.printf(50 + rightX, 50 + rightY, id(big_sensor_font), "%d", tomorrow_day); + it.printf(130 + rightX, 45 + rightY, id(sub_sensor_font), "%s.", tomorrow_weekday_str); + it.printf(160 + rightX, 45 + rightY, id(sensor_unit), "%02d.%04d.", tomorrow_month, tomorrow_year); + + /* Event placeholder row (top) */ + it.print(10 + rightX, 50 + rightY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "󰀦"); + it.print(40 + rightX, 50 + rightY + eventOffsetY, id(sub_sensor_font), "Eintrag 1"); + + /* Event placeholder row (bottom) */ + it.print(10 + rightX, 85 + rightY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "󰀦"); + it.print(40 + rightX, 85 + rightY + eventOffsetY, id(sub_sensor_font), "Eintrag 2"); + + /* FOOTER */ + it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT, "Aktualisiert um %d.%m.%Y %H:%M", id(homeassistant_time).now()); + + /* WiFi Signal strength */ + if(id(wifisignal).has_state()) { + int x = 630; + int y = 384; + if (id(wifisignal).state >= -50) { + it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "󰤨"); + } else if (id(wifisignal).state >= -60) { + it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "󰤥"); + } else if (id(wifisignal).state >= -75) { + it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "󰤢"); + } else if (id(wifisignal).state >= -100) { + it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "󰤟"); + } else { + it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "󰤫"); + } + } + - id: power lambda: |- @@ -763,7 +1218,7 @@ display: offsetY = 127; it.print(10, 10 + offsetY, id(sensor_unit), "Wohnzimmer"); it.filled_rectangle(136, 21 + offsetY, 247, 3); - + it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰚥"); // power-plug it.print(375, 115 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰚥"); // power-plug @@ -834,7 +1289,7 @@ display: /* FOOTER */ it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT , "Aktualisiert um %d.%m.%Y %H:%M", id(homeassistant_time).now()); - /* WiFi Signal Strenght */ + /* WiFi Signal strength */ if(id(wifisignal).has_state()) { int x = 630; int y = 384;