Cheap yellow display errors

I have been having no luck getting this to display what I want yet, I have gotten it to work so I know it is not hardware.
I am trying to use the lvgl library with an arc but get a myriad of errors so I decided to just try the esphome cookbook lvgl examples and go from there. I have tried several and get this error

ERROR Error while reading config: Invalid YAML syntax:

mapping values are not allowed here
  in "/config/esphome/cyd-1.yaml", line 159, column 10

The code is below and line 159 is the one that begins with pages.

binary_sensor:
  - platform: homeassistant
    id: remote_light
    entity_id: light.dining_room_lights
    publish_initial_state: true
    on_state:
      then:
        lvgl.widget.update:
          id: light_btn
          state:
            checked: !lambda return x;

lvgl:
    ...
    pages:
      - id: room_page
        widgets:
          - button:
              id: light_btn
              align: CENTER
              width: 100
              height: 70
              checkable: true
              widgets:
                - label:
                    align: CENTER
                    text: 'Remote light'
              on_click:
                - homeassistant.action:
                    action: light.toggle
                    data:
                      entity_id: light.remote_light

Full config


#
# Basic yaml code to get the ESP32-2432S028R display to work in ESPHome.
#
# This yaml displays the ESPHome logo and the current date and time.
#
# Written by Jonny Bergdahl
# - [GitHub](https://github.com/jonnybergdahl)
# - [Twitter](https://twitter.com/jonnybergdahl)
# - [YouTube](https://www.youtube.com/jonnybergdahl)
#
# ============================================================ 
# NOTE:
# In order for this to work you need to add the following settings in your secrets.yaml file:
# - api_key
# - ota_password
# - wifi_ssid
# - wifi_password
# - ap_password
#
# Create a folder named fonts in your ESPHome folder, and copy the file fonts/Arimo-Regular.ttf there.
#
# ============================================================ 
# Example file setup
# Change the naming below, they will be the names used in Home Assistant
#
substitutions:
  device_name: yellowtft1
  friendly_name: Yellow TFT 1

# ============================================================ 
# Standard ESPHome setup
#
# ESPHome naming
esphome:
  name: $device_name
  friendly_name: $friendly_name
 
# The ESP32-2432S028R uses a standard ESP32-WROVER, so we use the esp32dev defintion
esp32:
  board: esp32dev
  framework:
    type: esp-idf
    

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "retracted"

ota:
  - platform: esphome
    password: "retracted"

# Setup WiFi credentials
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    
captive_portal:

# ============================================================ 
# ESPHome Display related setup
#
# Create a font to use, add and remove glyphs as needed. 
font:
  - file: 'fonts/Arimo-Regular.ttf'
    id: arimo24
    size: 24
    glyphs: "!\"%()+=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ abcdefghijklmnopqrstuvwxyzåäö"
  - file: 'fonts/Arimo-Regular.ttf'
    id: arimo96
    size: 96
    glyphs: ":0123456789"

# Create a Home Assistant blue color
color:
  - id: ha_blue
    hex: 51c0f2

# Create an ESPHome logo image
image:
  - file: "images/esphome.png"
    id: esphome_image
    type: RGB24

# ============================================================ 
# Home Assistant related setup
#
light:
  - platform: monochromatic
    output: backlight_pwm
    name: Display Backlight
    id: backlight
    restore_mode: ALWAYS_ON

# Create a time sensor, this will fetch time from Home Assistant
time:
  - platform: homeassistant
    id: esptime

# ============================================================ 
# Hardware related setup
#
# Setup SPI for the display. The ESP32-2432S028R uses separate SPI buses for display and touch
spi:
  - id: tft
    clk_pin: GPIO14
    mosi_pin: GPIO13
    miso_pin: GPIO12
  - id: touch
    clk_pin: GPIO25
    mosi_pin: GPIO32
    miso_pin: GPIO39

# Setup a pin to control the backlight
output:
  - platform: ledc
    pin: GPIO21
    id: backlight_pwm

# Setup the ili9xxx platform
#
# Display is used as 240x320 by default so we rotate it to 90°
#
# We print date and time wth the strftime() function, see the ESPHome documentation to 
# format date and atime to your locale.
#
display:
  - platform: ili9xxx
    model: ili9341
    spi_id: tft
    cs_pin: GPIO15
    dc_pin: GPIO2
    rotation: 270
    invert_colors: false
    auto_clear_enabled: false
    update_interval: never
binary_sensor:
  - platform: homeassistant
    id: remote_light
    entity_id: light.dining_room_lights
    publish_initial_state: true
    on_state:
      then:
        lvgl.widget.update:
          id: light_btn
          state:
            checked: !lambda return x;

lvgl:
    ...
    pages:
      - id: room_page
        widgets:
          - button:
              id: light_btn
              align: CENTER
              width: 100
              height: 70
              checkable: true
              widgets:
                - label:
                    align: CENTER
                    text: 'Remote light'
              on_click:
                - homeassistant.action:
                    action: light.toggle
                    data:
                      entity_id: light.remote_light




      






What is the ellipsis (…) following lvgl: for?

Don’t know the code is directly from the esphome cookbook

Doesn’t work for me though.

Craig

Ok - that ellipsis in the sample code is just a place holder for “put your other yaml here”.

Get rid of that line and you will find it’s all fine (or maybe get another error the compile hasn’t got to yet) :slight_smile:

I’m totally new to ESPHome although find it easier than Tasmota for integration into HA etc.

As soon as that LVGL command goes in the device shows a white (grayish) screen and the RGB LED turns on with a blue colour.

Other than having to change “auto_clear_enabled” to false nothing else is changed in the basic setup.

I can honestly say this is driving me nuts.

This is what I get from the log when its finished uploading the code.

INFO Upload took 9.52 seconds, waiting for result…
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.1.55 using esphome API
WARNING Can’t connect to ESPHome API for cyd @ 192.168.1.55: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address=‘192.168.1.55’, port=6053))]: [Errno 111] Connect call failed (‘192.168.1.55’, 6053) (SocketAPIError)
INFO Trying to connect to cyd @ 192.168.1.55 in the background

@chris31, I suggest you start a new topic, including posting your yaml and the logs.

Remember to use preformatted text tags to post your yaml and logs, they are accessed using the </> in the posting toolbar, your text will then look:

like this...

Thanks for replying but no idea how to start a new topic. So will give up with LVGL and go back to the old fashioned way that I know works. I think there is an issue with this board and LVGL and I can’t seem to find anyone that has tried using it so no hope.