Error setting display page interval

I am getting the following error when compiling:

interval: 
  - interval: 5s
    then: 
      - display.page.show_next: 
          
          ID 'my_display' of type ssd1306_i2c::I2CSSD1306 doesn't inherit from display::DisplayBuffer. Please double check your ID is pointing to the correct value.
          id: my_display
      - component.update: 
          id: my_display

code for the display:

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    reset_pin: GPIO16
    address: 0x3C
    id: my_display
    pages:
     - id: page1
       lambda: |-
            it.printf(0, 10, id(font1), "%.1f°C", id(temp).state);
     - id: page2
       lambda: |-
            it.printf(0, 24, id(font1), "%.0f%%", id(humi).state); 
     - id: page3
       lambda: |-
            it.printf(0, 36, id(font1), "%.02fm", id(level).state);
interval:
  - interval: 5s
    then:
      - display.page.show_next: my_display
      - component.update: my_display

remove the interval section and it compiles fine, any ideas?
I am using dev

Hi there ! Have you found a solution yet ?
I have some code, but it’s for a LCD Display 16X2 , but it works !

Just tried your exact configuration over here and it compiles successfully, don’t see the error that you’re showing. Could it be related to the ESPHome version that you’re using? Maybe too old?

Edit: oh wow, just noticed that @thomlin1970 was replying on a 3 year old post :crazy_face: