Hi,
I bought an ESP32-C6 with the 172*320 pixels touchscreen and I thought, it would be easy to get it working, but I failed. Actually, I am trying yaml codes randomly because I lost track and I can not longer work on a solution in a structured manner, because I lost track.
I added it in ESPHome Builder. The device is online.
In the esphome setings, I cheked this two boxes:
I got an working entity (backlight on/off) but thats all. I dont get any response/text.
I am absolutely frustrated and have spent a lot more than 10 hours from saturday until now.
Can somebody please check/correct my code?
Please response with the full working code, not just parts. I dont want to make any stupid mistakes.
I found some help here, with zugbee/matter. I am fine with wifi for the beginning.
esphome:
name: esp32-c6-147inch
friendly_name: "Mini Display"
on_boot:
then:
- switch.turn_on: screen_switch
esp32:
board: esp32-c6-devkitc-1
framework:
type: esp-idf
# --- NETZWERK & API ---
wifi:
ssid: "qwertz"
password: "12345678"
ap:
ssid: "Mini Display Fallback Hotspot"
password: "87654321"
captive_portal:
logger:
api:
encryption:
key: "fweiommndfreinegiurniuoenr"
ota:
- platform: esphome
password: "ffpssfrwefwromowem"
spi:
clk_pin: GPIO7
mosi_pin: GPIO6
output:
- platform: gpio
id: backlight_output
pin: GPIO22
font:
- file: "gfonts://Roboto"
id: buero_font
size: 20
switch:
- platform: template
name: "Display ON/OFF"
id: screen_switch
icon: mdi:screen-rotation
optimistic: true
turn_on_action:
- output.turn_on: backlight_output
turn_off_action:
- output.turn_off: backlight_output
- platform: template
name: "Antiburn Modus"
id: switch_antiburn
icon: mdi:television-shimmer
optimistic: true
entity_category: "config"
turn_on_action:
- logger.log: "Start Pixel-cleaning"
turn_off_action:
- logger.log: "end Pixel-cleaning"
time:
- platform: homeassistant
on_time:
- hours: 2,3,4,5
minutes: 5
seconds: 0
then:
- switch.turn_on: switch_antiburn
- hours: 2,3,4,5
minutes: 35
seconds: 0
then:
- switch.turn_off: switch_antiburn
number:
- platform: template
name: "Screen Timeout"
optimistic: true
id: display_timeout
unit_of_measurement: "s"
initial_value: 45
restore_value: true
min_value: 10
max_value: 180
step: 5
mode: box
display:
- platform: st7789v
id: mein_display
model: CUSTOM
height: 320
width: 172
offset_height: 34
offset_width: 0
cs_pin: GPIO14
dc_pin: GPIO15
reset_pin: GPIO21
spi_mode: 3
data_rate: 4MHz
pages:
- id: seite_1
lambda: |-
it.fill(Color(0, 0, 0));
// (x=11, y=110, breite=150, höhe=100)
it.filled_rectangle(11, 110, 150, 100, Color(0, 0.4, 0.8));
it.printf(86, 160, id(buero_font), Color(1, 1, 1), TextAlign::CENTER, "Licht Büro");


