<!-- Thanks for reporting a bug for this project. READ THIS FIRST:
- Provide …as many details as possible. Simply saying "X gives bug" or "X gives error" is not enough!
- Paste logs, configuration sample and code into the backticks (```).
- Read through the template carefully and fill out all missing details.
- Please also search for similar issues in this issue tracker first and read through the ESPHome FAQ.
DO NOT DELETE ANY TEXT from this template! Otherwise the issue may be closed without a comment.
-->
**Operating environment/Installation (Hass.io/Docker/pip/etc.):**
<!--
Please provide details about your environment below this line. -->
Hass.io
**ESP (ESP32/ESP8266, Board/Sonoff):**
<!--
Please provide details about which ESP you're using below.
-->
ESP32 Waveshare Driver Board
**ESPHome version (latest production, beta, dev branch)**
<!--
ESPHome version like v1.14 or 1.15-dev
-->
1.19.4
**Affected component:**
<!--
Please add the link to the documentation at https://esphome.io/index.html of the component in question.
-->
Waveshare e-paper display
https://esphome.io/components/display/waveshare_epaper.html
**Description of problem:**
All items on a Waveshare 7.5in V2 e-paper display (black & white) go dim and grainy if the items to be displayed include horizontal lines, rectangles or filled rectangles. The wider the line or rectangle, the more marked the effect is. Other shapes or text do not cause the issue.
Below is example code that has the issue. If I comment out the "it.filled_rectangle" lines in the code, then the text on screen becomes crisp and clear, but if the rectangles are included, when the screen refreshes, for a split second on refresh it is clear but the black 'ink' dims out instantly. The issue is exactly the same if I use "it.line" or "it.rectangle" of similar dimensions.
If I only use very short horizontal lines or rectangles then the issue is less noticeable, but for long horizontal lines and rectangles the entire display goes dim.
![IMG_1899](https://user-images.githubusercontent.com/80922293/124382920-bba6c600-dcc1-11eb-8523-e04e4189150c.jpg)
**Problem-relevant YAML-configuration entries:**
```yaml
esphome:
name: cabin-epaper
platform: ESP32
board: esp32dev
on_boot:
priority: -10
then:
- delay: 10s
- component.update: epaperdisplay
wifi:
networks:
- ssid: [removed]
password: [removed]
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: [removed]
font:
- file: 'fonts/Roboto-Regular.ttf'
id: footer_font
size: 15
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/Roboto-Regular.ttf'
id: main_sensor_unit
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/Roboto-Bold.ttf'
id: main_sensor_font
size: 54
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/materialdesignicons-webfont.ttf'
id: mdi_wifi
size: 20
glyphs: [
# Wifi
'', # mdi-wifi-strength-alert-outline
'', # mdi-wifi-strength-1
'', # mdi-wifi-strength-2
'', # mdi-wifi-strength-3
'' # mdi-wifi-strength-4
]
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: wifi_signal
name: "WiFi Signal Sensor"
id: wifisignal
update_interval: 60s
spi:
clk_pin: 13 #SCK
mosi_pin: 14 #DIN
display:
- platform: waveshare_epaper
id: epaperdisplay
cs_pin: 15
dc_pin: 27
busy_pin: 25
reset_pin: 26
update_interval: 600s
model: 7.50inV2
lambda: |-
static const char* TAG = "epaperdisplay";
ESP_LOGD(TAG, "Writing to e-ink display");
it.print(775, 17, id(main_sensor_unit), TextAlign::BASELINE_RIGHT, "E-Paper is awesome!");
it.print(0, 460, id(main_sensor_unit), "E-Paper is awesome!");
/* TOP */
it.print(10, 10, id(main_sensor_unit), "TOP");
it.filled_rectangle(98, 21, 400, 3);
it.print(15, 60, id(main_sensor_font), "Test 1");
/* MIDDLE */
int offsetY = 200;
it.print(10, 10 + offsetY, id(main_sensor_unit), "MIDDLE");
it.filled_rectangle(98, 21 + offsetY, 500, 3);
it.print(400, 80 + offsetY, id(main_sensor_font), TextAlign::BASELINE_CENTER, "Test 2");
/* BOTTOM */
int offsetYb = 360;
it.print(10, 10 + offsetYb, id(main_sensor_unit), "BOTTOM");
it.filled_rectangle(98, 21 + offsetYb, 600, 3);
it.print(775, 80 + offsetYb, id(main_sensor_font), TextAlign::BASELINE_RIGHT, "Test 3");
/* FOOTERT */
it.strftime(755, 475 , id(footer_font), TextAlign::BASELINE_RIGHT , "Updated at %d/%b/%Y %H:%M", id(homeassistant_time).now());
/* WiFi Signal Strenght */
if(id(wifisignal).has_state()) {
int x = 775;
int y = 475;
if (id(wifisignal).state >= -50) {
//Excellent
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
ESP_LOGI("WiFi", "Exellent");
} else if (id(wifisignal).state >= -60) {
//Good
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
ESP_LOGI("WiFi", "Good");
} else if (id(wifisignal).state >= -75) {
//Fair
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
ESP_LOGI("WiFi", "Fair");
} else if (id(wifisignal).state >= -100) {
//Weak
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
ESP_LOGI("WiFi", "Weak");
} else {
//Unlikely working signal
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
ESP_LOGI("WiFi", "Unlikely");
}
}
```
**Logs (if applicable):**
<!--
Please copy the debug log here. If possible, also connect to the ESP over USB and copy those logs into the backticks.
-->
```
The logs do not display any errors.
```
**Additional information and things you've tried:**
I have tried this with two separate Waveshare 7.5in V2 e-paper displays, and two separate ESP32 driver boards, and get the same results for each combination, so it does not seem to be a faulty hardware issue.