The link you gave covers two versions of the display. I have been using version 2 for several months with ESPHome and Home Assistant. My code to display my Blood Glucose:
# Uses the following devices
# - LilyGo T-Display S3 AMOLED with Touch
# - Blood_Sugar sensor from Home Assistant NightScout Integration
# touchscreen:
# platform: cst816
# display:
# - platform: qspi_amoled
# model: RM67162
substitutions:
disp_name: CGM Display Amoled
esphome:
name: cgm-display-amoled
friendly_name: CGM Display Amoled
platformio_options:
build_unflags: -Werror=all
board_build.flash_mode: dio
esp32:
board: esp32-s3-devkitc-1
variant: esp32s3
framework:
type: esp-idf
logger:
level: error
api:
ota:
web_server:
port: 80
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "CDM Display Amoled"
spi:
id: quad_spi
type: quad
clk_pin: 47
data_pins: [18, 7, 48, 5]
i2c:
sda: 3
scl: 2
touchscreen:
- platform: cst816
id: my_touchscreen
interrupt_pin:
number: 21
transform:
mirror_x: true
swap_xy: true
on_touch:
- lambda: |-
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%d",
touch.x,
touch.y,
touch.x_raw,
touch.y_raw
);
- logger.log:
format: Touch %d at (%d, %d)
args: [touch.id, touch.x, touch.y]
- display.page.show_next: my_display
color:
- id: my_black
red: 0%
green: 0%
blue: 0%
- id: my_red
hex: fc0000
- id: my_green
hex: 00fc4c
- id: my_yellow
hex: e0e637
- id: my_orange
hex: ff7728
- id: my_white
hex: ffffff
font:
- file: 'fonts/arialbd.ttf'
id: font1
size: 144
- file: 'fonts/roboto.ttf'
id: font2
size: 45
graph:
- id: blood_glucose_graph
duration: 2h
x_grid: 15min
y_grid: 50.0
max_value: 400
min_value: 50
width: 500
height: 200
traces:
- sensor: blood_sugar
line_type: SOLID
continuous: true
line_thickness: 3
color: my_green
display:
- platform: qspi_amoled
id: my_display
model: RM67162
dimensions:
height: 240
width: 536
offset_height: 0
offset_width: 0
transform:
mirror_x: true
mirror_y: false
swap_xy: true
color_order: rgb
brightness: 150
cs_pin: 6
reset_pin: 17
enable_pin: 38
pages:
- id: page1
lambda: |-
it.filled_rectangle(0, 0, 536, 240, my_black);
if (id(blood_sugar).has_state()) {
if (id(blood_sugar).state < 55.0) {
it.printf(268, 100, id(font1), id(my_red), TextAlign::CENTER, "%.0f", id(blood_sugar).state);
}
if ((id(blood_sugar).state >= 55.0) && (id(blood_sugar).state < 70.0)) {
it.printf(268, 100, id(font1), id(my_yellow), TextAlign::CENTER, "%.0f", id(blood_sugar).state);
}
if ((id(blood_sugar).state >= 70.0) && (id(blood_sugar).state < 180.0)) {
it.printf(268, 100, id(font1), id(my_green), TextAlign::CENTER, "%.0f", id(blood_sugar).state);
}
if ((id(blood_sugar).state >= 180.0) && (id(blood_sugar).state < 250.0)) {
it.printf(268, 100, id(font1), id(my_yellow), TextAlign::CENTER, "%.0f", id(blood_sugar).state);
}
if (id(blood_sugar).state >= 250.0) {
it.printf(268, 100, id(font1), id(my_orange), TextAlign::CENTER, "%.0f", id(blood_sugar).state);
}
}
it.strftime(10, 235, id(font2), id(my_white), TextAlign::BOTTOM_LEFT, "%I : %M %p", id(esptime).now());
- id: page2
lambda: |-
it.graph(10, 20, id(blood_glucose_graph), my_yellow);
psram:
mode: octal
time:
- platform: homeassistant
id: esptime
switch:
- platform: restart
name: ${disp_name} Restart
sensor:
- platform: homeassistant
id: blood_sugar
entity_id: sensor.blood_sugar
accuracy_decimals: 0
unit_of_measurement: mg/dL
- platform: wifi_signal
name: ${disp_name} WiFi Status
update_interval: 10s
captive_portal:
They are working on changes that will allow you to use LVGL with this display and should be added shortly in the June or July release.