Waveshare E-Paper Display - ESPhome32 - Refresh via Toggle Switch

Hi guys,

I have a Waveshare eink display with ESP32 driver board, which I run with a 5000mAh battery. Currently the display is updating every minute. To save the display and the battery, I would like to turn off the display at night or only update when a motion detector detects movement. Can anyone tell me what I need to put in the code? I have already tried several codes from the internet, but I can’t get them to work on the ESP32, because there are always some errors that I can’t get fixed and most of the time the example projects are way too complicated.

Greetings
Pedro

I have managed it myself in the meantime.

I used the following command in the ESP32 configuration.

When the specified sensor “input_boolean.refresh_eink” gets an “ON” signal, the display updates. This signal is currently generated by a helper switch, which is controlled via an automation. In the medium term I will control something more specific. E.g. via a motion detector.

binary_sensor:
  - platform: homeassistant
    id: refresh_eink
    entity_id: input_boolean.refresh_eink
    on_press:
      then:
        - component.update: Waveshare

If you want to use something other than an ON/OFF switch, see if the “on_press” condition works for you. There are others.

ESPHome - Binary Sensor

You must then give your display the same id. In my case “Waveshare”.

display:
  - platform: waveshare_epaper
    cs_pin: GPIO15
    dc_pin: GPIO27
# This pin must be inverted on my display Waveshare E-Ink 7.5 V2 to not cause damage to the display. If the pin is not inverted, you will get also timeout messages and the update will take a long time (>20 seconds).
    busy_pin: 
      number: GPIO25
      inverted: true
    reset_pin: GPIO26
    model: 7.50inV2
    rotation: 90
    update_interval: never
    id: Waveshare