EspHome & TTGO T-Display: no screen refresh

Thank-you that has fixed it

I did look at the two st7789v.cpp files and did no see a deference (must have missed something) and just assumed that the musk95 files were updated (silly me for assuming).
I copied from semenyak’s and its all working

Thank-you again for your support

Hi, I’ve this error!! Can you help me ?

src\main.cpp: In lambda function:
src\main.cpp:780:23: error: ‘class esphome::st7789v::ST7789V’ has no member named ‘backlight’
st7789vdisplay->backlight (false);
^
src\main.cpp: In lambda function:
src\main.cpp:783:23: error: ‘class esphome::st7789v::ST7789V’ has no member named ‘backlight’
st7789vdisplay->backlight (true);
^
src\main.cpp: In lambda function:
src\main.cpp:787:27: error: ‘class esphome::st7789v::ST7789V’ has no member named ‘get_backlight’
if (st7789vdisplay->get_backlight()) {
^

src\main.cpp: In lambda function:
src\main.cpp:796:23: error: ‘class esphome::st7789v::ST7789V’ has no member named ‘backlight’
st7789vdisplay->backlight (false);
^
src\main.cpp: In lambda function:
src\main.cpp:807:23: error: ‘class esphome::st7789v::ST7789V’ has no member named ‘backlight’
st7789vdisplay->backlight (true);

Could you pls post the “display” section of your code?

display:

  • platform: st7789v

    id: st7789vdisplay

    reset_pin: GPIO23

    dc_pin: GPIO16

    cs_pin: GPIO5

    backlight_pin: GPIO4

    brightness: 25%

    update_interval: 5s

    lambda: |-

    it.set_rotation(DISPLAY_ROTATION_0_DEGREES);

    //Icon

    if (id(curent_weather).state == “clear-night”)

    {

     it.image(5, 5, id(wpng_1));
    

    }

    else if (id(curent_weather).state == “cloudy”)

    {

     it.image(5, 5, id(wpng_2));
    

    }

    else if (id(curent_weather).state == “fog”)

    {

     it.image(5, 5, id(wpng_3));
    

    }

    else if (id(curent_weather).state == “hail”)

    {

     it.image(5, 5, id(wpng_4));
    

    }

    else if (id(curent_weather).state == “lightning”)

    {

     it.image(5, 5, id(wpng_5));
    

    }

    else if (id(curent_weather).state == “lightning-rainy”)

    {

     it.image(5, 5, id(wpng_6));
    

    }

    else if (id(curent_weather).state == “partlycloudy”)

    {

     it.image(5, 5, id(wpng_7));
    

    }

    else if (id(curent_weather).state == “pouring”)

    {

     it.image(5, 5, id(wpng_8));
    

    }

    else if (id(curent_weather).state == “rainy”)

    {

     it.image(5, 5, id(wpng_9));
    

    }

    else if (id(curent_weather).state == “snowy”)

    {

     it.image(5, 5, id(wpng_10));
    

    }

    else if (id(curent_weather).state == “snowy-rainy’”)

    {

     it.image(5, 5, id(wpng_11));
    

    }

    else if (id(curent_weather).state == “sunny”)

    {

     it.image(5, 5, id(wpng_12));
    

    }

    else if (id(curent_weather).state == “windy”)

    {

     it.image(5, 5, id(wpng_13));
    

    }

    else if (id(curent_weather).state == “windy-variant”)

    {

     it.image(5, 5, id(wpng_14));
    

    }

    else if (id(curent_weather).state == “exceptional”)

    {

     it.image(5, 5, id(wpng_15));
    

    }

    else

    {

     it.image(5, 5, id(wpng_0));
    

    }

    //Temperature

    if (id(curent_temp).has_state())

    {

    it.printf(95, 204, id(font2),  0xFFFF, TextAlign::BASELINE_RIGHT, "%.0f", id(curent_temp).state);
    

    }

    it.printf(100, 124, id(font3),  0xFFFF, "o");
    
    it.printf(105, 174, id(font4),  0xFFFF, "F");
    

    // it.printf(105, 174, id(font4), 0xFFFF, “C”);

    //Time

    it.strftime(67, 235, id(font1), 0x767E, TextAlign::BASELINE_CENTER, "%H:%M", id(esptime).now());

This seems to be at the heart of the matter.
Have you done Clean Build Files?

Yes, but nothing !!

I try to compile this project : https://github.com/anton-semeniak/Esphome-TTGO-T-Display-Weather

The first error is in custom_components renamed to components
The second is Unknown value ‘RGB565’, valid options are ‘BINARY’, ‘GRAYSCALE’, ‘RGB24’: renamed to RGB24
the third is in the bl_pin: renamed to bachlight_pin

Do you have the custom components directory?

Cattura

if I rename it to “components” it goes on

Cattura

This is the directory

Surely this issue should be raised on anton’s github

i found the solution:

replace in display.py.

spi.SPI_DEVICE_SCHEMA

with

spi.spi_device_schema()

Good, have you submitted a PR?

Hello @semenyak,

i have a 240x320 st7789v screen, what can i do to make it work with your custom component please?

the screen works but display only the 135x240 pixels like a TTgo screen…

Thanks

@semenyak will know better, but take a look at these two files


and

thanks @nickrout but i already look but dont understand how and what modify to specify the 240x320 pixels…

In the second file the width and height have been changed from 240 to 135 and from 320 to 240. See lines 265 and 269. Revert them to 240 and 320.

thanks for your help! didnt see that…i ll give it a try!

one thing i dont understand is i copy all the 3 folder to custom_components in HA but now when i compile in Esphome i have an error with st7789v that is not found.

I have the basic AddOn of Esphome and st7789v is already include, but i am under HassOs and i cant modify anything from the st7789v driver in Esphome…

i can modify in custom_component but it seems to make a big mess with the st7789v driver already include in Esphome.

Sorry…my knowledge is a little bit limited…dont know if i am clear or not …and if you understand?

It is not a HA custom component, it is a ESPHome custom component.

Create a directory named custom_components inside the directory that holds your esphome yaml files. Then put the 3 directories and their contents inside that directory.

yes, sorry, not well explained…

i do like this but cant compile anymore after that

Post an issue on @semenyak’s github repo.