I saw this the other day and thought to myself, “there is another piece of cool crap I don’t need, buut as so the story goes…
Has a cool1.4” screen with a whooping 16mb of flash, convenient usb a form factor, meaning that that this WILL be very convenient as a room multisensor that can be plugged in to the wall, profit .
After getting it, realized I don’t know anything about this screen (aka spi bus pins and so) and the wiki and almost inexistent github official WaveShare presence, offered very little information (just an observation as this being my first experience with this manufacturer).
Searched around, but did not find any post, mention or even similar, so I guess I 'd throw stuff to the wall to see if it would stick, and it did.
This is how I made it initialize the display(and other stuff I’d learn thanks to other posting here), hope is of use for someone:
esphome:
name: esp32-s3-geek
friendly_name: ESP32-S3-GEEK
# libraries:
# - SPI
# - FS
# - SPIFFS
# - TFT_eSPI
platformio_options:
board_build.flash_mode: dio
board_build.f_flash: 80000000L
# board_build.partitions: default_16MB.csv
board_build.arduino.memory_type: qio_opi
build_flags:
- "-D FORECAST_DAYS=5"
# on_boot:
# # - priority: -100 # after all init
# # then:
# # - media_player.volume_set: 8%
# - priority: 250.0 # after sensor WIFI initialization
# then:
# - wait_until:
# condition:
# wifi.connected:
# - lambda: >
# id(bletracker).set_scan_continuous(true);
# id(bletracker).start_scan();
esp32:
board: esp32-s3-devkitc-1
#board: esp32s3box
framework:
type: esp-idf
version: recommended
flash_size: 16MB
variant: ESP32S3
# esp32_ble_tracker:
# id: bletracker
# scan_parameters:
# continuous: false
# active: true
# bluetooth_proxy:
# active: true
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
encryption:
key: !secret api
ota:
password: !secret ota
wifi:
#use_address: 10.0.2.149
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: on
#power_save_mode: none
time:
- platform: homeassistant
id: time_ha
output:
- platform: ledc
pin: GPIO7
id: gpio7
frequency: 2000
light:
- platform: monochromatic
output: gpio7
name: "Backlight"
id: displaybacklight
icon: mdi:brightness-7
restore_mode: RESTORE_AND_ON
binary_sensor:
- platform: gpio
pin:
number: GPIO0
inverted: true
name: "Button 1"
id: button1
spi:
clk_pin: 12
mosi_pin: 11
display:
- platform: ili9xxx
model: 'TFT 2.4' # 'TFT 2.4' worked with esp32-s3-geek
#model: WAVESHARE_RES_3_5
dimensions:
height: 240
width: 135
offset_height: 40
offset_width: 53
transform:
swap_xy: true
# mirror_x: false
# mirror_y: false
color_order: rgb
data_rate: 80MHz
cs_pin: GPIO10
dc_pin: GPIO8
reset_pin: GPIO9
#spi_mode: MODE3
invert_colors: true
pages:
- id: weather
lambda: |-
// clear screen
it.clear();
// draw the time up top
std::string time = id(time_ha).now().strftime("%I:%M");
std::string dayofweek = id(time_ha).now().strftime("%a, %b %e");
it.print(0, 0, id(font1), id(color_green), TextAlign::TOP_LEFT, time.c_str());
it.print(2, 40, id(font2), id(color_white), TextAlign::TOP_LEFT, dayofweek.c_str());
font:
- file: 'slkscr.ttf'
id: font1
size: 40
- file: 'BebasNeue-Regular.ttf'
id: font2
size: 30
- file: 'arial.ttf'
id: font3
size: 14
color:
- id: color_light_grey
hex: BBBBBB
- id: color_dark_grey
hex: 5F5F5F
- id: color_white
hex: FFFFFF
- id: color_red
hex: FF0000
- id: color_green
hex: 14FF00
- id: color_yellow
hex: FFFF00