Use ESPHome with e-ink Displays to blend in with your home decor!

that worked, thanks.
Different types of this connector and how to handle them.


https://gct.co/ffc-connector/ffc-connector-actuator-types

1 Like

Hi!!

Just got my e-paper display and got it running… sorta…
But my display is fading from one side to the other … Any hints?

Wow, these things look really good ! Love the idea of putting them into frames.

I’d love to build myself a picture frame that displays pencil-stroke style art depending on the weather outside (or the forecast for the next day). Sunny art for sunny weather, raining art for rainy weather ! Couple of questions before I run off to buy one of these :slight_smile:

  • How ‘techy’ do these look in real life ? It’s kinda hard to judge form the pics here, are we talking more like old style monochrome LCD type of thing or more like actual greyish’ colored paper ?

  • Did you guys try out the larger ones from Waveshare, the 9.7" or 10.3" with 16 grey levels ? They’re probably a better choice for displaying art, but I’m still unsure about how natural they really look.

It seems when my device has been off for a while and starting it up again will make the fade go away but return.

One thing to try might be to make the display go completely white when not at home or night mode is on and see if that can help. Or maybe just smart plug it and cut the power but I would rather having the first option work.

Not sure how to implement it in code though.

I think that’s the way to go! I have added a deep sleep mode in the code and the screen stays pretty good. I will update the code on my site to the current version. I have used example 4 on this site: https://www.wirewd.com/make/blog/esphome_sleep_modes

2 Likes

That’s great news! Can you pinpoint what changes you did? I did go trough your code but not 100% how it works.

Hi,
Taken the data from example 4 on this site I have added these parts:

  on_boot:
    priority: -200
    then:
      - delay: 10s
      - logger.log: "Checking sleep"
      - lambda: |-
          if (id(defeat).state) {
            ESP_LOGD("main", "Prevent sleep");
            id(deep_sleep_1).prevent_deep_sleep();
          } else {
            ESP_LOGD("main", "Allow sleep");
          }
          if(id(remote_defeat).state) {
            ESP_LOGD("main", "Remote prevent sleep");
            id(deep_sleep_1).prevent_deep_sleep();
          } else {
            ESP_LOGD("main", "Remote allow sleep");
          }
      - logger.log: "Sleep checked"


deep_sleep:
  run_duration: 20s
  sleep_duration: 45min
  wakeup_pin:
    number: 4
    inverted: True
    mode: INPUT_PULLUP
  id: deep_sleep_1

binary_sensor:
  - platform: homeassistant
    name: "Remote Defeat Sleep"
    internal: True
    id: "remote_defeat"
    entity_id: input_boolean.defeat_sleep
    on_press:
      then:
        - logger.log: "remote press defeat"
        - deep_sleep.prevent: deep_sleep_1
    on_state:
      then:
        - delay: 4s
        - logger.log: "Remote state state"

  - platform: gpio
    name: "Defeat"
    id: "defeat"
    internal: True
    pin:
      number: 4
      mode: INPUT_PULLUP
      inverted: True
    on_press:
      then:
        - logger.log: "press defeat"
        - deep_sleep.prevent: deep_sleep_1

and added a input_boolean in HA so you can make a switch to temporarily stop the deep_sleep mode to install an update on the ESP.

input_boolean:
  defeat_sleep:
    name: "Disable sleep on ESPHome"
    initial: false
2 Likes

Thanks! Do you keep the prevent deep sleep ON during the day? I guess the display will be “off” during deep sleep and unable to update on motion/time? And do you use a physical button to be able to wake it up?

Because it is a ePaper screen it will stay on for a while even if there is no power. So the screen is ‘always on’. I have deep-sleep periods of 45 minutes (in which the screen gets no power I assume). Then it wakes up for a minutes in which the screen will be updated. I don’t use any button (although it is in the code I believe) :smiley: To upload the code to the ESP I have a switch in HA to disable deep-sleep-mode (The input_boolean). When it wakes up it stays up until I disable the switch again. So I can update the code (which is not possible when in deep-sleep-mode). After updating I disable the switch again.

Ah I see! To bad that the device is unreachable in deep sleep. Would be awesome if I could make it sleep when I’m not home or sleeping and then wake it up when coming home/I waking up.

But with the 45min sleep you don’t need the motion updating it right? As when returning from deep sleep it could bull data and refresh by default before going into deep sleep again right?

Yes, that is correct. So I display only data that doesn’t need to be updated very often.

To bad that the device is unreachable in deep sleep. Would be awesome if I could make it sleep when I’m not home or sleeping and then wake it up when coming home/I waking up.

That is wat I want too. Maybe I can figure it out…

1 Like

First of all thank you for sharing this project! I had to buy my own e-Paper display immediately :grinning_face_with_smiling_eyes:

I am wondering if anyone has been already able to include a small graph to the rendering. I found this graph component in the esphome documentation Display Component — ESPHome

Unfortunately my attempts were not successful. I used the following sensor, graph and rendering code

