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:
ssid: "Voltage-legacy"
password: !secret voltage_legacy_psk
use_address: epaperframe.home
use_address: epaperframe.home
power_save_mode: high
fast_connect: on
@ -28,7 +28,7 @@ logger:
# Enable Home Assistant API
api:
password: !secret api
# encryption:
# encryption:
# key: !secret apikey
ota:
@ -68,31 +68,21 @@ binary_sensor:
# DHT22 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
- platform: wifi_signal
name: "WiFi Signalstärke"
id: wifisignal
update_interval: 60s
- platform: homeassistant
entity_id: sensor.wohnzimmer_feinstaub_pm_2_5um
entity_id: sensor.wohnzimmer_feinstaub_pm_2_5um
id: pm25_livingroom
- platform: homeassistant
entity_id: sensor.wohnzimmer_temperatur
id: temp_livingroom
- platform: homeassistant
entity_id: sensor.wohnzimmer_luftfeuchtigkeit
id: humid_livingroom
@ -102,13 +92,13 @@ sensor:
id: co2_livingroom
- platform: homeassistant
entity_id: sensor.feinstaub_pm_2_5um
entity_id: sensor.feinstaub_pm_2_5um
id: pm25_sleepingroom
- platform: homeassistant
entity_id: sensor.schlafzimmer_temperatur
id: temp_sleepingroom
- platform: homeassistant
entity_id: sensor.schlafzimmer_luftfeuchtigkeit
id: humid_sleepingroom
@ -116,19 +106,23 @@ sensor:
- platform: homeassistant
entity_id: sensor.schlafzimmer_co2
id: co2_sleepingroom
- platform: homeassistant
entity_id: sensor.temperatur_aussen
id: temp_outdoor
- platform: homeassistant
entity_id: sensor.luftfeuchtigkeit_aussen
id: humid_outdoor
- platform: homeassistant
entity_id: sensor.schlafzimmer_luftdruck
entity_id: sensor.luftdruck
id: airpressure
- platform: homeassistant
entity_id: sensor.serveraum_temperatur
id: temp_serverroom
text_sensor:
- platform: homeassistant
entity_id: sun.sun
@ -206,7 +200,7 @@ font:
'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',
'u', 'v', 'w', 'x', 'y', 'z', 'å', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß']
- file: 'fonts/Roboto-Medium.ttf'
id: sub_sensor_font
size: 30
@ -217,11 +211,11 @@ font:
'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',
'u', 'v', 'w', 'x', 'y', 'z', 'å', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß']
- file: 'fonts/Roboto-Bold.ttf'
id: big_sensor_font
size: 50
- file: 'fonts/materialdesignicons-webfont.ttf'
id: mdi_small
size: 31
@ -306,9 +300,9 @@ display:
pages:
- id: environment
lambda: |-
int pm25_danger_thres = 40;
float outdoor_temp = id(temp_outdoor).state;
int outdoor_humid = int(id(humid_outdoor).state);
float air_pressure = id(airpressure).state;
@ -321,7 +315,6 @@ display:
int sleepingroom_pm25 = int(id(pm25_sleepingroom).state);
float sleepingroom_co2 = id(co2_sleepingroom).state;
float serverroom_temp = id(temp_serverroom).state;
int serverroom_humid = id(humid_serverroom).state;
char sunrise[5] = "";
char sunset[5] = "";
int offsetX = 0;
@ -382,7 +375,7 @@ display:
else {
it.print(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "hPa");
}
}
/* Livingroom */
@ -393,7 +386,7 @@ display:
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
if(livingroom_temp > -100 && livingroom_temp < 100) {
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, 115 + 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);
@ -474,7 +467,7 @@ display:
else {
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³");
}
}
/* Weather */
offsetX = 390;
@ -610,27 +603,21 @@ display:
it.print(10 + offsetX, 10 + offsetY, id(sensor_unit), "Serverraum");
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, 115 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent
/* 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, 110 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer
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 {
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 */
it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT , "Aktualisiert um %d.%m.%Y %H:%M", id(homeassistant_time).now());
/* WiFi Signal Strenght */
if(id(wifisignal).has_state()) {
int x = 630;