From 1b9552e32801a4b514446f8e823c75cf2a26bcf3 Mon Sep 17 00:00:00 2001 From: ESPHome Device Builder Date: Tue, 14 Jul 2026 22:50:56 +1200 Subject: [PATCH] Edit esp-bedside-panel.yaml --- esphome/esp-bedside-panel.yaml | 838 ++++++++++++++------------------- 1 file changed, 351 insertions(+), 487 deletions(-) diff --git a/esphome/esp-bedside-panel.yaml b/esphome/esp-bedside-panel.yaml index f072930..fdd3558 100644 --- a/esphome/esp-bedside-panel.yaml +++ b/esphome/esp-bedside-panel.yaml @@ -6,15 +6,16 @@ # https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-bedside-panel.yaml #:########################################################################################:# # VERSIONS: -# V0.8 2026-07-14 Added large bedside clock, idle dimming and first bedroom control page -# Corrected YAML parsing of conditional LVGL colour lambdas -# V0.7 2026-07-14 Added first landscape LVGL page and Home Assistant test button -# V0.6 2026-07-14 Added GT911 touchscreen and touch-coordinate logging -# V0.5 2026-07-14 Added corrected JC1060P470 MIPI display configuration and text test -# V0.4 2026-07-14 Removed MIPI display test after setup watchdog boot loop; retained backlight-only test -# V0.3 2026-07-14 Added backlight control and first MIPI display text test -# V0.2 2026-07-14 Added ESP32 hosted WiFi via ESP32-C6 co-processor -# V0.1 2026-07-14 Initial ESPHome bring-up for Guition JC1060P470C_I_W_Y ESP32-P4 panel +# V0.8a 2026-07-14 Reduced LVGL memory load after V0.8 OTA rollback +# Added lean large-clock idle page and Bedroom controls +# V0.8 2026-07-14 Added large bedside clock, idle dimming and first bedroom control page +# V0.7 2026-07-14 Added first landscape LVGL page and Home Assistant test button +# V0.6 2026-07-14 Added GT911 touchscreen and touch-coordinate logging +# V0.5 2026-07-14 Added corrected JC1060P470 MIPI display configuration and text test +# V0.4 2026-07-14 Removed MIPI display test after setup watchdog boot loop; retained backlight-only test +# V0.3 2026-07-14 Added backlight control and first MIPI display text test +# V0.2 2026-07-14 Added ESP32 hosted WiFi via ESP32-C6 co-processor +# V0.1 2026-07-14 Initial ESPHome bring-up for Guition JC1060P470C_I_W_Y ESP32-P4 panel #:########################################################################################:# # HARDWARE: # - Guition JC1060P470C_I_W_Y @@ -39,24 +40,22 @@ # - Touch I2C address: 0x5D #:########################################################################################:# # OPERATION NOTES: +# - This is a reduced-load test build after V0.8 rolled back during startup. # - The display remains in its native 1024x600 landscape orientation. -# - The default active page is the Bedroom control page. -# - After 60 seconds without touchscreen activity: -# - The large bedside clock page is displayed. -# - The backlight dims to the configured clock brightness. +# - The default page contains nine Bedroom / nearby controls. +# - After the configured idle period: +# - The large clock page is displayed. +# - Backlight brightness is reduced. # - Touching the clock: -# - Returns to the Bedroom page. -# - Restores the configured control-page brightness. -# - Bedroom light/control buttons use live Home Assistant states. -# - Active controls use function-specific colours. -# - Bedtime requires a long press to reduce accidental activation. -# - Climate and Downstairs placeholder pages are included for navigation testing. +# - Returns to the Bedroom controls. +# - Restores normal brightness. +# - Climate and Downstairs pages are intentionally omitted from this version. +# - They will be restored after the clock framework is proven stable. #:########################################################################################:# # OFFLINE NOTES: -# - LVGL, the clock, touch and backlight continue operating locally. -# - The clock continues using the last synchronised time if Home Assistant disconnects. -# - Home Assistant control buttons cannot operate while the API is disconnected. -# - Imported entity states may remain at their last received values while offline. +# - LVGL, the clock, touch and backlight operate locally. +# - Home Assistant control buttons require an API connection. +# - The clock continues using the most recently synchronised time. #:########################################################################################:# #:########################################################################################:# @@ -68,12 +67,12 @@ substitutions: # Device Naming device_name: "esp-bedside-panel" friendly_name: "ESP Bedside Panel" - description_comment: "Guition JC1060P470C_I_W_Y ESP32-P4 bedside clock and Home Assistant control panel. (Layout V1.1)" + description_comment: "Guition JC1060P470C_I_W_Y ESP32-P4 bedside clock and Home Assistant control panel. Reduced-load LVGL test. (Layout V1.1)" device_area: "Bedroom" # Project Naming project_name: "Guition.JC1060P470C_I_W_Y" - project_version: "v0.8" + project_version: "v0.8a" # Passwords & Secrets api_key: !secret esp-api_key @@ -348,40 +347,27 @@ touchscreen: #:########################################################################################:# # FONTS: +# Reduced font set for lower startup memory use # https://esphome.io/components/font.html #:########################################################################################:# font: - file: "gfonts://Roboto" id: font_clock - size: 230 + size: 170 glyphs: - "0123456789:" - file: "gfonts://Roboto" - id: font_clock_ampm - size: 42 - glyphs: - - "AMP" - - - file: "gfonts://Roboto" - id: font_clock_date - size: 42 + id: font_title + size: 36 glyphs: - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - - "0123456789, " - - - file: "gfonts://Roboto" - id: font_page_title - size: 38 - glyphs: - - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - - "abcdefghijklmnopqrstuvwxyz" - - "0123456789 /-" + - "0123456789, .:/-%°C" - file: "gfonts://Roboto" id: font_button - size: 25 + size: 24 glyphs: - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" @@ -389,17 +375,11 @@ font: - file: "gfonts://Roboto" id: font_small - size: 22 + size: 20 glyphs: - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - - "0123456789 .:%°/-" - - - file: "gfonts://Roboto" - id: font_environment - size: 34 - glyphs: - - "0123456789.-%°C " + - "0123456789, .:/-%°C" #:########################################################################################:# # HOME ASSISTANT NUMERIC SENSORS: @@ -461,7 +441,6 @@ binary_sensor: id: ha_north_lights entity_id: "${north_lights_entity}" internal: true - trigger_on_initial_state: true on_state: then: - lvgl.widget.update: @@ -475,7 +454,6 @@ binary_sensor: id: ha_south_lights entity_id: "${south_lights_entity}" internal: true - trigger_on_initial_state: true on_state: then: - lvgl.widget.update: @@ -489,7 +467,6 @@ binary_sensor: id: ha_bedside_lamp entity_id: "${bedside_lamp_entity}" internal: true - trigger_on_initial_state: true on_state: then: - lvgl.widget.update: @@ -503,7 +480,6 @@ binary_sensor: id: ha_hall_floor entity_id: "${hall_floor_entity}" internal: true - trigger_on_initial_state: true on_state: then: - lvgl.widget.update: @@ -517,7 +493,6 @@ binary_sensor: id: ha_hall_lights entity_id: "${hall_lights_entity}" internal: true - trigger_on_initial_state: true on_state: then: - lvgl.widget.update: @@ -531,7 +506,6 @@ binary_sensor: id: ha_bathroom_lights entity_id: "${bathroom_lights_entity}" internal: true - trigger_on_initial_state: true on_state: then: - lvgl.widget.update: @@ -545,7 +519,6 @@ binary_sensor: id: ha_patio_lights entity_id: "${patio_lights_entity}" internal: true - trigger_on_initial_state: true on_state: then: - lvgl.widget.update: @@ -559,7 +532,6 @@ binary_sensor: id: ha_garage_lights entity_id: "${garage_lights_entity}" internal: true - trigger_on_initial_state: true on_state: then: - lvgl.widget.update: @@ -577,7 +549,6 @@ binary_sensor: id: ha_garage_door entity_id: "${garage_door_entity}" internal: true - trigger_on_initial_state: true on_state: then: - lvgl.widget.update: @@ -595,7 +566,6 @@ binary_sensor: id: ha_bathroom_fan entity_id: "${bathroom_fan_entity}" internal: true - trigger_on_initial_state: true on_state: then: - lvgl.widget.update: @@ -609,7 +579,6 @@ binary_sensor: id: ha_quiet_time entity_id: "${quiet_time_entity}" internal: true - trigger_on_initial_state: true on_state: then: - lvgl.widget.update: @@ -628,10 +597,10 @@ binary_sensor: #:########################################################################################:# # INTERVAL: -# Update the clock labels locally +# Update minute-resolution clock values locally #:########################################################################################:# interval: - - interval: 1s + - interval: 10s then: - if: condition: @@ -726,7 +695,7 @@ lvgl: long_press_repeat_time: 500ms rotation: 0 - buffer_size: 12% + buffer_size: 8% log_level: WARN default_font: font_button page_wrap: false @@ -734,30 +703,322 @@ lvgl: theme: dark_mode: true - on_boot: - then: - - lvgl.page.show: bedroom_page - - - light.turn_on: - id: display_backlight - brightness: "${control_brightness}" - transition_length: 500ms - on_idle: - timeout: "${clock_idle_timeout}" then: - lvgl.page.show: id: clock_page animation: FADE_IN - time: 300ms + time: 250ms - light.turn_on: id: display_backlight brightness: "${clock_brightness}" - transition_length: 2s + transition_length: 1500ms pages: + #:####################################################################################:# + # BEDROOM PAGE + #:####################################################################################:# + - id: bedroom_page + bg_color: 0x10151D + bg_opa: COVER + + widgets: + - label: + x: 35 + y: 18 + text: "Bedroom" + text_font: font_title + text_color: 0xFFFFFF + + - label: + id: bedroom_temperature_label + x: 700 + y: 25 + text: "--.-°C" + text_font: font_title + text_color: 0x8FC6EE + + - label: + id: bedroom_humidity_label + x: 865 + y: 25 + text: "--%" + text_font: font_title + text_color: 0x83C7AA + + - label: + id: bedroom_connection_label + x: 38 + y: 67 + text: "Waiting for HA" + text_font: font_small + text_color: 0xF0A45D + + # Row 1 + - button: + id: north_lights_button + x: 35 + y: 105 + width: 300 + height: 105 + text: "North Lights" + text_font: font_button + bg_color: 0x28313D + bg_opa: COVER + border_width: 2 + border_color: 0x445365 + radius: 18 + pressed: + bg_color: 0x425166 + on_click: + - homeassistant.action: + action: light.toggle + data: + entity_id: "${north_lights_entity}" + + - button: + id: south_lights_button + x: 362 + y: 105 + width: 300 + height: 105 + text: "South Lights" + text_font: font_button + bg_color: 0x28313D + bg_opa: COVER + border_width: 2 + border_color: 0x445365 + radius: 18 + pressed: + bg_color: 0x425166 + on_click: + - homeassistant.action: + action: switch.toggle + data: + entity_id: "${south_lights_entity}" + + - button: + id: bedside_lamp_button + x: 689 + y: 105 + width: 300 + height: 105 + text: "Bedside Lamp" + text_font: font_button + bg_color: 0x28313D + bg_opa: COVER + border_width: 2 + border_color: 0x445365 + radius: 18 + pressed: + bg_color: 0x425166 + on_click: + - homeassistant.action: + action: switch.toggle + data: + entity_id: "${bedside_lamp_entity}" + + # Row 2 + - button: + id: hall_floor_button + x: 35 + y: 228 + width: 300 + height: 105 + text: "Hall Floor" + text_font: font_button + bg_color: 0x28313D + bg_opa: COVER + border_width: 2 + border_color: 0x445365 + radius: 18 + pressed: + bg_color: 0x425166 + on_click: + - homeassistant.action: + action: switch.toggle + data: + entity_id: "${hall_floor_entity}" + + - button: + id: hall_lights_button + x: 362 + y: 228 + width: 300 + height: 105 + text: "Hall Lights" + text_font: font_button + bg_color: 0x28313D + bg_opa: COVER + border_width: 2 + border_color: 0x445365 + radius: 18 + pressed: + bg_color: 0x425166 + on_click: + - homeassistant.action: + action: switch.toggle + data: + entity_id: "${hall_lights_entity}" + + - button: + id: bathroom_lights_button + x: 689 + y: 228 + width: 300 + height: 105 + text: "Bathroom Lights" + text_font: font_button + bg_color: 0x28313D + bg_opa: COVER + border_width: 2 + border_color: 0x445365 + radius: 18 + pressed: + bg_color: 0x425166 + on_click: + - homeassistant.action: + action: switch.toggle + data: + entity_id: "${bathroom_lights_entity}" + + # Row 3 + - button: + id: patio_lights_button + x: 35 + y: 351 + width: 300 + height: 105 + text: "Patio Lights" + text_font: font_button + bg_color: 0x28313D + bg_opa: COVER + border_width: 2 + border_color: 0x445365 + radius: 18 + pressed: + bg_color: 0x425166 + on_click: + - homeassistant.action: + action: switch.toggle + data: + entity_id: "${patio_lights_entity}" + + - button: + id: garage_lights_button + x: 362 + y: 351 + width: 300 + height: 105 + text: "Garage Lights" + text_font: font_button + bg_color: 0x28313D + bg_opa: COVER + border_width: 2 + border_color: 0x445365 + radius: 18 + pressed: + bg_color: 0x425166 + on_click: + - homeassistant.action: + action: switch.toggle + data: + entity_id: "${garage_lights_entity}" + + - button: + id: bathroom_fan_button + x: 689 + y: 351 + width: 300 + height: 105 + text: "Bathroom Fan" + text_font: font_button + bg_color: 0x28313D + bg_opa: COVER + border_width: 2 + border_color: 0x445365 + radius: 18 + pressed: + bg_color: 0x425166 + on_click: + - homeassistant.action: + action: switch.toggle + data: + entity_id: "${bathroom_fan_entity}" + + # Bottom action bar + - button: + id: clock_now_button + x: 35 + y: 485 + width: 280 + height: 82 + text: "Show Clock" + text_font: font_button + bg_color: 0x214F72 + bg_opa: COVER + border_width: 2 + border_color: 0x3E7FA7 + radius: 16 + on_click: + - lvgl.page.show: + id: clock_page + animation: FADE_IN + time: 250ms + + - light.turn_on: + id: display_backlight + brightness: "${clock_brightness}" + transition_length: 1500ms + + - button: + id: spare_navigation_button + x: 340 + y: 485 + width: 280 + height: 82 + text: "More Soon" + text_font: font_button + bg_color: 0x315843 + bg_opa: COVER + border_width: 2 + border_color: 0x548C6C + radius: 16 + + - button: + id: bedtime_button + x: 645 + y: 485 + width: 344 + height: 82 + text: "Hold for Bedtime" + text_font: font_button + bg_color: 0x3B3048 + bg_opa: COVER + border_width: 2 + border_color: 0x735E88 + radius: 16 + + on_long_press: + then: + - homeassistant.action: + action: input_button.press + data: + entity_id: "${bedtime_button_entity}" + + - lvgl.button.update: + id: bedtime_button + text: "Bedtime Activated" + + - delay: 2s + + - lvgl.button.update: + id: bedtime_button + text: "Hold for Bedtime" + #:####################################################################################:# # CLOCK PAGE #:####################################################################################:# @@ -794,7 +1055,7 @@ lvgl: - label: id: clock_time_label align: TOP_MID - y: 60 + y: 70 text: "--:--" text_font: font_clock text_color: 0xE4DDD2 @@ -802,442 +1063,45 @@ lvgl: - label: id: clock_ampm_label - x: 785 - y: 265 + x: 790 + y: 250 text: "" - text_font: font_clock_ampm + text_font: font_title text_color: 0x938D85 clickable: false - label: id: clock_date_label align: TOP_MID - y: 335 + y: 325 text: "Waiting for time" - text_font: font_clock_date + text_font: font_title text_color: 0xA8A198 clickable: false - label: id: clock_temperature_label - x: 330 - y: 425 + x: 335 + y: 420 text: "--.-°C" - text_font: font_environment + text_font: font_title text_color: 0x8FAFC8 clickable: false - label: id: clock_humidity_label x: 600 - y: 425 + y: 420 text: "--%" - text_font: font_environment + text_font: font_title text_color: 0x7FAE9B clickable: false - label: id: clock_status_label align: BOTTOM_MID - y: -48 + y: -45 text: "" text_font: font_small text_color: 0x887799 - clickable: false - - #:####################################################################################:# - # BEDROOM PAGE - #:####################################################################################:# - - id: bedroom_page - bg_color: 0x10151D - bg_opa: COVER - - widgets: - - label: - x: 35 - y: 20 - text: "Bedroom" - text_font: font_page_title - text_color: 0xFFFFFF - - - label: - id: bedroom_temperature_label - x: 665 - y: 28 - text: "--.-°C" - text_font: font_environment - text_color: 0x8FC6EE - - - label: - id: bedroom_humidity_label - x: 835 - y: 28 - text: "--%" - text_font: font_environment - text_color: 0x83C7AA - - - label: - id: bedroom_connection_label - x: 38 - y: 72 - text: "Waiting for HA" - text_font: font_small - text_color: 0xF0A45D - - # Row 1 - - button: - id: north_lights_button - x: 35 - y: 112 - width: 300 - height: 105 - text: "North Lights" - text_font: font_button - bg_color: 0x28313D - bg_opa: COVER - border_width: 2 - border_color: 0x445365 - radius: 18 - - pressed: - bg_color: 0x425166 - - on_click: - - homeassistant.action: - action: light.toggle - data: - entity_id: "${north_lights_entity}" - - - button: - id: south_lights_button - x: 362 - y: 112 - width: 300 - height: 105 - text: "South Lights" - text_font: font_button - bg_color: 0x28313D - bg_opa: COVER - border_width: 2 - border_color: 0x445365 - radius: 18 - - pressed: - bg_color: 0x425166 - - on_click: - - homeassistant.action: - action: switch.toggle - data: - entity_id: "${south_lights_entity}" - - - button: - id: bedside_lamp_button - x: 689 - y: 112 - width: 300 - height: 105 - text: "Bedside Lamp" - text_font: font_button - bg_color: 0x28313D - bg_opa: COVER - border_width: 2 - border_color: 0x445365 - radius: 18 - - pressed: - bg_color: 0x425166 - - on_click: - - homeassistant.action: - action: switch.toggle - data: - entity_id: "${bedside_lamp_entity}" - - # Row 2 - - button: - id: hall_floor_button - x: 35 - y: 235 - width: 300 - height: 105 - text: "Hall Floor" - text_font: font_button - bg_color: 0x28313D - bg_opa: COVER - border_width: 2 - border_color: 0x445365 - radius: 18 - - pressed: - bg_color: 0x425166 - - on_click: - - homeassistant.action: - action: switch.toggle - data: - entity_id: "${hall_floor_entity}" - - - button: - id: hall_lights_button - x: 362 - y: 235 - width: 300 - height: 105 - text: "Hall Lights" - text_font: font_button - bg_color: 0x28313D - bg_opa: COVER - border_width: 2 - border_color: 0x445365 - radius: 18 - - pressed: - bg_color: 0x425166 - - on_click: - - homeassistant.action: - action: switch.toggle - data: - entity_id: "${hall_lights_entity}" - - - button: - id: bathroom_lights_button - x: 689 - y: 235 - width: 300 - height: 105 - text: "Bathroom Lights" - text_font: font_button - bg_color: 0x28313D - bg_opa: COVER - border_width: 2 - border_color: 0x445365 - radius: 18 - - pressed: - bg_color: 0x425166 - - on_click: - - homeassistant.action: - action: switch.toggle - data: - entity_id: "${bathroom_lights_entity}" - - # Row 3 - - button: - id: patio_lights_button - x: 35 - y: 358 - width: 300 - height: 105 - text: "Patio Lights" - text_font: font_button - bg_color: 0x28313D - bg_opa: COVER - border_width: 2 - border_color: 0x445365 - radius: 18 - - pressed: - bg_color: 0x425166 - - on_click: - - homeassistant.action: - action: switch.toggle - data: - entity_id: "${patio_lights_entity}" - - - button: - id: garage_lights_button - x: 362 - y: 358 - width: 300 - height: 105 - text: "Garage Lights" - text_font: font_button - bg_color: 0x28313D - bg_opa: COVER - border_width: 2 - border_color: 0x445365 - radius: 18 - - pressed: - bg_color: 0x425166 - - on_click: - - homeassistant.action: - action: switch.toggle - data: - entity_id: "${garage_lights_entity}" - - - button: - id: bathroom_fan_button - x: 689 - y: 358 - width: 300 - height: 105 - text: "Bathroom Fan" - text_font: font_button - bg_color: 0x28313D - bg_opa: COVER - border_width: 2 - border_color: 0x445365 - radius: 18 - - pressed: - bg_color: 0x425166 - - on_click: - - homeassistant.action: - action: switch.toggle - data: - entity_id: "${bathroom_fan_entity}" - - # Bottom navigation / action bar - - button: - id: climate_navigation_button - x: 35 - y: 495 - width: 280 - height: 78 - text: "Climate" - text_font: font_button - bg_color: 0x214F72 - bg_opa: COVER - border_width: 2 - border_color: 0x3E7FA7 - radius: 16 - - on_click: - - lvgl.page.show: - id: climate_page - animation: MOVE_LEFT - time: 220ms - - - button: - id: downstairs_navigation_button - x: 340 - y: 495 - width: 280 - height: 78 - text: "Downstairs" - text_font: font_button - bg_color: 0x315843 - bg_opa: COVER - border_width: 2 - border_color: 0x548C6C - radius: 16 - - on_click: - - lvgl.page.show: - id: downstairs_page - animation: MOVE_LEFT - time: 220ms - - - button: - id: bedtime_button - x: 645 - y: 495 - width: 344 - height: 78 - text: "Hold for Bedtime" - text_font: font_button - bg_color: 0x3B3048 - bg_opa: COVER - border_width: 2 - border_color: 0x735E88 - radius: 16 - - on_long_press: - then: - - homeassistant.action: - action: input_button.press - data: - entity_id: "${bedtime_button_entity}" - - - lvgl.button.update: - id: bedtime_button - text: "Bedtime Activated" - - - delay: 2s - - - lvgl.button.update: - id: bedtime_button - text: "Hold for Bedtime" - - #:####################################################################################:# - # CLIMATE PLACEHOLDER PAGE - #:####################################################################################:# - - id: climate_page - bg_color: 0x111923 - bg_opa: COVER - - widgets: - - label: - align: TOP_MID - y: 100 - text: "Bedroom Climate" - text_font: font_page_title - text_color: 0xFFFFFF - - - label: - align: CENTER - y: -20 - text: "Climate controls will be added next" - text_font: font_button - text_color: 0x9AA9B8 - - - button: - align: BOTTOM_MID - y: -55 - width: 360 - height: 85 - text: "Back to Bedroom" - text_font: font_button - bg_color: 0x28313D - radius: 18 - - on_click: - - lvgl.page.show: - id: bedroom_page - animation: MOVE_RIGHT - time: 220ms - - #:####################################################################################:# - # DOWNSTAIRS PLACEHOLDER PAGE - #:####################################################################################:# - - id: downstairs_page - bg_color: 0x111923 - bg_opa: COVER - - widgets: - - label: - align: TOP_MID - y: 100 - text: "Downstairs & Outside" - text_font: font_page_title - text_color: 0xFFFFFF - - - label: - align: CENTER - y: -20 - text: "Downstairs controls will be added next" - text_font: font_button - text_color: 0x9AA9B8 - - - button: - align: BOTTOM_MID - y: -55 - width: 360 - height: 85 - text: "Back to Bedroom" - text_font: font_button - bg_color: 0x28313D - radius: 18 - - on_click: - - lvgl.page.show: - id: bedroom_page - animation: MOVE_RIGHT - time: 220ms \ No newline at end of file + clickable: false \ No newline at end of file