sensor:
  - platform: homeassistant
    entity_id: sensor.bkw_total_energy
    id: bkw_energy_total
    on_value:
      then:
        - lambda: 'id(data_updated) = true;'

graph:
  # Show bare-minimum auto-ranged graph
  - id: single_bkw_graph
    sensor: bkw_energy_total
    duration: 1h
    width: 151
    height: 51

// Draw the graph at position [x=150,y=584]
it.graph(150, 584, id(single_bkw_graph));

but always ended up with this error.

error

Do you spot my mistake or is the graph component not supported by the controller? Any help appreciated :slight_smile:

1 Like

So I’m having some issues connecting to my esp32 (generic 38 pin esp-wroom-32, pins are labelled with P, white back-side) - seems like my pin connection is off and I need some help…I have the “Waveshare 7.5 Inch E-Paper Display HAT Module V2” version (I connected it to a raspberry pi and it worked) - any suggestion on how to troubleshoot and find/change pins? Some test code that will help? Pin-translation from GPIO to “P” :slight_smile:


My back-up is to use an 8266-unit instead, either LoLin NodeMCU v3, or a Wemos D1 Mini, since I understand the pinout better on those :slight_smile: can the code above be adapted for 8266 instead?

I’m trying to make the screen update once after night mode is on at home with a blank screen and make it refresh with data when night mode comes off again to see if that can fix the problems with fading but I have no clue how to do that. ESPHOME feels a lot different from HA when it comes to template setup and how things work.

Any idea how to do such thing?

Progress! So it seems the 3,3 V on the board was not able to drive the screen - when I connected to 5 V it turned on. I did do some tests with ESP8266 as well, but it seems like they are not capable of driving the screen at all.

So now the fun with creating a nice looking dashboard starts. Is there anywhere you can input code and check what things will look like? (instead of having to update the Live-file)

//F

Hello,

I just used the deep sleep example 4 and changed my coding a little bit to better fit my needs.

  • No refresh during boot (so that there will be just one refresh from the on_time trigger for each interval)
  • Refresh screen as soon as the 20 seconds trigger for on_time is reached, but only if new data is received and only between 7am - 9pm
  • Sleep for 10 minutes after each check
  • Sleep between 9pm and 7am as no refresh is required during the night, display will keep showing the data from last refresh
  • activating the maintenance helper button within HA does not require the device to be disconnected from power first, it will trigger after the new data check and before each deepsleep

Here are my on_boot, deepsleep and on_time adjustments, in case anyone needs it

  on_boot:
      priority: 200.0
      then:
        - delay: 2s
        - logger.log: "On boot method detected"
        - lambda: 'id(initial_data_received) = true;'
        - delay: 2s
        - logger.log: "Checking sleep"
        - lambda: |-
            if (id(defeat).state) {
              ESP_LOGD("main", "Prevent sleep");
              id(deep_sleep_1).prevent_deep_sleep();
            } else {
              ESP_LOGD("main", "Allow sleep");
            }
            if(id(remote_defeat).state) {
              ESP_LOGD("main", "Remote prevent sleep");
              id(deep_sleep_1).prevent_deep_sleep();
            } else {
              ESP_LOGD("main", "Remote allow sleep");
            }
        - logger.log: "Sleep checked"

deep_sleep:
  sleep_duration: 10min
  wakeup_pin:
    number: 4
    inverted: True
    mode: INPUT_PULLUP
  id: deep_sleep_1

time:
  - platform: homeassistant
    id: homeassistant_time
    on_time:
      - seconds: 20
        minutes: 0-59
        hours: 7-20
        then:
          - if:
              condition:
                  lambda: 'return id(data_updated) == true;'
              then:
                - logger.log: "Sensor data updated: Refreshing display..."
                - script.execute: update_screen
                - delay: 10s
                - if:
                    condition:
                        lambda: 'return id(remote_defeat).state == true;'
                    then:
                      - deep_sleep.prevent: deep_sleep_1
                      - logger.log: "Preventing deep sleep from on_time"
                    else:
                      - logger.log: "Entering deep sleep from on_time"
                      - delay: 2s
                      - deep_sleep.enter:
                          id: deep_sleep_1
                          sleep_duration: 10min
              else:
                - logger.log: "Sensor data updated: Nothing new, skip refreshing display." 
                - if:
                    condition:
                        lambda: 'return id(remote_defeat).state == true;'
                    then:
                      - deep_sleep.prevent: deep_sleep_1
                      - logger.log: "Preventing deep sleep from on_time" 
                    else:
                      - logger.log: "Entering deep sleep from on_time"
                      - delay: 2s
                      - deep_sleep.enter:
                          id: deep_sleep_1
                          sleep_duration: 10min

      - hours: 21
        then:
          - delay: 10s
          - deep_sleep.enter:
              id: deep_sleep_1
              until: "07:00:00"
              time_id: homeassistant_time
2 Likes

It’s been a while since that project. Do you still have the code for the first version of the project?

Not really sure what do you mean by first version of the code. It is still available to copy from my previous post:

Here

image

From this picture.

1 Like

Unfortunately not