So, I tried to make e-ink display with ESPhome.
The problem is: if I don’t use deep_sleep, battery will die in one day. But if I use deep sleep, system is not receiving updates from Home Assistant, because they happen when ESP32 sleeps.
Do you have any advice on that?
Example code with deep_sleep:
esphome:
name: display_eink
platform: ESP32
board: esp32dev
wifi:
ssid: "COVID-19"
password: "---"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Display Eink Fallback Hotspot"
password: "-"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "-"
ota:
password: "-"
web_server:
port: 80
deep_sleep:
run_duration: 10s
sleep_duration: 10min
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: homeassistant
name: "Outside Temperature"
id: outside_temperature
entity_id: sensor.outside_temperature
internal: true
- platform: homeassistant
name: "Living Room Temperature"
id: living_room_temperature
entity_id: sensor.living_room_temperature
internal: true
- platform: homeassistant
name: "Living Room Humidity"
id: living_room_humidity
entity_id: sensor.living_room_humidity
internal: true
- platform: homeassistant
name: "Kitchen Temperature"
id: kitchen_temperature
entity_id: sensor.kitchen_temperature
internal: true
- platform: homeassistant
name: "Kitchen Humidity"
id: kitchen_humidity
entity_id: sensor.kitchen_humidity
internal: true
- platform: homeassistant
name: "Bedroom Temperature"
id: bedroom_temperature
entity_id: sensor.bedroom_temperature
internal: true
- platform: homeassistant
name: "Bedroom Humidity"
id: bedroom_humidity
entity_id: sensor.bedroom_humidity
internal: true
- platform: homeassistant
name: "TEST"
id: test_test
entity_id: input_number.living_room_amount_of_lights
force_update: true
internal: true
font:
- file: "OpenSans-SemiBold.ttf"
id: main_font
size: 35
- file: "OpenSans-SemiBold.ttf"
id: outside_font
size: 70
- file: "OpenSans-SemiBold.ttf"
id: humidity_font
size: 40
- file: "OpenSans-SemiBold.ttf"
id: big_font
size: 50
- file: "OpenSans-SemiBold.ttf"
id: text_font
size: 30
- file: "OpenSans-SemiBold.ttf"
id: date_font
size: 15
spi:
clk_pin: 13
mosi_pin: 14
display:
- platform: waveshare_epaper
id: main_display
cs_pin: 15
busy_pin: 25
reset_pin: 26
dc_pin: 27
model: 4.20in
#model: 7.50inV2
#update_interval: 10min
update_interval: 7s
#update_interval: 20s
rotation: 270°
lambda: |-
it.printf(300, -20, id(outside_font), TextAlign::TOP_RIGHT, "%.1f°C", id(outside_temperature).state);
it.strftime(0, 0, id(date_font), "%Y-%m-%d", id(homeassistant_time).now());
it.strftime(0, 15, id(date_font), "%A", id(homeassistant_time).now());
it.line(0, 74, 300, 74);
it.line(0, 75, 300, 75);
it.line(0, 76, 300, 76);
it.line(0, 77, 300, 77);
it.print(0, 170, id(text_font), TextAlign::BOTTOM_LEFT, "Living R.");
it.printf(300, 80, id(big_font), TextAlign::TOP_RIGHT, "%.1f°C", id(living_room_temperature).state);
it.printf(300, 125, id(humidity_font), TextAlign::TOP_RIGHT, "%.0f%%", id(living_room_humidity).state);
it.line(0, 170, 300, 170);
it.print(0, 260, id(text_font), TextAlign::BOTTOM_LEFT, "Kitchen");
it.printf(300, 170, id(big_font), TextAlign::TOP_RIGHT, "%.1f°C", id(kitchen_temperature).state);
it.printf(300, 215, id(humidity_font), TextAlign::TOP_RIGHT, "%.0f%%", id(kitchen_humidity).state);
it.line(0, 260, 300, 260);
it.print(0, 350, id(text_font), TextAlign::BOTTOM_LEFT, "Bedroom");
it.printf(300, 260, id(big_font), TextAlign::TOP_RIGHT, "%.1f°C", id(bedroom_temperature).state);
it.printf(300, 305, id(humidity_font), TextAlign::TOP_RIGHT, "%.0f%%", id(bedroom_humidity).state);
it.line(0, 350, 300, 350);
it.printf(100, 400, id(humidity_font), TextAlign::BOTTOM_LEFT, "%.1f", id(test_test).state);