Unable to get a GS-T3E panel working with ESPHome

I purchased this panel which is reported to work with OpenHasp (Golden Security - openHASP), but I’m unable to get it working with ESPHome.

I’ve installed on it the OpenHasp firmware (GS-T3E v2.3 from https://nightly.openhasp.com/) using https://web.esphome.io/ and the panel works fine.

If I install the ESPHome firmware immediately afterwards and without switching it off, it works, but when I switch it off, the display no longer works (I see nothing on the screen), while the backlight and touch screen work.

In fact, pressing the buttons on the screen opens/closes the relays.
I access the web page and see the actions tracked in the logs.

Evidently my configuration is incomplete and does not work on its own, but only after setting up the device correctly with the openHasp firmware (at least I assume so).

Is anyone able to suggest how I can get out of this impasse?

This is the configuration file I’ve defined:

substitutions:
  name: "t3e-edd450"
  friendly_name: "PanelT3E.1"
  device_description: "T3E ESP32-S3 480*480 Smart panel"
  project_name: "T3E.ESP32-S3"
  project_version: "0.1.0"
  
  lightbulb:     "\U000F0335"
  ceiling_light: "\U000F0769"
  lamp:          "\U000F06B5"
  floor_lamp:    "\U000F08DD"
  string_lights: "\U000F12BA"

  icon_font: light40
  text_font: roboto24  
  button_on_color: "0xCC5E14"
  icon_on_color: "0xFFFF00"
  button_off_color: "0x313131"
  icon_off_color: "0xB6B6B6"
  button_hight_single: '109px'
  button_hight_double: '228px'
  
  button_1_name: "Relay 1"
  button_1_id: relay1
  button_1_icon: $lightbulb
  button_1_HAdevice: $button_1_id  

  button_2_name: "Relay 2"
  button_2_id: relay2
  button_2_icon: $lightbulb
  button_2_HAdevice: $button_2_id  

  button_3_name: "Relay 3"
  button_3_id: relay3
  button_3_icon: $lightbulb
  button_3_HAdevice: $button_3_id  

esphome:
  name: "${name}"
  friendly_name: "${friendly_name}"
  min_version: 2024.7.0
  #name_add_mac_suffix: true
  project:
    name: "${project_name}"
    version: "${project_version}"    
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  flash_size: 16MB
  framework:
    type: esp-idf
    sdkconfig_options:
      COMPILER_OPTIMIZATION_SIZE: y
      CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
      CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
      CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"
      CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
      CONFIG_SPIRAM_RODATA: y

psram:
  mode: octal
  speed: 80MHz

logger:
  level: verbose
  logs:
    i2c.idf: info
    touchscreen: info
    scheduler: none
    lvgl: debug
    wifi: INFO


api:
  encryption:
    key: !secret api_encryption_key 
ota:
  platform: esphome
web_server:
  port: 80
  version: 3  
wifi:
  networks:
    - ssid: !secret wifi_ssid
      password: !secret wifi_password 

external_components:
  - source: github://pr#6363 # Previous commit - wont be needed once this code is relaased
    refresh: 10min
    components: [lvgl]

sensor:
  - platform: wifi_signal
    name: "WiFi Signal"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: diagnostic
    internal: true

  # Reports the WiFi signal strength in %
  - platform: copy
    source_id: wifi_signal_db
    name: "WiFi Strength"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "%"
    entity_category: diagnostic
    
text_sensor:
  - platform: wifi_info
    ip_address:
      name: "IP Address"
      entity_category: diagnostic
    ssid:
      name: "Connected SSID"
      entity_category: diagnostic
    mac_address:
      name: "Mac Address"
      entity_category: diagnostic
 

#-------------------------------------------
# Internal outputs
#-------------------------------------------
output:
    # Backlight LED
  - platform: ledc
    pin: GPIO42
    id: GPIO42
    frequency: 100Hz
    
    # Built in 240v relay1
  - id: internal_relay_1
    platform: gpio
    pin: 45

  #   Built in 240v relay2
  - id: internal_relay_2
    platform: gpio
    pin: 46

  #   Built in 240v relay3
  - id: internal_relay_3
    platform: gpio
    pin: 44

#-------------------------------------------
# Internal light
#-------------------------------------------
light:
  - platform: monochromatic
    output: GPIO42
    name: Backlight
    id: backlight
    restore_mode: ALWAYS_ON

  - platform: binary
    output: internal_relay_1
    name: $button_1_name
    id: $button_1_id
    on_turn_on:
      then:
        - lvgl.widget.update:
            id: lv_button_1_icon
            text_color: 0xFFFF00
        - lvgl.widget.update:
            id: lv_button_1
            state:
              checked: true            
    on_turn_off:
      then:
        - lvgl.widget.update:
            id: lv_button_1_icon
            text_color: 0xB6B6B6
        - lvgl.widget.update:
            id: lv_button_1
            state:
              checked: false             

  - platform: binary
    output: internal_relay_2
    name: $button_2_name
    id: $button_2_id
    on_turn_on:
      then:
        - lvgl.widget.update:
            id: lv_button_2_icon
            text_color: 0xFFFF00
        - lvgl.widget.update:
            id: lv_button_2
            state:
              checked: true            
    on_turn_off:
      then:
        - lvgl.widget.update:
            id: lv_button_2_icon
            text_color: 0xB6B6B6
        - lvgl.widget.update:
            id: lv_button_2
            state:
              checked: false             

  - platform: binary
    output: internal_relay_3
    name: $button_3_name
    id: $button_3_id
    on_turn_on:
      then:
        - lvgl.widget.update:
            id: lv_button_3_icon
            text_color: 0xFFFF00
        - lvgl.widget.update:
            id: lv_button_3
            state:
              checked: true            
    on_turn_off:
      then:
        - lvgl.widget.update:
            id: lv_button_3_icon
            text_color: 0xB6B6B6
        - lvgl.widget.update:
            id: lv_button_3
            state:
              checked: false             



#-------------------------------------------
# LVGL Buttons
#-------------------------------------------    
lvgl:
  id: my_lvgl
  displays:
    - display_id: my_display
  touchscreens:
    - touchscreen_id: my_touchscreen
  on_idle:
    - timeout: 10s
      then:
        - logger.log: idle timeout
        - if:
            condition:
              lvgl.is_idle:
                timeout: 5s
            then:
              - logger.log: LVGL is idle
    - timeout: 15s
      then:
        - logger.log: idle 15s timeout
        - lvgl.pause:
            id: my_lvgl
        - light.turn_off:
            id: backlight
            transition_length: 5s    

  style_definitions:
    - id: style_line
      line_color: 0x0000FF
      line_width: 8
      line_rounded: true
    - id: date_style
      text_font: roboto24
      align: center
      text_color: 0x333333
      bg_opa: cover
      radius: 4
      pad_all: 2

  theme:
    button:
      text_font: roboto24
      scroll_on_focus: true
      group: general
      radius: 10
      width: 150
      height: 109
      pad_left: 10px
      pad_top: 10px
      pad_bottom: 10px
      pad_right: 10px
      shadow_width: 0
      bg_color: 0x313131
      text_color: 0xB6B6B6
      checked:
        bg_color: 0xCC5E14
        text_color: 0xB6B6B6

  page_wrap: true
  pages:
    - id: main_page
      skip: true
      layout: 
        type: flex
        flex_flow: column_wrap
      width: 100%
      bg_color: 0x000000
      bg_opa: cover
      pad_all: 5
      widgets:
        - button:
            height: $button_hight_double
            checkable: true
            id: lv_button_1
            widgets:
              - label:
                  text_font: $icon_font
                  align: top_left
                  text: $button_1_icon
                  id: lv_button_1_icon
              - label:
                  align: bottom_left
                  text: $button_1_name
            on_click:
                 light.toggle: $button_1_HAdevice
        - button:
            height: $button_hight_double
            checkable: true
            id: lv_button_2
            widgets:
              - label:
                  text_font: $icon_font
                  align: top_left
                  text: $button_2_icon
                  id: lv_button_2_icon
              - label:
                  align: bottom_left
                  text: $button_2_name
            on_click:
                 light.toggle: $button_2_HAdevice
        - button:
            height: $button_hight_double
            checkable: true
            id: lv_button_3
            widgets:
              - label:
                  text_font: $icon_font
                  align: top_left
                  text: $button_3_icon
                  id: lv_button_3_icon
              - label:
                  align: bottom_left
                  text: $button_3_name
            on_click:
                 light.toggle: $button_3_HAdevice
              


#-------------------------------------------
# Graphics and Fonts
#-------------------------------------------
font:
  - file: "gfonts://Roboto"
    id: roboto24
    size: 24
    bpp: 4
    extras:
      # http://materialdesignicons.com/cdn/7.4.47/
      - file: 'https://github.com/Templarian/MaterialDesign-Webfont/raw/v7.4.47/fonts/materialdesignicons-webfont.ttf'
        glyphs: [
          "\U000F004B",
          "\U0000f0ed",
          "\U000F006E",
          "\U000F012C",
          "\U000F179B",
          "\U000F0748",
          "\U000F1A1B",
          "\U000F02DC",
          "\U000F0A02",
          "\U000F035F",
          "\U000F0156",
          "\U000F0C5F",
          "\U000f0084",
          "\U000f0091",
        ]

  # http://materialdesignicons.com/cdn/7.4.47/
  - file: 'https://github.com/Templarian/MaterialDesign-Webfont/raw/v7.4.47/fonts/materialdesignicons-webfont.ttf'
    id: light40
    size: 40
    bpp: 4
    glyphs: [
      "\U000F0335",  # mdi-lightbulb
      "\U000F0769",  # mdi-ceiling-light
      "\U000F06B5",  # mdi-lamp
      "\U000F08DD",  # mdi-floor-lamp
      "\U000F12BA",  # mdi-string-lights
    ]       
   

#-------------------------------------------
# Touchscreen gt911 i2c
#-------------------------------------------
i2c:
  - id: bus_a
    sda: GPIO07 
    scl: GPIO06 
    #frequency: 100kHz
    
touchscreen:
  platform: gt911
  transform:
    mirror_x: false
    mirror_y: false
  id: my_touchscreen
  display: my_display

  on_touch:
    then:
      - lvgl.resume:
          id: my_lvgl
      - lvgl.page.show:
          id: main_page
      - if:
          condition:
            light.is_off:
              id: backlight
          then:
            - light.turn_on:
                id: backlight
                transition_length: 0.2s
      - logger.log:
          format: Touch at (%d, %d)
          args: [touch.x, touch.y]
      - lambda: |-
            ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
                touch.x,
                touch.y,
                touch.x_raw,
                touch.y_raw
                );
            

