Added geigercounter and display it on epaperframe.

This commit is contained in:
2022-11-05 23:47:51 +01:00
parent ee17ed1e3a
commit b0aa7991f9
2 changed files with 98 additions and 13 deletions

View File

@@ -175,6 +175,10 @@ sensor:
- platform: homeassistant
entity_id: sensor.schlafzimmer_heimkino_power
id: media_sleepingroom
- platform: homeassistant
entity_id: sensor.radioaktive_strahlungsleistung
id: radiation
text_sensor:
- platform: homeassistant
@@ -312,7 +316,8 @@ font:
'󰴾', # mdi-transmission-tower
'󰚥', # mdi-power-plug
'󱈹', # mdi-desk
'󰔂' # mdi-television
'󰔂', # mdi-television
'󰐼' # mdi-radiation
]
- file: 'fonts/materialdesignicons-webfont.ttf'
@@ -390,6 +395,7 @@ display:
float outdoor_temp = id(temp_outdoor).state;
int outdoor_humid = int(id(humid_outdoor).state);
float air_pressure = id(airpressure).state;
float outdoor_radiation = id(radiation).state;
float livingroom_temp = id(temp_livingroom).state;
int livingroom_humid = int(id(humid_livingroom).state);
int livingroom_pm25 = int(id(pm25_livingroom).state);
@@ -413,31 +419,41 @@ display:
/* C1024 logo */
it.image(10 , 37, id(c1024_logo));
it.print(10, 115, id(mdi_small), TextAlign::BASELINE_LEFT, "󰊚"); // air pressure icon
it.print(375, 75, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer icon
it.print(375, 115, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent icon
it.print(10, 120, id(mdi_small), TextAlign::BASELINE_LEFT, "󰊚"); // air pressure icon
it.print(375, 80, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer icon
it.print(375, 120, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent icon
it.print(95, 80, id(mdi_small), TextAlign::BASELINE_LEFT, "󰐼"); // radioactive icon
if(outdoor_temp > -100 && outdoor_temp < 100) {
it.printf(357, 75, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", outdoor_temp);
if(outdoor_radiation > 0 && outdoor_radiation < 100) {
it.printf(200, 80, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.2f", outdoor_radiation);
it.print(205, 80, id(sensor_unit), TextAlign::BASELINE_LEFT, "µS/h");
}
else {
it.print(357, 75, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
it.print(200, 80, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ");
it.print(205, 80, id(sensor_unit), TextAlign::BASELINE_LEFT, "µS/h");
}
if(outdoor_temp > -100 && outdoor_temp < 100) {
it.printf(357, 80, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", outdoor_temp);
}
else {
it.print(357, 80, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
}
if(outdoor_humid >=0 && outdoor_humid <= 100) {
it.printf(357, 115, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", outdoor_humid);
it.printf(357, 120, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", outdoor_humid);
}
else {
it.print(357, 115, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %");
it.print(357, 120, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %");
}
if(air_pressure < 1200 && air_pressure >=800) {
it.printf(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.1f", air_pressure);
it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "hPa");
it.printf(220, 120, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.1f", air_pressure);
it.print(225, 120, id(sensor_unit), TextAlign::BASELINE_LEFT, "hPa");
}
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");
it.print(220, 120, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(225, 120, id(sensor_unit), TextAlign::BASELINE_LEFT, "hPa");
}