I got ESPhome working with the Adafruit ESP32-S3 Reverse TFT Feather. The trick is the on_boot, that has to be on sooner than the “platform: st7789v” can turn it on.
substitutions:
devicename: displayer
prettyname: "Displayer"
mqttroot: "displayer"
area: "EE Lab"
esphome:
name: ${devicename}
friendly_name: ${prettyname}
on_boot:
priority: 1000
then:
# The following lambda turns on the TFT/I2C Power
- lambda: |-
pinMode(7, OUTPUT);
digitalWrite(7, HIGH);
delay(10);
esp32:
board: adafruit_feather_esp32s3_tft
variant: esp32s3
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "9oMpk+/eAp2XkL90TwPdRNWd+s="
ota:
- platform: esphome
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
web_server:
port: 80
captive_portal:
color:
- id: my_red
red: 100%
green: 0%
blue: 0%
- id: my_yellow
red: 100%
green: 100%
blue: 0%
- id: my_green
red: 0%
green: 100%
blue: 0%
- id: my_blue
red: 0%
green: 0%
blue: 100%
- id: my_gray
red: 50%
green: 50%
blue: 50%
font:
- file: "gfonts://Roboto"
id: font20
size: 20
- file: "gfonts://Roboto"
id: large
size: 55
- file: "gfonts://Roboto"
id: medium
size: 35
- file: "gfonts://Roboto"
id: roboto
size: 20
binary_sensor:
- platform: status
name: "Node Status"
id: system_status
i2c:
sda: 3
scl: 4
scan: true
sensor:
- platform: sht4x
temperature:
name: "Temp"
id: thermostat_temp
humidity:
name: "Humidity"
id: thermostat_humidity
update_interval: 5s
time:
- platform: homeassistant
id: esptime
spi:
clk_pin: GPIO36
mosi_pin: GPIO35
miso_pin: GPIO37
interface: software # force_sw: true
display:
- platform: st7789v
model: TTGO TDisplay 135x240
backlight_pin: GPIO45
rotation: 90
cs_pin: GPIO42
dc_pin: GPIO40
reset_pin: GPIO41
update_interval: 1s
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height(), id(my_blue));
it.rectangle(0, 25, it.get_width(), it.get_height(), id(my_blue));
it.print(5, 5, id(font20), id(my_yellow), TextAlign::TOP_LEFT, "HELLO");
if (id(system_status).state) {
it.print(235, 5, id(font20), id(my_green), TextAlign::TOP_RIGHT, "Online");
}
else {
it.print(235, 5, id(font20), id(my_red), TextAlign::TOP_RIGHT, "Offline");
}
it.printf((240 / 2), (140 / 6) * 1 + 5, id(large), id(my_green), TextAlign::TOP_CENTER, "%.1f °C", id(thermostat_temp).state);
it.printf(5, (140 / 6) * 3 + 10, id(medium), id(my_green), TextAlign::TOP_LEFT, "%.1f °F", id(thermostat_temp).state*9/5+32);
it.printf(235, (140 / 6) * 3 + 10, id(medium), id(my_blue), TextAlign::TOP_RIGHT, "%.1f%%", id(thermostat_humidity).state);