esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
294 stars 37 forks source link

Display of TDisplay S3 Amoled no longer works on ESPHome 2024.11.0 and 2024.11.1 #6484

Closed hapklaar closed 19 hours ago

hapklaar commented 5 days ago

The problem

After updating to ESPHome 2024.11.0 and also 2024.11.1 and changing component qspi_amoled to qspi_dbi because of https://github.com/esphome/esphome/pull/7594 the screen of the TTGO TDisplay S3 AMOLED no longer turns on/stays black after updating.

No errors are shown in logs. Nothing other than the component name has been changed in the yaml.

Which version of ESPHome has the issue?

2024.11.1

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.11.3

What platform are you using?

ESP32-IDF

Board

TTGO TDisplay S3 AMOLED

Component causing the issue

qspi_dbi

Example YAML snippet

esphome:
  name: tdisplay-s3-amoled-temp
  friendly_name: tdisplay-s3-amoled-temp
  platformio_options:
    build_unflags: -Werror=all
    board_build.flash_mode: dio

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  framework:
    type: esp-idf

spi:
  id: quad_spi
  type: quad
  clk_pin: 47
  data_pins:
    - 18
    - 7
    - 48
    - 5

psram:
  mode: octal

logger:
  level: DEBUG

api:
  encryption:
    key: !secret api_secret

ota:
  - platform: esphome
    password: !secret ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  power_save_mode: none

font:
  - file: 'fonts/BebasNeue-Regular.ttf'
    id: font_bebas_160
    size: 160
  - file: 'fonts/BebasNeue-Regular.ttf'
    id: font_bebas_230
    size: 230
  - file: 'fonts/arial.ttf'
    id: font_arial_20
    size: 20

color:
  - id: color_red
    red: 1
    green: 0
    blue: 0
  - id: color_green
    red: 0
    green: 1
    blue: 0
  - id: color_blue
    red: 0
    green: 0
    blue: 1
  - id: color_orange
    red: 1
    green: 0.6
    blue: 0
  - id: color_teal_blue
    red: 0
    green: 0.5
    blue: 0.45
  - id: color_grey
    red: 0.3
    green: 0.3
    blue: 0.3
  - id: color_black
    red: 0
    green: 0
    blue: 0
  - id: color_white
    red: 1
    green: 1
    blue: 1

time:
  - platform: homeassistant
    id: esptime

sensor:
  - platform: adc
    pin: GPIO04
    attenuation: auto
    filters:
      - multiply: 2
    name: VBatt
    id: vcc
    update_interval: 10s

  - platform: homeassistant
    id: dsmr_power_production
    entity_id: sensor.electricity_meter_power_production
    unit_of_measurement: 'W'
    filters:
      - multiply: 1000
      - heartbeat: 5s

  - platform: homeassistant
    id: dsmr_power_consumption
    entity_id: sensor.electricity_meter_power_consumption
    unit_of_measurement: 'W'
    filters:
      - multiply: 1000
      - heartbeat: 5s

  - platform: homeassistant
    id: dsmr_total_power
    entity_id: sensor.dsmr_total_sg_mqtt
    unit_of_measurement: 'W'

  - platform: homeassistant
    id: solar_power
    entity_id: sensor.dds238_2_solar_energy_power
    unit_of_measurement: 'W'

binary_sensor:
  # Button to cycle through pages on the display
  - platform: gpio
    pin:
      number: GPIO21
      inverted: true
    id: button_1
    on_press:
      then:
        - display.page.show_next: my_display

graph:
  - id: dsmr_power_graph
    duration: 30min
    x_grid: 5min
    y_grid: 500
    width: 535
    height: 80
    border: false
    traces:
      - sensor: dsmr_power_consumption
        line_type: SOLID
        line_thickness: 3
        color: color_red
      - sensor: dsmr_power_production
        line_type: SOLID
        line_thickness: 2
        color: color_green
      - sensor: solar_power
        line_type: SOLID
        line_thickness: 2
        color: color_orange

