Display delay on esphome

I created 2 screens in esphome using a display in which the two alternate, however, placing each screen takes a few seconds, I wanted to ask for some function to use in the print as I didn’t find it in the display documentation, and I have also used the delay function but it stops the entire code and my esp32 is bugged, thanks friends!

  - platform: ssd1306_i2c
    id: oled
    setup_priority: -100
    model: "SSD1306 128x64"
    address: 0x3C
    pages:
      - id: page1
        lambda: |-
          it.printf(3, 20, id(my_font), "Acqua Callidus");

Theres a whole section in the Display documentation that specifically goes over this and gives you multiple examples…

Thank you very much

Yep. Did you get it working with that?

I found a command in the documentation that I did a workaround and it worked

These didn’t work?

display:
  - platform: ...
    # ...
    id: my_display
    pages:
      - id: page1
        lambda: |-
          it.print(0, 10, id(my_font), "This is page 1!");
      - id: page2
        lambda: |-
          it.print(0, 10, id(my_font), "This is page 2!");
on_...:
  - display.page.show_next: my_display
  - display.page.show_previous: my_display
1 Like

Please tell me which one. If possible with an example. I have a large delay on the screen of the picture on the screen.

This is some commented out code were I had data cycling through a small OLED screen. Pages changed automatically every 5 seconds. Had a temperature and humidity sensor, also printed a timestamp. The last 2 lines is what makes it cycle from page to page. Just download the font files you want to use. I believe you need at least one. It doesn’t have any default font. The files below are in /config/ESPHome/fonts on my HA server

#font:
#  - file: "fonts/Roboto-Bold.ttf"
#    id: tnr2
#    size: 54
#  - file: "fonts/Insominia.ttf"
#    id: tnr3
#    size: 64
#  - file: "fonts/arial.ttf"
#    id: tnr1
#    size: 56
#  - file: "fonts/Times New Roman.ttf"
#    id: tnr4
#    size: 51
#  - file: "fonts/Roboto-Bold.ttf"
#    id: tnr5
#    size: 50
#  - file: "fonts/Times New Roman.ttf"
#    id: tnr6
#    size: 50
#  - file: "fonts/Roboto-Bold.ttf"
#    id: tnr7
#    size: 48
#  - file: "fonts/arial.ttf"
#    id: tnr8
#    size: 12    
#  - file: "fonts/Roboto-Bold.ttf"
#    id: tnr9
#    size: 34
#  - file: "fonts/Roboto-Bold.ttf"
#    id: tnr10
#    size: 38
#
#      
#display:
#  - platform: ssd1306_i2c
#    model: "SSD1306 128x64"
#    id: my_display
#    address: 0x3C
#    rotation: 0°    
#    pages:
#      - id: page1  
#        lambda: |-  
#          if (id(temperature_ig88).has_state()) {          
#            it.printf(64, 54, id(tnr2), TextAlign::BASELINE_CENTER, "%.1f°", id(temperature_ig88).state);
#          }
#      - id: page2 
#        lambda: |-     
#          if (id(humidity_ig88).has_state()) {        
#            it.printf(64, 56, id(tnr3), TextAlign::BASELINE_CENTER, "%.1fH", id(humidity_ig88).state);    
#          }
#      - id: page3
#        lambda: |- 
#          if (id(pressure_ig88).has_state()) {  
#            it.printf(2, 36, id(tnr5), TextAlign::BASELINE_LEFT, "%.0f", id(pressure_ig88).state); 
#            it.print(6, 58, id(tnr8), TextAlign::BASELINE_LEFT,  "barometric pressure");           
#          }  
#      - id: page4
#        lambda: |- 
#          if (id(temperature_ig88).has_state()) {           
#            it.strftime(64, 48, id(tnr4), TextAlign::BASELINE_CENTER, "%H:%M", id(estime).now());       
#          }
#      - id: page5
#        lambda: |-         
#          if (id(temperature_ig88).has_state()) {           
#            it.printf(64, 52, id(tnr1), TextAlign::BASELINE_CENTER, "%.1f°", id(temperature_ig88).state);    
#          }
#      - id: page6
#        lambda: |-         
#          if (id(humidity_ig88).has_state()) { 
#            it.printf(64, 48, id(tnr4), TextAlign::BASELINE_CENTER, "%.1fH", id(humidity_ig88).state);
#          }
#      - id: page7
#        lambda: |-
#          if (id(pressure_ig88).has_state()) {      
#            it.print(8, 10, id(tnr8), TextAlign::BASELINE_LEFT,  "barometric pressure");   
#            it.printf(64, 48, id(tnr10), TextAlign::BASELINE_CENTER, "%3.1f", id(pressure_ig88).state);           
#          }
#      - id: page8
#        lambda: |-
#          if (id(temperature_ig88).has_state()) {         
#            it.strftime(64, 56, id(tnr3), TextAlign::BASELINE_CENTER, "%H:%M", id(estime).now());
#          }
#
## For example cycle through pages on a timer
#interval:
#  - interval: 5s
#    then:
#      - display.page.show_next: my_display
#      - component.update: my_display