#-------------------------------------------
# Display st7701s spi
#-------------------------------------------
spi:
  - id: lcd_spi
    clk_pin: 
      number: GPIO15 # tentavive
      allow_other_uses: true
    mosi_pin: 
      number: GPIO48 # tentative
      allow_other_uses: true
    
display:
  - platform: st7701s
    id: my_display
    update_interval: never
    auto_clear_enabled: False
    spi_mode: MODE3
    data_rate: 2MHz
    color_order: RGB
    invert_colors: False
    dimensions:
      width: 480
      height: 480
    reset_pin: 
      number: 4
      allow_other_uses: true
    cs_pin: 
      number: 4       # from OpenaHasp
      allow_other_uses: true
    de_pin: 40      # from OpenaHasp
    hsync_pin: 38   # from OpenaHasp
    vsync_pin: 39   # from OpenaHasp
    pclk_pin: 41    # from OpenaHasp
    pclk_frequency: 12MHz
    pclk_inverted: False
    hsync_pulse_width: 8
    hsync_front_porch: 10
    hsync_back_porch: 50
    vsync_pulse_width: 8
    vsync_front_porch: 10
    vsync_back_porch: 20
    init_sequence:
      - 1
      - [ 0xE0, 0x1F ]  # Set sunlight readable enhancement
    data_pins:
      red:
        - 8         #r1 29
        - 18        #r2 30
        - 17        #r3 31
        - 16        #r4 32 
        - 0         #r5 33 
      green:
        - 13        #g0 22
        - 12        #g1 23
        - 11        #g2 24
        - 10        #g3 25
        - 9         #g4 26
        - 3         #g5 27
      blue:
        - number: 15        #b2 17
          allow_other_uses: true   
        - number: 48        #b3 18
          allow_other_uses: true   
        - 47        #b4 19 
        - 21        #b5 20  
        - 14        #b6 21   
   
external_components:
  - source: github://pr#6363

Way out of date. Lvgl has been merged, why use this old code?

copy&paste strikes again!
I composed my configuration file by copying from some posts on the subject, without having a full knowledge of what I was doing (I’m trying to understand better how to do it).

thanks for the contribution.

Now I’ve deleted the externa_components reference.

Problem still persist.

If you used some old config, some aspects of lvgl changed before it was released.

As usual, logs, logs.