From 91f4687c07884e56ffa9d3d57c266c8cca98fdff Mon Sep 17 00:00:00 2001 From: ducoterra Date: Tue, 18 Nov 2025 09:57:49 -0500 Subject: [PATCH] add esphome display notes --- active/device_esphome/esphome.md | 70 ++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/active/device_esphome/esphome.md b/active/device_esphome/esphome.md index 2d5fc56..b98da0a 100644 --- a/active/device_esphome/esphome.md +++ b/active/device_esphome/esphome.md @@ -25,6 +25,7 @@ - [light](#light) - [binary sensor](#binary-sensor) - [lambda](#lambda) + - [Display](#display) ## Install @@ -177,3 +178,72 @@ assist_pipeline: > you call any of ESPHome’s many APIs directly. For example, here we’re > retrieving the current state of the end stop using .state and using it to > construct our cover state. + +### Display + +Display pages + +```yaml +display: + - platform: st7735 + spi_id: spi_lcd + model: "INITR_MINI160X80" + reset_pin: GPIO1 + cs_pin: GPIO4 + dc_pin: GPIO2 + rotation: 270 + device_width: 82 + device_height: 161 + col_start: 0 + row_start: 0 + eight_bit_color: true + invert_colors: true + use_bgr: true + auto_clear_enabled: true + id: my_display + pages: + - id: page1 + lambda: |- + it.print(0, 10, id(font_roboto), "Connecting to"); + it.print(0, 30, id(font_roboto), "Home Assistant..."); + - id: page2 + lambda: |- + it.print(0, 10, id(font_roboto), "Configuring"); + it.print(0, 30, id(font_roboto), "sensors..."); + - id: page3 + lambda: |- + it.print(0, 10, id(font_roboto), "Loading"); + it.print(0, 30, id(font_roboto), "important"); + it.print(0, 50, id(font_roboto), "update..."); + - id: page4 + lambda: |- + it.image(0, 0, id(my_image), COLOR_OFF, COLOR_ON); +``` + +Switch pages + +```yaml +interval: + - interval: 5s + then: + - display.page.show_next: my_display + - component.update: my_display +``` + +Show an image + +```yaml +image: + - file: "test_tdongle_image.png" + type: RGB + id: my_image +``` + +Specify a font + +```yaml +font: + - file: "gfonts://Roboto" + id: font_roboto + size: 20 +```