Added Sleepingroom power sensor(s).

This commit is contained in:
Marcus Scholz 2022-04-09 23:55:48 +02:00
parent 4bfcc04fc5
commit 7f12efa1ba

View File

@ -168,6 +168,14 @@ sensor:
entity_id: sensor.wohnzimmer_heimkino_power entity_id: sensor.wohnzimmer_heimkino_power
id: media_livingroom id: media_livingroom
- platform: homeassistant
entity_id: sensor.schlafzimmer_bett_power
id: bedlight_sleepingroom
- platform: homeassistant
entity_id: sensor.schlafzimmer_heimkino_power
id: media_sleepingroom
text_sensor: text_sensor:
- platform: homeassistant - platform: homeassistant
name: "Sun Rising ESP" name: "Sun Rising ESP"
@ -643,10 +651,6 @@ display:
it.print(80 + offsetX, 200, id(big_sensor_font), TextAlign::BASELINE_LEFT, "Lüften!"); it.print(80 + offsetX, 200, id(big_sensor_font), TextAlign::BASELINE_LEFT, "Lüften!");
} }
/* ESP_LOGI("Sunrise: %s, Sunset: %s",
id(sun_rising).state.c_str(), id(sun_setting).state.c_str());
*/
it.print(10 + offsetX, 250, id(mdi_small), TextAlign::BASELINE_LEFT, "󰖜"); // sun-up 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.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.print(135 + offsetX, 250, id(mdi_small), TextAlign::BASELINE_LEFT, "󰖛"); // sun-down
@ -703,6 +707,7 @@ display:
float serverroom_power = id(power_serverroom).state; float serverroom_power = id(power_serverroom).state;
float livingroom_desk = id(desk_livingroom).state; float livingroom_desk = id(desk_livingroom).state;
float livingroom_media = id(media_livingroom).state; float livingroom_media = id(media_livingroom).state;
float sleepingroom = id(media_sleepingroom).state + id(bedlight_sleepingroom).state;
int offsetX = 0; int offsetX = 0;
int offsetY = 0; int offsetY = 0;
@ -725,6 +730,7 @@ display:
it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰚥"); // power-plug 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 it.print(375, 115 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰚥"); // power-plug
it.print(20, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "Schreibtisch");
if(livingroom_desk >= 0) { if(livingroom_desk >= 0) {
it.printf(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f W", livingroom_desk); it.printf(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f W", livingroom_desk);
} }
@ -732,6 +738,7 @@ display:
it.print(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W"); it.print(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W");
} }
it.print(20, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "Heimkino");
if(livingroom_media >= 0) { if(livingroom_media >= 0) {
it.printf(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f W", livingroom_media); it.printf(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f W", livingroom_media);
} }
@ -743,46 +750,17 @@ display:
offsetY = 247; offsetY = 247;
it.print(10, 10 + offsetY, id(sensor_unit), "Schlafzimmer"); it.print(10, 10 + offsetY, id(sensor_unit), "Schlafzimmer");
it.filled_rectangle(144, 21 + offsetY, 239, 3); it.filled_rectangle(144, 21 + offsetY, 239, 3);
/*
it.print(10, 114 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰮬"); // PM2.5
it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer
it.print(375, 115 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent
it.print(10, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰟤"); // CO2
it.print(375, 115 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰚥"); // power-plug
if(sleepingroom_temp > -100 && sleepingroom_temp < 100) { // it.print(20, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "Heimkino");
it.printf(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", sleepingroom_temp); if(sleepingroom >= 0) {
it.printf(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f W", sleepingroom);
} }
else { else {
it.print(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC"); it.print(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W");
} }
if(sleepingroom_humid >=0 && sleepingroom_humid <= 100) {
it.printf(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", sleepingroom_humid);
}
else {
it.print(357, 115 + 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");
}
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³");
}
if(sleepingroom_pm25 < 255 && sleepingroom_pm25 >=0) {
it.printf(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", sleepingroom_pm25);
it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
}
else {
it.print(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
}
*/
/* LINEPOWER */ /* LINEPOWER */
offsetX = 390; offsetX = 390;
offsetY = 65; offsetY = 65;