Removed DHT22, replaced airpressure with value from HA. Remade serverroom representation.

This commit is contained in:
Marcus Scholz 2021-12-31 01:03:51 +01:00
parent 569349c63e
commit 9feaeaf265

View File

@ -68,16 +68,6 @@ binary_sensor:
# DHT22 sensor # DHT22 sensor
sensor: sensor:
- platform: dht
model: dht22
pin: 22
temperature:
name: "Temperatur"
id: temp_serverroom
humidity:
name: "Luftfeuchtigkeit"
id: humid_serverroom
update_interval: 60s
# WiFi signal strength # WiFi signal strength
- platform: wifi_signal - platform: wifi_signal
@ -126,9 +116,13 @@ sensor:
id: humid_outdoor id: humid_outdoor
- platform: homeassistant - platform: homeassistant
entity_id: sensor.schlafzimmer_luftdruck entity_id: sensor.luftdruck
id: airpressure id: airpressure
- platform: homeassistant
entity_id: sensor.serveraum_temperatur
id: temp_serverroom
text_sensor: text_sensor:
- platform: homeassistant - platform: homeassistant
entity_id: sun.sun entity_id: sun.sun
@ -321,7 +315,6 @@ display:
int sleepingroom_pm25 = int(id(pm25_sleepingroom).state); int sleepingroom_pm25 = int(id(pm25_sleepingroom).state);
float sleepingroom_co2 = id(co2_sleepingroom).state; float sleepingroom_co2 = id(co2_sleepingroom).state;
float serverroom_temp = id(temp_serverroom).state; float serverroom_temp = id(temp_serverroom).state;
int serverroom_humid = id(humid_serverroom).state;
char sunrise[5] = ""; char sunrise[5] = "";
char sunset[5] = ""; char sunset[5] = "";
int offsetX = 0; int offsetX = 0;
@ -610,24 +603,18 @@ display:
it.print(10 + offsetX, 10 + offsetY, id(sensor_unit), "Serverraum"); 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, 110, 3);
it.print(227 + offsetX, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer /* it.print(227 + offsetX, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer
it.print(227+ offsetX, 115 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent * it.print(227+ offsetX, 115 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent */
it.print(227 + offsetX, 110 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer
if(serverroom_temp > -100 && serverroom_temp < 100) { if(serverroom_temp > -100 && serverroom_temp < 100) {
it.printf(207 + offsetX, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", serverroom_temp); 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);
} }
else { else {
it.print(207 + offsetX, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC"); it.print(207 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
} }
if(serverroom_humid >=0 && serverroom_humid <= 100) {
it.printf(207 + offsetX, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", serverroom_humid);
}
else {
it.print(207 + offsetX, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %");
}
/* FOOTER */ /* FOOTER */
it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT , "Aktualisiert um %d.%m.%Y %H:%M", id(homeassistant_time).now()); it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT , "Aktualisiert um %d.%m.%Y %H:%M", id(homeassistant_time).now());