This is an ESPHome package for the waveshare-esp32-s3-touch-lcd-7 display. The main idea is that all the boilerplate code is already done in the package and you can focus on the logic that makes your project special.
The package will:
- setup the correct esp32 and esphome settings
- setup the display and touchscreen
- add an empty
lvglcomponent - add a
light.lcdbacklightand aswitch.antiburn - automatically run the antiburn protection when the backlight is off
- exposes the LCD Backlight light and Antiburn switch as disabled switches to Home Assistant
You can then add your own sensors and lvgl setup.
The package requires ESPHome version 2025.4.2 or greater, because I've not tested it with any older versions.
- Load the
waveshare-esp32-s3-touch-lcd-7.yamlfile as described in the ESPHome documentation (or see theclock.yamldemo). - Add any sensors you want.
- Add
lvglwidgets. - Make sure to turn off the
light.lcdbacklightonce in a while for at least 30 min, so that the antiburn protection can do its thing.
If you want to control the brightness of the display you'll need to do some soldering. There's a testpoint thatneeds to be soldered to a ESP32 pin. See this thread for how to do that.
Here's my attempt (make sure the red wire is isolated, to prevent a shortciruit! I've taped it off with electric tape.)
Once you've done that you can use the waveshare-esp32-s3-touch-lcd-7-brightness.yaml file instead, and you'll be able to to adapt the brightness of you display. See the clock-brightness.yaml demo for an example.
The brightness file has three variables you can set:
backlight_brightness_pin: defaults toGPIO16, which is the one I've used in the image above. If you have soldered the testpoint to another pin you'll need to give the correct one here.initial_brightness: Set the brightness of the display on boot (float between0.0and1.0, defaults to0.8).min_power: I've noticed that my display will be dark for a large part of the brightness range, to fix this I set this variable (float between0.0and1.0, defaults to0.07).
If you set these variables make sure to quote the floats, else things might break.
Using the brightness file adds a new light.lcdbacklight_brightness now you can use this to change the backlight brightness and turn on/off the backlight. You don't need to care about light.lcdbacklight anymore and can keep it on all the time.
The exposed LCD Backlight in Home Assistant will now also allow you to change the brightness of the display.
I'd like to thank everyone in the main thread on the display and in the thread on brightness adjustment, who did the main work of figuring everything out around this display.
I'd especially like to thank: