On this ESPHome display there is info that ‘pages’ can be defined - code exampe:
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!");
Then ‘interval’ can be defined to display each ‘page’ 5s:
interval:
- interval: 5s
then:
- display.page.show_next: my_display
- component.update: my_display
I would like to have displayed for example ‘page1’ - 2 second, ‘page2’ - 10 seconds.
How to do that?
1 Like
eirik_nor
(Eirik)
2
Is there a solution for this?
m_st
(Michal Stuczkowski)
3
Anyone one this? This would be really good thing - interval per page.
Can use script, f.e.:
script:
- id: zzz
mode: single
then:
- while:
condition:
- script.is_running: zzz
then:
- display.page.show: page1
- component.update: my_display
- delay: 2s
- display.page.show: page2
- component.update: my_display
- delay: 10s
Sscript to be started on_boot
.
1 Like
m_st
(Michal Stuczkowski)
5
This is awesome solution. Big thanks! Works for me. 
Worth to mention, need to set interval to zero.
Full script:
esphome:
...
on_boot:
priority: 800
then:
- script.execute: show_pages
script:
- id: show_pages
mode: single
then:
- while:
condition:
- script.is_running: show_pages
then:
- display.page.show: page1
- component.update: my_screen
- delay: 5s
- display.page.show: page2
- component.update: my_screen
- delay: 10s
display:
- platform: ssd1306_i2c
model: "SH1106 128x64"
address: 0x3C
id: my_screen
pages:
- id: page1
...
- id: page2
...
update_interval: never # see script: show_pages