Here you go.
It’s a busy screen…
esphome:
name: 42-e-paper
platform: ESP8266
board: nodemcuv2
time:
- platform: homeassistant
id: esptime
on_time:
- seconds: 0
then:
- if:
condition:
- binary_sensor.is_on: display_activation
then:
- component.update: epaper
sensor:
- platform: homeassistant
entity_id: sensor.netatmo_home_weather_station_outdoor_module_temperature
internal: true
id: outdoor_temperature
unit_of_measurement: "°"
- platform: homeassistant
entity_id: sensor.philips_airpurifier_temperature
internal: true
id: bedroom_temperature
unit_of_measurement: "°"
- platform: homeassistant
entity_id: sensor.netatmo_home_weather_station_outdoor_module_humidity
internal: true
id: outdoor_humidity
unit_of_measurement: "%"
- platform: homeassistant
entity_id: sensor.philips_airpurifier_humidity
internal: true
id: bedroom_humidity
unit_of_measurement: "%"
- platform: homeassistant
entity_id: sensor.philips_airpurifier_indoor_allergen_index
internal: true
id: bedroom_indoor_allergen_index
- platform: homeassistant
entity_id: sensor.philips_airpurifier_pm25
internal: true
id: bedroom_pm25
unit_of_measurement: "µg/m³"
- platform: homeassistant
entity_id: sensor.bedroom_absolutehumidity
id: bedroom_absolutehumidity
internal: true
unit_of_measurement: "g/m³"
- platform: homeassistant
entity_id: sensor.outdoor_absolutehumidity
id: outdoor_absolutehumidity
internal: true
unit_of_measurement: "g/m³"
- platform: wifi_signal
name: "WiFi Signal 4.2 e-paper"
id: wifi_signal_epaper_4_2
update_interval: 600s
- platform: mhz19
co2:
name: "MH-Z19 CO2 Value"
id: co2_epaper_4_2
temperature:
name: "MH-Z19 Temperature"
id: temperature_epaper_4_2
device_class: "temperature"
update_interval: 300s
id: mhz19_epaper_4_2
automatic_baseline_calibration: false
binary_sensor:
- platform: homeassistant
name: "e-paper display activation"
entity_id: group.e_paper_display_activation
id: display_activation
internal: true
switch:
- platform: template
name: "MH-Z19 ABC"
optimistic: true
on_turn_on:
mhz19.abc_enable: mhz19_epaper_4_2
on_turn_off:
mhz19.abc_disable: mhz19_epaper_4_2
uart:
rx_pin: D7
tx_pin: D8
baud_rate: 9600
font:
- file: 'fonts/Kanit-Medium.ttf'
id: font_medium_20
size: 20
glyphs:
['&', '@', '!', ',', '.', '"', '%', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', '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', ' ', '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/Kanit-Regular.ttf'
id: font_regular_65
size: 65
glyphs:
['!', ',', '.', '"', '%', '-', '_', ':', '°', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ']
- file: 'fonts/Google_Sans_Medium.ttf'
id: font_regular_30
size: 30
glyphs:
['!', ',', '.', '"', '%', '-', '_', ':', '°', '/', 'm', 'p', 'g', '³', "\U000000B5",
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ']
- file: 'fonts/materialdesignicons-webfont.ttf'
id: icon_font_40
size: 40
glyphs: [
"\U000F050F", # mdi-thermometer
"\U000F058E", # mdi-water-percent
"\U000F07E4", # mdi-molecule-co2
"\U000F0D08", # mdi-flower-poppy
"\U000F020F", # mdi-factory
]
# Display 400px x 300px
spi:
clk_pin: D5
mosi_pin: D6
display:
- platform: waveshare_epaper
id: epaper
cs_pin: D4
dc_pin: D3
busy_pin: D1
reset_pin: D2
model: 4.20in
rotation: 90°
update_interval: never
lambda: |-
it.print(5, 15, id(font_medium_20), TextAlign::BASELINE_LEFT, "Bedroom");
it.line(94, 14, 293, 14);
it.print(44, 80, id(icon_font_40), TextAlign::BASELINE_RIGHT, "\U000F050F");
if (id(bedroom_temperature).has_state()) {
it.printf(45, 82, id(font_regular_65), TextAlign::BASELINE_LEFT, "%2.0f°", id(bedroom_temperature).state);
}
it.print(157, 80, id(icon_font_40), TextAlign::BASELINE_LEFT, "\U000F058E");
if (id(bedroom_humidity).has_state()) {
it.printf(265, 82, id(font_regular_65), TextAlign::BASELINE_RIGHT, "%2.0f", id(bedroom_humidity).state);
it.print(270, 82, id(font_regular_30), TextAlign::BASELINE_LEFT, "%");
}
if (id(bedroom_absolutehumidity).state > id(outdoor_absolutehumidity).state) {
it.line(159, 82, 193, 82);
it.line(159, 83, 193, 83);
it.line(159, 84, 193, 84);
} else {
it.line(159, 321, 193, 321);
it.line(159, 322, 193, 322);
it.line(159, 323, 193, 323);
}
it.print(5, 150, id(icon_font_40), TextAlign::BASELINE_LEFT, "\U000F07E4");
if (id(co2_epaper_4_2).has_state()) {
it.printf(185, 152, id(font_regular_65), TextAlign::BASELINE_RIGHT, "%4.0f", id(co2_epaper_4_2).state);
it.print(190, 150, id(font_regular_30), TextAlign::BASELINE_LEFT, "ppm");
}
it.print(5, 220, id(icon_font_40), TextAlign::BASELINE_LEFT, "\U000F020F");
if (id(bedroom_pm25).has_state()) {
it.printf(100, 220, id(font_regular_65), TextAlign::BASELINE_RIGHT, "%2.0f", id(bedroom_pm25).state);
it.print(105, 220, id(font_regular_30), TextAlign::BASELINE_LEFT, "\U000000B5g/m³");
}
it.print(200, 220, id(icon_font_40), TextAlign::BASELINE_LEFT, "\U000F0D08");
if (id(bedroom_indoor_allergen_index).has_state()) {
it.printf(220, 220, id(font_regular_65), TextAlign::BASELINE_LEFT, "%2.0f", id(bedroom_indoor_allergen_index).state);
}
it.print(5, 250, id(font_medium_20), TextAlign::BASELINE_LEFT, "Outside");
it.line(85, 249, 293, 249);
it.print(44, 315, id(icon_font_40), TextAlign::BASELINE_RIGHT, "\U000F050F");
if (id(outdoor_temperature).has_state()) {
it.printf(45, 317, id(font_regular_65), TextAlign::BASELINE_LEFT, "%.1f°", id(outdoor_temperature).state);
}
it.print(157, 319, id(icon_font_40), TextAlign::BASELINE_LEFT, "\U000F058E");
if (id(outdoor_humidity).has_state()) {
it.printf(265, 317, id(font_regular_65), TextAlign::BASELINE_RIGHT, "%2.0f", id(outdoor_humidity).state);
it.print(270, 317, id(font_regular_30), TextAlign::BASELINE_LEFT, "%");
}
it.line(5, 336, 295, 336);
it.line(5, 337, 295, 337);
it.strftime(7, 363, id(font_medium_20), TextAlign::BASELINE_LEFT, "%A", id(esptime).now());
it.strftime(7, 393, id(font_medium_20), TextAlign::BASELINE_LEFT, "%d %b. %y", id(esptime).now());
it.strftime(290, 393, id(font_regular_65), TextAlign::BASELINE_RIGHT, "%H:%M", id(esptime).now());