Expand and realign e-paper dashboard layout. Add children's rooms
values.
This commit is contained in:
+87
-51
@@ -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:
|
||||
@@ -775,10 +775,10 @@ display:
|
||||
float sleepingroom_co2 = id(co2_sleepingroom).state;
|
||||
int sleepingroom_pm25 = int(id(pm25_sleepingroom).state);
|
||||
/* Children's room */
|
||||
float childrensroom_temp = id(temp_sleepingroom).state;
|
||||
int childrensroom_humid = int(id(humid_sleepingroom).state);
|
||||
float childrensroom_co2 = id(co2_sleepingroom).state;
|
||||
int childrensroom_pm25 = int(id(pm25_sleepingroom).state);
|
||||
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;
|
||||
@@ -834,86 +834,86 @@ display:
|
||||
/* 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 */
|
||||
@@ -924,7 +924,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, "");
|
||||
@@ -995,7 +995,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, "");
|
||||
@@ -1035,30 +1035,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, 125, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // sun-up
|
||||
it.printf(50 + offsetX, 125, id(sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_rising).state.c_str());
|
||||
it.print(135 + offsetX, 125, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // sun-down
|
||||
it.printf(175 + offsetX, 125, 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 */
|
||||
|
||||
Reference in New Issue
Block a user