display:
  - platform: qspi_dbi
    id: my_display
    model: RM67162
    dimensions:
      height: 240
      width: 536
      offset_height: 0
      offset_width: 0
    transform:
      mirror_x: true
      mirror_y: false
      swap_xy: true
    color_order: rgb
    invert_colors: false
    brightness: 175
    cs_pin: 6
    reset_pin: 17
    enable_pin: 38
    pages:
      - id: page1
        lambda: |-
          auto white = Color(255, 255, 255);
          auto test = Color(40, 40, 255);
          auto purple = Color(102, 0, 204);
          it.filled_rectangle(0, 0, 535, 20, test);
          it.strftime(268, -2, id(font_arial_20), id(color_white), TextAlign::CENTER_HORIZONTAL, "%c", id(esptime).now());

          if (id(vcc).has_state()) {
            it.printf(450, -2, id(font_arial_20), id(color_white), "%.2f V", id(vcc).state);

            //it.printf(4, 0, id(font_arial_16), id(color_teal_blue), "%.2f V (%.2f %%)", id(vcc).state, id(batterylevel).state);
          }

          if (id(dsmr_total_power).has_state()) 
            {
            float pwr = id(dsmr_total_power).state;
              if (pwr > 1000.0) 
                {
                it.printf(268, 0, id(font_bebas_230), id(color_red), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
                } 
              else
                {
                if (pwr > 750.0) 
                  {
                  it.printf(268, 0, id(font_bebas_230), id(color_orange), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
                  } 
              else 
                {
                if (pwr < 0.0)
                  {
                  it.printf(268, 0, id(font_bebas_230), id(color_blue), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
                  }
              else
                  {
                  it.printf(268, 0, id(font_bebas_230), id(color_green), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
                  }
                }
              }
            }
      - id: page2
        lambda: |-
          auto white = Color(255, 255, 255);
          auto test = Color(40, 40, 255);
          auto purple = Color(102, 0, 204);
          it.filled_rectangle(0, 0, 535, 20, test);
          it.strftime(268, -2, id(font_arial_20), id(color_white), TextAlign::CENTER_HORIZONTAL, "%c", id(esptime).now());

          if (id(vcc).has_state()) {
            it.printf(450, -2, id(font_arial_20), id(color_white), "%.2f V", id(vcc).state);

            //it.printf(4, 0, id(font_arial_16), id(color_teal_blue), "%.2f V (%.2f %%)", id(vcc).state, id(batterylevel).state);
          }

          if (id(dsmr_total_power).has_state()) 
            {
            float pwr = id(dsmr_total_power).state;
              if (pwr > 1000.0) 
                {
                it.printf(268, 0, id(font_bebas_160), id(color_red), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
                } 
              else
                {
                if (pwr > 750.0) 
                  {
                  it.printf(268, 0, id(font_bebas_160), id(color_orange), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
                  } 
              else 
                {
                if (pwr < 0.0)
                  {
                  it.printf(268, 0, id(font_bebas_160), id(color_blue), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
                  }
              else
                  {
                  it.printf(268, 0, id(font_bebas_160), id(color_green), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(dsmr_total_power).state);
                  }
                }
              }
            }
          // Draw the graph
          it.graph(1, 160, id(dsmr_power_graph), color_teal_blue);
      - id: page3
        lambda: |-
          auto white = Color(255, 255, 255);
          auto test = Color(40, 40, 255);
          auto purple = Color(102, 0, 204);
          it.filled_rectangle(0, 0, 535, 20, test);
          it.strftime(268, -2, id(font_arial_20), id(color_white), TextAlign::CENTER_HORIZONTAL, "%c", id(esptime).now());
          if (id(vcc).has_state()) {
            it.printf(450, -2, id(font_arial_20), id(color_white), "%.2f V", id(vcc).state);
          }
          it.printf(268, 0, id(font_bebas_160), id(color_blue), TextAlign::CENTER_HORIZONTAL, "%.0f W", id(solar_power).state);

          // Draw the graph
          it.graph(1, 160, id(dsmr_power_graph), color_teal_blue);

Anything in the logs that might be useful for us?

-

Additional information

No response

h3ss commented 4 days ago

I am also having this issue after update to 2024.11.0

hapklaar commented 19 hours ago

Was fixed by https://github.com/esphome/esphome/pull/7805