@@ -22,7 +22,7 @@ display:
2222 address : 0x3C
2323 # rotation: 180°
2424 pages :
25- - id : summary
25+ - id : airgradient_default
2626 # https://forum.airgradient.com/t/airgradient-one-customized-mallocarray-esphome-display/1328
2727 lambda : |-
2828 if (id(display_in_f).state) {
@@ -50,29 +50,58 @@ display:
5050 it.printf(128, 0, id(open_sans_14), TextAlign::TOP_RIGHT, "%s", get_mac_address().c_str());
5151 it.printf(0, 21, id(open_sans_14), "Config Ver: $config_version");
5252 it.printf(0, 42, id(open_sans_14), "$friendly_name");
53+ - id : blank
54+ lambda : |-
55+ it.printf(0, 0, id(open_sans_14), " ");
5356
5457 on_page_change :
55- to : boot
56- then :
57- - if :
58- # Skip the boot page after initial boot
59- condition :
60- lambda : ' return id(device_uptime).state > 30;'
61- then :
62- - display.page.show_next : oled_display
63- - component.update : oled_display
58+ - to : airgradient_default
59+ then :
60+ - if :
61+ condition :
62+ switch.is_off : display_ag_default_page
63+ then :
64+ - display.page.show_next : oled_display
65+ - component.update : oled_display
66+ - to : boot
67+ then :
68+ - if :
69+ condition :
70+ switch.is_off : display_boot_page
71+ then :
72+ - display.page.show_next : oled_display
73+ - component.update : oled_display
74+ - to : blank
75+ # Skip blank page unless it is turned on and the interval: will only display it
76+ then :
77+ - if :
78+ condition :
79+ switch.is_off : display_blank_page
80+ then :
81+ - display.page.show_next : oled_display
82+ - component.update : oled_display
6483
6584
6685interval :
86+ - interval : 10s
87+ startup_delay : 1s
88+ # Show boot screen serial number and config version only when first starting up
89+ then :
90+ if :
91+ condition :
92+ switch.is_on : display_boot_page
93+ then :
94+ switch.turn_off : display_boot_page
6795 - interval : 5s
68- # Automatically switch to the next page every five seconds
96+ # Automatically switch to the next page every five seconds if not set to blank
6997 then :
7098 - if :
71- # Show boot screen for first 10 seconds with serial number and config version
7299 condition :
73- lambda : ' return id(device_uptime).state < 10;'
100+ # If the blank page switch is on, only display the blank page, otherwise, rotate to next page
101+ switch.is_on : display_blank_page
74102 then :
75- - display.page.show : boot
103+ - display.page.show : blank
104+ - component.update : oled_display
76105 else :
77106 # Change page on display
78107 - display.page.show_next : oled_display
@@ -82,10 +111,41 @@ interval:
82111switch :
83112 - platform : template
84113 name : " Display Temperature in °F"
85- icon : " mdi:thermometer"
86114 id : display_in_f
87115 restore_mode : RESTORE_DEFAULT_ON
88116 optimistic : True
117+ entity_category : config
118+ icon : " mdi:thermometer"
119+
120+ - platform : template
121+ name : " Display AirGradient Default Page"
122+ id : display_ag_default_page
123+ restore_mode : RESTORE_DEFAULT_ON
124+ optimistic : True
125+ entity_category : config
126+ icon : " mdi:monitor"
127+
128+ - platform : template
129+ name : " Display Boot Page"
130+ id : display_boot_page
131+ restore_mode : ALWAYS_ON
132+ optimistic : True
133+ entity_category : config
134+ icon : " mdi:monitor"
135+
136+ - platform : template
137+ name : " Display Blank Page"
138+ id : display_blank_page
139+ restore_mode : RESTORE_DEFAULT_OFF
140+ optimistic : True
141+ entity_category : config
142+ icon : " mdi:monitor"
143+ on_turn_on :
144+ - display.page.show : blank
145+ - component.update : oled_display
146+ on_turn_off :
147+ - display.page.show_next : oled_display
148+ - component.update : oled_display
89149
90150number :
91151 - platform : template
0 commit comments