Edit esp-bedside-panel.yaml

This commit is contained in:
ESPHome Device Builder
2026-07-14 22:06:30 +12:00
parent 4fab9755ec
commit e013bab5c9
+87 -18
View File
@@ -6,6 +6,7 @@
# https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-bedside-panel.yaml # https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-bedside-panel.yaml
#:########################################################################################:# #:########################################################################################:#
# VERSIONS: # VERSIONS:
# 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.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.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.3 2026-07-14 Added backlight control and first MIPI display text test
@@ -33,28 +34,33 @@
# - Touch I2C SCL: GPIO8 # - Touch I2C SCL: GPIO8
# - Touch interrupt: GPIO21 # - Touch interrupt: GPIO21
# - Touch reset: GPIO22 # - Touch reset: GPIO22
# - Touch I2C address: 0x5D
#:########################################################################################:# #:########################################################################################:#
# OPERATION NOTES: # OPERATION NOTES:
# - Flash this to the ESP32-P4 side of the board. # - Flash this to the ESP32-P4 side of the board.
# - This version is intended to confirm: # - This version is intended to confirm:
# - ESPHome remains stable during display initialisation # - MIPI-DSI display remains stable
# - MIPI-DSI display initialises correctly # - Display test text is rendered
# - Backlight control remains available in Home Assistant # - Backlight brightness remains adjustable from Home Assistant
# - Basic text is rendered on the screen # - GT911 touchscreen initialises
# - Display is left in its native landscape orientation for the first test. # - Touch coordinates appear in ESPHome logs
# - Portrait rotation will be configured after the display and touch are proven stable. # - Display remains in native landscape orientation for this test.
# - Touch the screen at several locations and inspect the logs.
# - Expected coordinate range is approximately:
# - X: 0 to 1023
# - Y: 0 to 599
# - Portrait rotation and LVGL will be added after touch is confirmed.
# - This version intentionally does not yet configure: # - This version intentionally does not yet configure:
# - Ethernet # - Ethernet
# - Touchscreen
# - LVGL # - LVGL
# - Ambient light sensor # - Ambient light sensor
# - RTC # - RTC
# - Camera # - Camera
#:########################################################################################:# #:########################################################################################:#
# OFFLINE NOTES: # OFFLINE NOTES:
# - The display test is generated locally and does not require Home Assistant. # - Display rendering and touch detection operate locally.
# - Backlight control remains locally hosted by ESPHome. # - Home Assistant is not required for the display or touchscreen to work.
# - WiFi and Home Assistant are not required for the test text to remain visible. # - Backlight state is restored locally after restart.
#:########################################################################################:# #:########################################################################################:#
#:########################################################################################:# #:########################################################################################:#
@@ -66,12 +72,12 @@ substitutions:
# Device Naming # Device Naming
device_name: "esp-bedside-panel" device_name: "esp-bedside-panel"
friendly_name: "ESP Bedside Panel" friendly_name: "ESP Bedside Panel"
description_comment: "Guition JC1060P470C_I_W_Y ESP32-P4 7 inch bedside control panel. Corrected MIPI display test. (Layout V1.1)" description_comment: "Guition JC1060P470C_I_W_Y ESP32-P4 7 inch bedside control panel. Display and GT911 touchscreen test. (Layout V1.1)"
device_area: "Bedroom" # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. device_area: "Bedroom" # Allows ESP device to be automatically linked to an 'Area' in Home Assistant.
# Project Naming # Project Naming
project_name: "Guition.JC1060P470C_I_W_Y" # Project Details project_name: "Guition.JC1060P470C_I_W_Y" # Project Details
project_version: "v0.5" # Project V denotes release of yaml file, allowing checking of deployed vs latest version project_version: "v0.6" # Project V denotes release of yaml file, allowing checking of deployed vs latest version
# Passwords & Secrets # Passwords & Secrets
api_key: !secret esp-api_key # unfortunately you can't use substitutions inside secrets names api_key: !secret esp-api_key # unfortunately you can't use substitutions inside secrets names
@@ -84,6 +90,13 @@ substitutions:
# Display Settings # Display Settings
backlight_pin: "GPIO23" backlight_pin: "GPIO23"
backlight_frequency: "1220Hz" backlight_frequency: "1220Hz"
display_update_interval: "5s"
# Touchscreen Settings
touch_sda_pin: "GPIO7"
touch_scl_pin: "GPIO8"
touch_interrupt_pin: "GPIO21"
touch_reset_pin: "GPIO22"
#:########################################################################################:# #:########################################################################################:#
# PACKAGES: # PACKAGES:
@@ -233,6 +246,17 @@ time:
- platform: homeassistant - platform: homeassistant
id: ha_time id: ha_time
#:########################################################################################:#
# I2C:
# https://esphome.io/components/i2c.html
#:########################################################################################:#
i2c:
- id: touch_i2c
sda: "${touch_sda_pin}"
scl: "${touch_scl_pin}"
frequency: 400kHz
scan: true
#:########################################################################################:# #:########################################################################################:#
# OUTPUT: # OUTPUT:
# https://esphome.io/components/output/ledc.html # https://esphome.io/components/output/ledc.html
@@ -270,14 +294,14 @@ display:
number: GPIO5 number: GPIO5
rotation: 0 rotation: 0
hsync_pulse_width: 20 hsync_pulse_width: 20
update_interval: 5s update_interval: "${display_update_interval}"
auto_clear_enabled: true auto_clear_enabled: true
lambda: |- lambda: |-
it.fill(Color(8, 12, 18)); it.fill(Color(8, 12, 18));
it.printf( it.printf(
512, 512,
225, 185,
id(font_heading), id(font_heading),
Color::WHITE, Color::WHITE,
TextAlign::CENTER, TextAlign::CENTER,
@@ -286,22 +310,67 @@ display:
it.printf( it.printf(
512, 512,
305, 270,
id(font_normal), id(font_normal),
Color(0, 190, 255), Color(0, 190, 255),
TextAlign::CENTER, TextAlign::CENTER,
"Guition JC1060P470C_I_W_Y" "Touchscreen Test"
); );
it.printf( it.printf(
512, 512,
365, 335,
id(font_small), id(font_small),
Color(180, 180, 180), Color(180, 180, 180),
TextAlign::CENTER, TextAlign::CENTER,
"1024 x 600 MIPI-DSI Test" "Touch the screen and check the ESPHome logs"
); );
it.printf(
512,
390,
id(font_small),
Color(180, 180, 180),
TextAlign::CENTER,
"Expected range: X 0-1023 / Y 0-599"
);
#:########################################################################################:#
# TOUCHSCREEN:
# https://esphome.io/components/touchscreen/gt911.html
#:########################################################################################:#
touchscreen:
- platform: gt911
id: main_touchscreen
display: main_display
i2c_id: touch_i2c
address: 0x5D
interrupt_pin:
number: "${touch_interrupt_pin}"
mode:
input: true
reset_pin:
number: "${touch_reset_pin}"
mode:
output: true
on_touch:
then:
- lambda: |-
ESP_LOGI(
"touch",
"Touch detected: x=%d, y=%d, x_raw=%d, y_raw=%d",
touch.x,
touch.y,
touch.x_raw,
touch.y_raw
);
on_release:
then:
- logger.log:
level: INFO
format: "Touch released"
#:########################################################################################:# #:########################################################################################:#
# FONTS: # FONTS:
# https://esphome.io/components/font.html # https://esphome.io/components/font.html