Hallo! Bei mir funktioniert das Display.


esphome:
name: 3-esp32-s3-display-test
friendly_name: 3 ESP32 S3 Display Test
platformio_options:
build_flags: "-DBOARD_HAS_PSRAM"
board_build.arduino.memory_type: qio_opi
esp32:
board: esp32-s3-devkitc-1
framework:
type: arduino
# Enable logging
logger:
level: ERROR # ERROR weniger Ausgaben durch das Display, beim programmieren auf auf DEBUG stellen
# Enable Home Assistant API
api:
encryption:
key: "HIER DEINEN KEY VERWENDEN"
ota:
- platform: esphome
password: "HIER DEIN PASSWORT VERWENDEN"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "3-Esp32-S3-Display-Test"
password: "HIER DEIN PASSWORT VERWENDEN"
captive_portal:
# http://wiki.fluidnc.com/en/hardware/ESP32-S3_Pin_Reference
spi:
clk_pin: GPIO12 # Display auf Pin SCL
mosi_pin: GPIO11 # Display auf Pin SDA
miso_pin: GPIO13 # nicht verwendet - es gibt keine Daten vom Display zum ESP
display:
- platform: ili9xxx # Display 3 OHNE TOUCH
id: display3
model: GC9A01A # rund 240x240 Pixel
cs_pin: GPIO17 # Display auf Pin CS
dc_pin: GPIO10 # Display auf Pin DC
reset_pin: GPIO41 # Display auf Pin RST
rotation: 180° # Pins oben
invert_colors: true
update_interval: 1s
lambda: |-
// Modellbezeichnung anzeigen
it.print(75, 40, id(arial20), id(weiss), "GC9A01A");
// Wifi Signal und Uhrzeit anzeigen
it.strftime(80, 80, id(arial20), id(hellblau), "%H:%M:%S", id(zeit).now());
it.printf(80, 120, id(arial20), id(hellblau), "%.0f%%", id(wifi_signal_Prozent).state);
it.print(60, 120, id(icon20), id(hellblau), "\U000F05A9"); // WIFI (wifi)
// und ein paar sinnlose Darstellungen
it.filled_ring(120, 120, 100, 110, gelb);
it.filled_ring(120, 120, 110, 120, hellblau);
it.filled_rectangle(80, 150, 20, 20, rot);
it.print(130, 100, id(icon80), id(gelb), "\U000F0599"); // Sonne (weather-sunny)
it.print(90, 160, id(icon80), id(orange), "\U000F01F5"); // Smile (emoticon-happy-outline)
###### FARBEN ###### # https://www.farb-tabelle.de/de/farbtabelle.htm
color:
- id: rot
red_int: 255
green_int: 0
blue_int: 0
- id: gruen
hex: 00FF00
- id: dunkelgruen
red_int: 0
green_int: 170
blue_int: 0
white_int: 0
- id: blau
hex: 0000FF
- id: hellblau
hex: 8EE5EE
- id: gelb
hex: FFFF00
- id: orange
hex: FFA500
- id: braun
hex: A52A2A
- id: magenta
hex: FF00FF
- id: grau
hex: BEBEBE
- id: weiss
red_int: 255
green_int: 255
blue_int: 255
###### SCHRIFTARTEN ######
font:
- file: "arial.ttf"
id: arial10
size: 10
- file: "arial.ttf"
id: arial15
size: 15
- file: "arial.ttf"
id: arial20
size: 20
- file: "arial.ttf"
id: arial25
size: 25
- file: "arial.ttf"
id: arial40
size: 40
- file: "arial.ttf"
id: arial80
size: 80
- file: "materialdesignicons-webfont.ttf" # https://pictogrammers.com/library/mdi/
id: icon80
size: 80
glyphs: [
"\U000F0599", # Sonne (weather-sunny)
"\U000F05A9", # WIFI (wifi)
"\U000F01F5", # Smile (emoticon-happy-outline)
]
- file: "materialdesignicons-webfont.ttf" # https://pictogrammers.com/library/mdi/
id: icon20
size: 20
glyphs: [
"\U000F0599", # Sonne (weather-sunny)
"\U000F05A9", # WIFI (wifi)
"\U000F01F5", # Smile (emoticon-happy-outline)
]
sensor:
- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "WiFi Signal dB"
id: wifi_signal_db
update_interval: 60s
entity_category: "diagnostic"
- platform: copy # Reports the WiFi signal strength in %
source_id: wifi_signal_db
name: "WiFi Signal Percent"
id: wifi_signal_Prozent
filters:
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
unit_of_measurement: "Signal %"
entity_category: "diagnostic"
device_class: ""
time:
- platform: homeassistant
id: zeit
Und als Uhr aber mit dem Ziffernblatt als Bild. Das Zifferblatt könnte man natürlich auch zeichnen.
esphome:
name: 3-esp32-s3-display-test
friendly_name: 3 ESP32 S3 Display Test
platformio_options:
build_flags: "-DBOARD_HAS_PSRAM"
board_build.arduino.memory_type: qio_opi
esp32:
board: esp32-s3-devkitc-1
framework:
type: arduino
# Enable logging
logger:
level: ERROR # ERROR weniger Ausgaben durch das Display, beim programmieren auf auf DEBUG stellen
# Enable Home Assistant API
api:
encryption:
key: " DEIN KEY"
ota:
- platform: esphome
password: "DEIN PASSWORT"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "3-Esp32-S3-Display-Test"
password: "DEIN PASSWORT"
captive_portal:
image:
- file: "Zifferblatt.png" # im Internet gefunden - sollte durchsichtig sein!
id: zifferblatt
type: RGB565
resize: 240x240 # Falls nötig
# http://wiki.fluidnc.com/en/hardware/ESP32-S3_Pin_Reference
spi:
clk_pin: GPIO12 # Display auf Pin SCL
mosi_pin: GPIO11 # Display auf Pin SDA
miso_pin: GPIO13 # nicht verwendet
display:
- platform: ili9xxx # Display 3 OHNE TOUCH
id: display3
model: GC9A01A # rund 240x240 Pixel
cs_pin: GPIO17 # Display auf Pin CS
dc_pin: GPIO10 # Display auf Pin DC
reset_pin: GPIO41 # Display auf Pin RST
rotation: 180° # Pins oben
invert_colors: true
update_interval: 1s
lambda: |-
it.image(0, 0, id(zifferblatt)); // Zeigt das Zifferblatt an
// Mittelpunkt des Displays
const int center_x = 120;
const int center_y = 120;
const int radius = 110;
// Hintergrund alle Stunde neu zeichnen (Ziffernblatt)
if (id(home_time).now().minute == 0 && id(home_time).now().second == 0) {
it.fill(schwarz); // Bildschirm löschen
// Ziffernblatt zeichnen
for (int h = 0; h < 12; h++) {
float angle = (h * 30) * (M_PI / 180); // 30° pro Stunde
int x1 = center_x + (radius - 10) * cos(angle);
int y1 = center_y + (radius - 10) * sin(angle);
int x2 = center_x + radius * cos(angle);
int y2 = center_y + radius * sin(angle);
it.line(x1, y1, x2, y2, weiss); // Weiße Stundenmarken
}
}
// Aktuelle Zeit abrufen
int hour = id(home_time).now().hour % 12; // 12-Stunden-Format
int minute = id(home_time).now().minute;
int second = id(home_time).now().second;
// WICHTIG: 90° versetzt, weil 0° in Mathe auf der x-Achse liegt!
float offset = -M_PI / 2;
// Zeigerlängen
const int hour_length = 50;
const int minute_length = 80;
const int second_length = 90;
// Winkelberechnung
float hour_angle = (hour * 30 + minute * 0.5) * (M_PI / 180) + offset;
float minute_angle = (minute * 6) * (M_PI / 180) + offset;
float second_angle = (second * 6) * (M_PI / 180) + offset;
// Zeiger zeichnen
it.line(center_x, center_y, center_x + hour_length * cos(hour_angle), center_y + hour_length * sin(hour_angle), weiss);
it.line(center_x, center_y, center_x + minute_length * cos(minute_angle), center_y + minute_length * sin(minute_angle), weiss);
it.line(center_x, center_y, center_x + second_length * cos(second_angle), center_y + second_length * sin(second_angle), rot);
// zur Kontrolle - Digitalzeit anzeigen
//it.strftime(80, 80, id(arial20), id(hellblau), "%H:%M:%S", id(home_time).now());
###### FARBEN ###### # https://www.farb-tabelle.de/de/farbtabelle.htm
color:
- id: schwarz
red_int: 0
green_int: 0
blue_int: 0
- id: rot
red_int: 255
green_int: 0
blue_int: 0
- id: gruen
hex: 00FF00
- id: dunkelgruen
red_int: 0
green_int: 170
blue_int: 0
white_int: 0
- id: blau
hex: 0000FF
- id: hellblau
hex: 8EE5EE
- id: gelb
hex: FFFF00
- id: orange
hex: FFA500
- id: braun
hex: A52A2A
- id: magenta
hex: FF00FF
- id: grau
hex: BEBEBE
- id: weiss
red_int: 255
green_int: 255
blue_int: 255
###### SCHRIFTARTEN ######
font:
- file: "arial.ttf"
id: arial10
size: 10
- file: "arial.ttf"
id: arial15
size: 15
- file: "arial.ttf"
id: arial20
size: 20
- file: "arial.ttf"
id: arial25
size: 25
- file: "arial.ttf"
id: arial40
size: 40
- file: "arial.ttf"
id: arial80
size: 80
- file: "materialdesignicons-webfont.ttf" # https://pictogrammers.com/library/mdi/
id: icon80
size: 80
glyphs: [
"\U000F0599", # Sonne (weather-sunny)
"\U000F05A9", # WIFI (wifi)
"\U000F01F5", # Smile (emoticon-happy-outline)
]
- file: "materialdesignicons-webfont.ttf" # https://pictogrammers.com/library/mdi/
id: icon20
size: 20
glyphs: [
"\U000F0599", # Sonne (weather-sunny)
"\U000F05A9", # WIFI (wifi)
"\U000F01F5", # Smile (emoticon-happy-outline)
]
sensor:
- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "WiFi Signal dB"
id: wifi_signal_db
update_interval: 60s
entity_category: "diagnostic"
- platform: copy # Reports the WiFi signal strength in %
source_id: wifi_signal_db
name: "WiFi Signal Percent"
id: wifi_signal_Prozent
filters:
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
unit_of_measurement: "Signal %"
entity_category: "diagnostic"
device_class: ""
time:
- platform: homeassistant
id: home_time