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

@ -11,7 +11,7 @@ esphome:
wifi: wifi:
ssid: "Voltage-legacy" ssid: "Voltage-legacy"
password: !secret voltage_legacy_psk password: !secret voltage_legacy_psk
use_address: epaperframe.home use_address: epaperframe.home
power_save_mode: high power_save_mode: high
fast_connect: on fast_connect: on
@ -28,7 +28,7 @@ logger:
# Enable Home Assistant API # Enable Home Assistant API
api: api:
password: !secret api password: !secret api
# encryption: # encryption:
# key: !secret apikey # key: !secret apikey
ota: ota:
@ -68,31 +68,21 @@ 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
name: "WiFi Signalstärke" name: "WiFi Signalstärke"
id: wifisignal id: wifisignal
update_interval: 60s update_interval: 60s
- platform: homeassistant - platform: homeassistant
entity_id: sensor.wohnzimmer_feinstaub_pm_2_5um entity_id: sensor.wohnzimmer_feinstaub_pm_2_5um
id: pm25_livingroom id: pm25_livingroom
- platform: homeassistant - platform: homeassistant
entity_id: sensor.wohnzimmer_temperatur entity_id: sensor.wohnzimmer_temperatur
id: temp_livingroom id: temp_livingroom
- platform: homeassistant - platform: homeassistant
entity_id: sensor.wohnzimmer_luftfeuchtigkeit entity_id: sensor.wohnzimmer_luftfeuchtigkeit
id: humid_livingroom id: humid_livingroom
@ -102,13 +92,13 @@ sensor:
id: co2_livingroom id: co2_livingroom
- platform: homeassistant - platform: homeassistant
entity_id: sensor.feinstaub_pm_2_5um entity_id: sensor.feinstaub_pm_2_5um
id: pm25_sleepingroom id: pm25_sleepingroom
- platform: homeassistant - platform: homeassistant
entity_id: sensor.schlafzimmer_temperatur entity_id: sensor.schlafzimmer_temperatur
id: temp_sleepingroom id: temp_sleepingroom
- platform: homeassistant - platform: homeassistant
entity_id: sensor.schlafzimmer_luftfeuchtigkeit entity_id: sensor.schlafzimmer_luftfeuchtigkeit
id: humid_sleepingroom id: humid_sleepingroom
@ -116,19 +106,23 @@ sensor:
- platform: homeassistant - platform: homeassistant
entity_id: sensor.schlafzimmer_co2 entity_id: sensor.schlafzimmer_co2
id: co2_sleepingroom id: co2_sleepingroom
- platform: homeassistant - platform: homeassistant
entity_id: sensor.temperatur_aussen entity_id: sensor.temperatur_aussen
id: temp_outdoor id: temp_outdoor
- platform: homeassistant - platform: homeassistant
entity_id: sensor.luftfeuchtigkeit_aussen entity_id: sensor.luftfeuchtigkeit_aussen
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
@ -206,7 +200,7 @@ font:
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f', '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', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z', 'å', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß'] 'u', 'v', 'w', 'x', 'y', 'z', 'å', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß']
- file: 'fonts/Roboto-Medium.ttf' - file: 'fonts/Roboto-Medium.ttf'
id: sub_sensor_font id: sub_sensor_font
size: 30 size: 30
@ -217,11 +211,11 @@ font:
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f', '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', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z', 'å', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß'] 'u', 'v', 'w', 'x', 'y', 'z', 'å', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß']
- file: 'fonts/Roboto-Bold.ttf' - file: 'fonts/Roboto-Bold.ttf'
id: big_sensor_font id: big_sensor_font
size: 50 size: 50
- file: 'fonts/materialdesignicons-webfont.ttf' - file: 'fonts/materialdesignicons-webfont.ttf'
id: mdi_small id: mdi_small
size: 31 size: 31
@ -306,9 +300,9 @@ display:
pages: pages:
- id: environment - id: environment
lambda: |- lambda: |-
int pm25_danger_thres = 40; int pm25_danger_thres = 40;
float outdoor_temp = id(temp_outdoor).state; float outdoor_temp = id(temp_outdoor).state;
int outdoor_humid = int(id(humid_outdoor).state); int outdoor_humid = int(id(humid_outdoor).state);
float air_pressure = id(airpressure).state; float air_pressure = id(airpressure).state;
@ -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;
@ -382,7 +375,7 @@ display:
else { else {
it.print(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); it.print(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "hPa"); it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "hPa");
} }
/* Livingroom */ /* Livingroom */
@ -393,7 +386,7 @@ display:
it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer 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(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(10, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰟤"); // CO2
if(livingroom_temp > -100 && livingroom_temp < 100) { 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(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", livingroom_temp);
@ -439,7 +432,7 @@ display:
it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer 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(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(10, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰟤"); // CO2
if(sleepingroom_temp > -100 && sleepingroom_temp < 100) { 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(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", sleepingroom_temp);
@ -474,7 +467,7 @@ display:
else { else {
it.print(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); it.print(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(205, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); it.print(205, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
} }
/* Weather */ /* Weather */
offsetX = 390; offsetX = 390;
@ -610,27 +603,21 @@ 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());
/* WiFi Signal Strenght */ /* WiFi Signal Strenght */
if(id(wifisignal).has_state()) { if(id(wifisignal).has_state()) {
int x = 630; int x = 630;