From 313037040e1eb4aca0d73fcd4b9a2318042166fc Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Fri, 8 Oct 2021 18:14:51 +0200 Subject: [PATCH] Reorganized Umwelt-Panel. --- esphome/epaperframe.yaml | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/esphome/epaperframe.yaml b/esphome/epaperframe.yaml index f368cd4..1f07209 100644 --- a/esphome/epaperframe.yaml +++ b/esphome/epaperframe.yaml @@ -28,8 +28,8 @@ logger: # Enable Home Assistant API api: password: !secret api - encryption: - key: !secret apikey +# encryption: +# key: !secret apikey ota: password: !secret ota @@ -274,7 +274,7 @@ display: /* OUTSIDE */ it.print(10, 10, id(big_sensor_unit), "Umwelt"); // Draw the outline of a rectangle with the top left at [78,21], a width of 305 and a height of 3 - it.filled_rectangle(78, 21, 305, 3); + it.filled_rectangle(86, 21, 297, 3); if(id(sun_state).has_state()) { ESP_LOGI("Sun", "State of the sun: %s", id(sun_state).state.c_str()); ESP_LOGD("Sun", "Sunset: %s", id(sun_set).state.c_str()); @@ -284,9 +284,9 @@ display: //if(id(sun_state).state == "above_horizon") { it.print(10, 75, id(mdi_small), TextAlign::BASELINE_LEFT, "󰖜"); //sun-up - it.printf(50, 75, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "%s", id(sun_rise).state.c_str()); + it.printf(50, 75, id(big_sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_rise).state.c_str()); it.print(135, 75, id(mdi_small), TextAlign::BASELINE_LEFT, "󰖛"); //sun-down - it.printf(175, 75, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "%s", id(sun_set).state.c_str()); + it.printf(175, 75, id(big_sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_set).state.c_str()); //it.strftime(50, 75, id(footer_font), TextAlign::BASELINE_LEFT, "Nächster Sonnenuntergang %d.%m.%Y %H:%M", id(sun_set).state.c_str()); //} //else { @@ -294,7 +294,7 @@ display: //it.strftime(50, 75, id(footer_font), TextAlign::BASELINE_LEFT, "Nächster Sonnenaufgang %d.%m.%Y %H:%M", id(sun_rise)); //} } - it.print(10, 115, id(mdi_small), TextAlign::BASELINE_LEFT, "󰊚"); //air-pressure + it.print(250, 115, id(mdi_small), TextAlign::BASELINE_CENTER, "󰊚"); //air-pressure it.print(375, 75, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); //thermometer it.print(375, 115, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); //water-percent @@ -313,50 +313,51 @@ display: } if(air_pressure < 1200 && air_pressure >=800) { //Has valid value - it.printf(50, 115, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "%4.1fhPa", air_pressure); + it.printf(228, 115, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%4.1fhPa", air_pressure); } else { //Invalid or error value - it.print(50, 115, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "- hPa"); + it.print(228, 115, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "- hPa"); } /* Moon phase display */ if(id(moonphase).has_state()) { - int x = 526; - int y = 276; + int x = 10; + int y = 116; if (id(moonphase).state == "new_moon") { // new moon - it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "󰽤"); + it.print(x, y, id(mdi_small), TextAlign::BASELINE_LEFT, "󰽤"); ESP_LOGI("Moonphase", "new moon"); } else if (id(moonphase).state == "waxing_crescent") { // waxing crescent - it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "󰽧"); + it.print(x, y, id(mdi_small), TextAlign::BASELINE_LEFT, "󰽧"); ESP_LOGI("Moonphase", "waxing crescent"); } else if (id(moonphase).state == "first_quarter") { // first_quarter - it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "󰽡"); + it.print(x, y, id(mdi_small), TextAlign::BASELINE_LEFT, "󰽡"); ESP_LOGI("Moonphase", "first quarter"); } else if (id(moonphase).state == "waxing_gibbous") { // waxing gibbous - it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "󰽨"); + it.print(x, y, id(mdi_small), TextAlign::BASELINE_LEFT, "󰽨"); ESP_LOGI("Moonphase", "waxing gibbous"); } else if (id(moonphase).state == "full_moon") { // full moon - it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "󰽢"); + it.print(x, y, id(mdi_small), TextAlign::BASELINE_LEFT, "󰽢"); ESP_LOGI("Moonphase", "full moon"); } else if (id(moonphase).state == "waning_gibbous") { // waning gibbous - it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "󰽦"); + it.print(x, y, id(mdi_small), TextAlign::BASELINE_LEFT, "󰽦"); ESP_LOGI("Moonphase", "waning gibbous"); } else if (id(moonphase).state == "last_quarter") { // last quarter - it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "󰽣"); + it.print(x, y, id(mdi_small), TextAlign::BASELINE_LEFT, "󰽣"); ESP_LOGI("Moonphase", "last quarter"); } else if (id(moonphase).state == "waning_crescent") { // waning crescent - it.print(x, y, id(mdi_small), TextAlign::BASELINE_CENTER, "󰽥"); + it.print(x, y, id(mdi_small), TextAlign::BASELINE_LEFT, "󰽥"); ESP_LOGI("Moonphase", "waning crescent"); } else { // N/A + it.print(x, y, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "-"); ESP_LOGE("Moonphase", "No data"); } }