Ok, so have gotten somewhere.
But the display is really bad. I seen people kind of allude to quality issues. But how did you fix it?
After turning it on, got this
Even though I thought it would be black text on white
Restarted again and now its sitting here
If anyone can give me any advise, would really appreciate it
# Global variables for detecting if the display needs to be refreshed. (Thanks @paviro!)
globals:
- id: data_updated
type: bool
restore_value: no
initial_value: 'false'
- id: initial_data_received
type: bool
restore_value: no
initial_value: 'false'
# Include custom fonts
font:
- file: 'fonts/GothamRnd-Book.ttf'
id: font_small_book
size: 18
- file: 'fonts/GothamRnd-Bold.ttf'
id: font_large_bold
size: 108
#glyphs: [' ', '°', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'C']
- file: 'fonts/GothamRnd-Bold.ttf'
id: font_title
size: 54
#glyphs: ['W', 'E', 'A', 'T', 'H', 'R', 'L', 'I', 'N', ' ']
- file: 'fonts/GothamRnd-Bold.ttf'
id: font_medium_bold
size: 30
# glyphs: [' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'M', 'I', 'N']
- file: 'fonts/GothamRnd-Bold.ttf'
id: font_small_bold
size: 18
# glyphs: ['°', '0', '1', +'2', '3', '4', '5', '6', '7', '8', '9', 'C', 'M', 'I', 'N']
# Check whether the display needs to be refreshed every minute,
# based on whether new data is received or motion is detected. (Thanks @paviro!)
time:
- platform: homeassistant
id: homeassistant_time
on_time:
- seconds: 0
minutes: /1
then:
- if:
condition:
lambda: 'return id(data_updated) == true;'
then:
- lambda: 'id(initial_data_received) = true;'
- if:
condition:
binary_sensor.is_on: motion_detected
then:
- logger.log: "Sensor data updated and activity in home detected: Refreshing display..."
- component.update: eink_display
- lambda: 'id(data_updated) = false;'
else:
- logger.log: "Sensor data updated but no activity in home - skipping display refresh."
# Check if motion is detected in the bathroom.
binary_sensor:
- platform: homeassistant
entity_id: binary_sensor.bathroom_motion_sensor
id: motion_detected
# Call calender sensors from HA.
sensor:
- platform: homeassistant
entity_id: calendar.home_assistant_tasks
id: home_assistant_tasks
on_value:
then:
- lambda: 'id(data_updated) = true;'
- platform: homeassistant
entity_id: calendar.alexa_to_do_list
id: alexa_to_do_list
on_value:
then:
- lambda: 'id(data_updated) = true;'
- platform: homeassistant
entity_id: calendar.alexa_shopping_list
id: alexa_shopping_list
on_value:
then:
- lambda: 'id(data_updated) = true;'
# Define colors
# This design is white on black so this is necessary.
color:
- id: color_black
red: 0%
green: 0%
blue: 0%
white: 50%
- id: color_white
red: 0%
green: 0%
blue: 0%
white: 0%
# Pins for Waveshare ePaper ESP Board
spi:
clk_pin: GPIO13
mosi_pin: GPIO14
# Now render everything on the ePaper screen.
display:
- platform: waveshare_epaper
id: eink_display
cs_pin: GPIO15
dc_pin: GPIO27
busy_pin: GPIO25
reset_pin: GPIO26
reset_duration: 2ms
model: 7.50inV2
update_interval: 1h
rotation: 90°
lambda: |-
// Fill background.
// it.fill(color_bg);
// Show loading screen before data is received.
if (id(initial_data_received) == false) {
it.printf(240, 390, id(font_title), color_black, TextAlign::TOP_CENTER, "WAITING FOR DATA...");
} else {
// To Do List
it.printf(240, 84, id(font_title), color_black, TextAlign::TOP_CENTER, "To Do");
// Shopping List Section
it.printf(240, 408, id(font_title), color_black, TextAlign::TOP_CENTER, "Shopping List");
}
captive_portal: