GUITION 4" 480x480 ESP32-S3-4848S040 Smart Display with LVGL

Thanks to @clydebarrow for help and suggestions. Here is my work in progress :grinning:

        - obj:
            width: 230
            checkable: true
            id: lv_button_7
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $hvac
                  id: lv_button_7_icon
              - label:                   
                  align: bottom_left
                  text_align: center
                  text: "Hvac"
              - obj:
                  width: 160
                  bg_opa: transp
                  border_opa: transp
                  text_font: light32
                  align: right_mid
                  widgets:
                    - btn:
                        id: spin_down
                        align: left_mid
                        bg_opa: transp                
                        width: 50
                        height: 70
                        on_click:
                          - lvgl.spinbox.decrement: spinbox_id
                        widgets:
                          - label:
                                align: left_mid
                                text_align: left
                                text: "-"
                    - spinbox:
                        id: spinbox_id
                        align: CENTER
                        text_align: center
                        text_color: 0xB6B6B6
                        bg_opa: transp
                        border_opa: transp
                      
                        width: 80
                        range_from: 18
                        range_to: 28
                        step: 0.5
                        rollover: false
                        digits: 3
                        decimal_places: 1
                        on_value:
                          then:
                            - homeassistant.service:
                                service: climate.set_temperature
                                data:
                                  temperature: !lambda return x;
                                  entity_id: climate.upstairs
                    - btn:
                        id: spin_up
                        align: right_mid
                        bg_opa: transp               
                        width: 50
                        height: 70
                        on_click:
                          - lvgl.spinbox.increment: spinbox_id
                        widgets:
                          - label:
                                align: right_mid
                                text_align: right
                                text: "+"

and this is how itā€™s looks:


But one thing I canā€™t figured out how to fix is a vertical bar on the right side of the Hvac obj. I want to get rid of this bar , no luck so far

Thatā€™s a scroll bar - it means the content is too big to fit in the available space. Adust the height of the objects inside. It might only be a few pixels.

1 Like

You right , it was a height off the obj. I forgot to calculate a pad (5px top and bottom) when I put height of the second obj. Thank you

              - obj:
                  width: 160
                  height: 80
                  bg_opa: transp
                  border_opa: transp
                  text_font: light32
                  align: right_mid
                  widgets:
                    - btn:
                        id: spin_down
                        align: left_mid
                        bg_opa: transp                
                        width: 50
                        height: 50
                        on_click:
                          - lvgl.spinbox.decrement: spinbox_id
                        widgets:
                          - label:
                                align: left_mid
                                text_align: left
                                text: "-"
                    - spinbox:
                        id: spinbox_id
                        align: CENTER
                        text_align: center
                        text_color: 0xB6B6B6
                        bg_opa: transp
                        border_opa: transp
                      
                        width: 90
                        height: 50
                        range_from: 18
                        range_to: 28
                        step: 0.5
                        rollover: false
                        digits: 3
                        decimal_places: 1
                        on_value:
                          then:
                            - homeassistant.service:
                                service: climate.set_temperature
                                data:
                                  temperature: !lambda return x;
                                  entity_id: climate.upstairs
                    - btn:
                        id: spin_up
                        align: right_mid
                        bg_opa: transp               
                        width: 50
                        height: 50
                        on_click:
                          - lvgl.spinbox.increment: spinbox_id
                        widgets:
                          - label:
                                align: right_mid
                                text_align: right
                                text: "+"

Thank you everyone for help. This is my final (almost :grinning: ) code :

substitutions:
  name: "touch-panel"
  friendly_name: "Touch Panel"
  device_description: "Guition ESP32-S3-4848S040 480*480 Smart Screen"
  project_name: "Guition.ESP32_S3_4848S040"
  project_version: "1.0.0"

  lightbulb: "\U000F0335"
  ceiling_light: "\U000F0769"
  lamp: "\U000F06B5"
  floor_lamp: "\U000F08DD"
  string_lights: "\U000F12BA"
  clock: "\U000F0150"
  ceiling_fan: "\U000F1797"
  light_recessed: "\U000F179B"
  blinds_horizontal: "\U000F1A2B"
  blinds_horizontal_closed: "\U000F1A2C"
  curtains_closed: "\U000F1847"
  curtains: "\U000F1846"
  wallsconce: "\U000F091C"
  bed: "\U000F02E3"
  bed_empty: "\U000F08A0"
  thermometer_high: "\U000F10C2"
  humidity: "\U000F058E" 
  wallsconce_variant: "\U000F091E"
  kiss: "\U000F0C73"
  hvac: "\U000F0D43"

esphome:
  name: "${name}"
  friendly_name: "${friendly_name}"
  #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:

api:
  encryption:
    key: "key"

ota:
  password: "ota"
  platform: esphome

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

web_server:
  port: 80



external_components:
  - source:
      type: git
      url: https://github.com/clydebarrow/esphome
      ref: 82264dc2440981873b8400d613e0cc32d229daa3 #previous commit - wont be needed in the future
    components: [ lvgl ]
   

   
time:
  - platform: sntp        
    id: sntp_time
    timezone: America/New_York
    servers:
     - 0.pool.ntp.org
     - 1.pool.ntp.org
     - 2.pool.ntp.org
    on_time_sync:
      - script.execute: time_update
    on_time:
      - minutes: '*'
        seconds: 0
        then:
          - script.execute: time_update

############ AntiBurn ################

#########################################

script:
  - id: time_update
    then:
      - lvgl.label.update:
          id: display_time
          text: !lambda |-
            static char time_buf[17];
            auto now = id(sntp_time).now();            
            bool is_pm = now.hour >= 12;
            int hour_12 = now.hour % 12;
            if (hour_12 == 0) {
                hour_12 = 12; // 12 AM/PM should be displayed as 12, not 0
            }
            snprintf(time_buf, sizeof(time_buf), "%2d:%02d%s", hour_12, now.minute, is_pm ? "pm" : "am");
            return time_buf; 

###################Temp and Humidity ################
sensor:
  - platform: homeassistant
    entity_id: sensor.atc_7997_temperature
    id: outdoor_temperature
    on_value:
      - lvgl.label.update:
          id: temp_text
          text:
            format: "\U000F10C3 %.1f \U000F0504"
            args: [ 'x' ]  

  - platform: homeassistant
    id: room_humidity
    entity_id: sensor.atc_7997_humidity
    on_value:
      - lvgl.label.update:
          id: humidity_text
          text:
            format: "\U000F058E %.1f \U000F03F0"
            args: [ 'x' ]  

###############Fan######################
  - platform: homeassistant
    id: master_fan
    entity_id: fan.master_fan
    attribute: percentage
    on_value:
      - lvgl.spinbox.update:
          id: fan_speed
          value: !lambda return x;

################HVAC####################
  - platform: homeassistant
    id: room_thermostat
    entity_id: climate.upstairs
    attribute: temperature
    on_value:
      - lvgl.spinbox.update:
          id: spinbox_id
          value: !lambda return x;

############Cover##############
  - platform: homeassistant
    id: cover_myroom_pos
    entity_id: cover.shades_curtain
    attribute: current_position
    on_value:
      - if:
          condition:
            lambda: |-
              return x == 100;
          then:
            - lvgl.widget.update:
                id: cov_up_myroom
                text_opa: 60%
          else:
            - lvgl.widget.update:
                id: cov_up_myroom
                text_opa: 100%
      - if:
          condition:
            lambda: |-
              return x == 0;
          then:
            - lvgl.widget.update:
                id: cov_down_myroom
                text_opa: 60%
          else:
            - lvgl.widget.update:
                id: cov_down_myroom
                text_opa: 100%


####Text Sensor####################
text_sensor:
  - platform: homeassistant
    id: cover_myroom_state
    entity_id: cover.shades_curtain
    on_value:
      - if:
          condition:
            lambda: |-
              return ((0 == x.compare(std::string{"opening"})) or (0 == x.compare(std::string{"closing"})));
          then:
            - lvgl.label.update:
                id: cov_stop_myroom
                text: "STOP"
          else:
            - lvgl.label.update:
                id: cov_stop_myroom
                text:
                  format: "%.0f%%"
                  args: [ 'id(cover_myroom_pos).get_state()' ]


################### Red Lights #######################
switch:
  - platform: lvgl
    name: Intim Lights
    widget: lv_button_8
    on_turn_on:
      then:
        - lvgl.widget.update:
            id: lv_button_8_icon
            text_color: 0xFFFF00
    on_turn_off:
      then:
        - lvgl.widget.update:
            id: lv_button_8_icon
            text_color: 0xB6B6B6 

###################### AntiBurn#####################

################binary_sensors###############
# Lights#
binary_sensor:
  - platform: homeassistant
    id: remote_light1
    entity_id: light.over_the_bed_lights
    publish_initial_state: true
    on_state:
      then:
        lvgl.widget.update:
          id: lv_button_1
          state:
            checked: !lambda return x;

  - platform: homeassistant
    id: remote_light2
    entity_id: light.mirror_lighs
    publish_initial_state: true
    on_state:
      then:
        lvgl.widget.update:
          id: lv_button_2
          state:
            checked: !lambda return x;

  - platform: homeassistant
    id: remote_light3
    entity_id: light.tv_lights
    publish_initial_state: true
    on_state:
      then:
        lvgl.widget.update:
          id: lv_button_3
          state:
            checked: !lambda return x;

  - platform: homeassistant
    id: remote_light4
    entity_id: light.irina_s_wall_light
    publish_initial_state: true
    on_state:
      then:
        lvgl.widget.update:
          id: lv_button_4
          state:
            checked: !lambda return x;

  - platform: homeassistant
    id: remote_light5
    entity_id: light.bed_occupancy_sensor_yevgeniy_lights
    publish_initial_state: true
    on_state:
      then:
        lvgl.widget.update:
          id: lv_button_5
          state:
            checked: !lambda return x;

  - platform: homeassistant
    id: remote_light6
    entity_id: light.my_wall_light
    publish_initial_state: true
    on_state:
      then:
        lvgl.widget.update:
          id: lv_button_6
          state:
            checked: !lambda return x;

#Fan#
  - platform: homeassistant
    id: remote_fan
    entity_id: fan.master_fan
    publish_initial_state: true
    on_state:
      then:
        lvgl.widget.update:
          id: lv_button_10
          state:
            checked: !lambda return x;
#Covers#
  - platform: homeassistant
    id: remote_cover
    entity_id: cover.master_bedroom_all_covers
    publish_initial_state: true
    on_state:
      then:
        lvgl.widget.update:
          id: lv_button_11
          state:
            checked: !lambda return x;
#number:

  # __________________________________________________ backlight timeout
  #- platform: template
    #name: Backlight Timeout
    #optimistic: true
    #id: backlight_timeout
    #unit_of_measurement: "s"
    #initial_value: 30
    #restore_value: true
    #min_value: 10
    #max_value: 90
    #step: 10
    #mode: auto # auto / box / slider

# ======================================================================================
################lvgl Buttons################

lvgl:
  displays:
    - display_id: my_display
  touchscreens:
    - touchscreen_id: my_touchscreen
  on_idle:
    timeout: 120s ###!lambda "return (id(backlight_timeout).state * 1000);" ##fiture use##
    then:
      - logger.log: "LVGL is idle"
      - light.turn_off: backlight
      - lvgl.pause:

##########Pages####################
  top_layer:
    widgets:
      - label:
          text_font: roboto24
          text: "00:00 am"
          id: display_time
          align: bottom_mid
          #x: -2
          y: -10
          text_align: right
          text_color: 0xFFFFFF 
            
      - label:
          text_font: roboto24
          text: "-.- %"
          id: humidity_text
          align: bottom_right
          x: -20
          y: -10
          text_align: right
          text_color: 0xFFFFFF 
          on_press:
            then:
              - lvgl.page.show: second_page

      - label:
          text_font: roboto24
          text: "-.-Ā°C"
          id: temp_text
          align: bottom_left
          x: 12
          y: -10
          #text_align: right
          text_color: 0xFFFFFF
          on_press:
            then:
              - lvgl.page.show: main_page    

                

  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

####Header_Footer##########
    - id: header_footer
      bg_color: 0x0C7B5F
      bg_grad_color: 0x03291F
      bg_grad_dir: VER
      bg_opa: COVER
      border_width: 0
      radius: 0
      pad_all: 0
      pad_row: 0
      pad_column: 0
      border_color: 0x0077b3
      text_color: 0xFFFFFF
      width: 100%
      height: 30

  theme:
    btn:
      text_font: roboto24
      scroll_on_focus: true
      group: general
      radius: 20
      width: 150
      height: 96
      pad_all: 0
      pad_row: 0
      pad_column: 0
      #pad_left: 5px
      #pad_top: 5px
      #pad_bottom: 5px
      #pad_right: 5px
      shadow_width: 0
      bg_color: 0x0C7B5F
      text_color: 0xB6B6B6
      checked:
        bg_color: 0xCC5E14
        text_color: 0xB6B6B6

    obj:
      text_font: roboto24
      scroll_on_focus: true
      group: general
      radius: 20
      width: 150
      height: 100
      pad_left: 5px
      pad_top: 5px
      pad_bottom: 5px
      pad_right: 5px
      shadow_width: 0
      bg_color: 0x0C7B5F
      border_color: 0x0C7B5F
      text_color: 0xB6B6B6
      checked:
        bg_color: 0xCC5E14
        text_color: 0xB6B6B6      

  page_wrap: true
  pages:
    - id: main_page
      skip: true
      width: 100%
      bg_color: 0x000000
      bg_opa: cover
      pad_all: 5
      layout: # enable the FLEX layout for the children widgets
        type: FLEX
        flex_flow: ROW_WRAP # the order of the widgets starts top left
        flex_align_cross: CENTER

      widgets: 
        - obj:
            checkable: true
            id: lv_button_1
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $light_recessed
                  id: lv_button_1_icon
              - label:
                  align: bottom_mid
                  text: "Bed Lights"
                  long_mode: dot
            on_short_click:
              - homeassistant.service:
                  service: light.toggle
                  data:
                    entity_id: light.over_the_bed_lights 
        - obj:
            checkable: true
            id: lv_button_2
            widgets:
              - label:
                  text_font: light32
                  align: top_mid
                  text: $light_recessed
                  id: lv_button_2_icon
              - label:
                  align: bottom_mid
                  text: "Mirror Lights"
                  long_mode: dot  
            on_short_click:
              - homeassistant.service:
                  service: light.toggle
                  data:
                    entity_id: light.mirror_lighs 

        - obj:
            checkable: true
            id: lv_button_3
            widgets:
              - label:
                  text_font: light32
                  align: top_right
                  text: $light_recessed
                  id: lv_button_3_icon
              - label:
                  align: bottom_mid
                  text: "TV Lights"
                  long_mode: dot
            on_short_click:
              - homeassistant.service:
                  service: light.toggle
                  data:
                    entity_id: light.tv_lights

        - obj:
            checkable: true
            id: lv_button_4
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $wallsconce_variant
                  id: lv_button_4_icon
              - label:
                  align: bottom_mid
                  text: "Irina Light"
                  long_mode: dot
            on_short_click:
              - homeassistant.service:
                  service: light.toggle
                  data:
                    entity_id: light.irina_s_wall_light
        - obj:
            checkable: true
            id: lv_button_5
            widgets:
              - label:
                  text_font: light32
                  align: top_mid
                  text: $bed
                  id: lv_button_5_icon
              - label:
                  align: bottom_mid
                  text: "Under Bed"
                  long_mode: dot
            on_short_click:
              - homeassistant.service:
                  service: light.toggle
                  data:
                    entity_id: light.bed_occupancy_sensor_yevgeniy_lights 

        - obj:
            checkable: true
            id: lv_button_6
            widgets:
              - label:
                  text_font: light32
                  align: top_right
                  text: $wallsconce_variant
                  id: lv_button_6_icon
              - label:
                  align: bottom_mid
                  text: "My Light"
                  long_mode: dot  
            on_short_click:
              - homeassistant.service:
                  service: light.toggle
                  data:
                    entity_id: light.my_wall_light 


        - obj:
            width: 230
            checkable: true
            id: lv_button_7
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $hvac
                  id: lv_button_7_icon
              - label:                
                  align: bottom_left
                  text_align: center
                  text: "Hvac"
              - obj:
                  width: 160
                  height: 80
                  bg_opa: transp
                  border_opa: transp
                  text_font: light32
                  align: right_mid
                  widgets:
                    - btn:
                        id: spin_down
                        align: left_mid
                        bg_opa: transp                
                        width: 50
                        height: 50
                        on_click:
                          - lvgl.spinbox.decrement: spinbox_id
                        widgets:
                          - label:
                                align: left_mid
                                text_align: left
                                text_font: montserrat_36                                
                                text: "-"
                    - spinbox:
                        id: spinbox_id
                        align: CENTER
                        text_align: CENTER
                        text_color: 0xB6B6B6
                        text_font: montserrat_36
                        bg_opa: transp
                        border_opa: transp                      
                        width: 90
                        #height: 60
                        range_from: 18
                        range_to: 28
                        step: 0.5
                        rollover: false
                        digits: 3
                        decimal_places: 1
                        on_value:
                          then:
                            - homeassistant.service:
                                service: climate.set_temperature
                                data:
                                  temperature: !lambda return x;
                                  entity_id: climate.upstairs
                    - btn:
                        id: spin_up
                        align: right_mid
                        bg_opa: transp               
                        width: 50
                        height: 50
                        on_click:
                          - lvgl.spinbox.increment: spinbox_id
                        widgets:
                          - label:
                                align: right_mid
                                text_align: right
                                text_font: montserrat_36
                                text: "+"
      
        - obj:
            width: 230
            checkable: true
            id: lv_button_8
            widgets:
              - label:
                  text_font: light32
                  align: top_right
                  text: $kiss
                  id: lv_button_8_icon
              - label:
                  align: bottom_right
                  text: "Intim"
                  long_mode: dot              

        - obj:
            width: 230
            checkable: true
            id: lv_button_10
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $ceiling_fan
                  id: lv_button_10_icon
              - label:
                  align: bottom_left
                  text: "Fan"
                 # long_mode: dot 
              - obj:
                  width: 160
                  height: 80
                  bg_opa: transp
                  border_opa: transp
                  text_font: light32
                  align: right_mid
                  widgets:
                    - btn:
                        id: speed_down
                        align: left_mid
                        bg_opa: transp                
                        width: 50
                        height: 50
                        on_click:
                          - lvgl.spinbox.decrement: fan_speed
                        widgets:
                          - label:
                                align: left_mid
                                text_align: left
                                text_font: montserrat_36                                
                                text: "-"
                        on_press:
                          then:
                            - homeassistant.service:
                                service: fan.decrease_speed
                                data:
                                  entity_id: fan.master_fan                               
                    - spinbox:
                        id: fan_speed
                        align: CENTER
                        text_align: CENTER
                        text_color: 0xB6B6B6
                        text_font: montserrat_36
                        bg_opa: transp
                        border_opa: transp                      
                        width: 90
                        #height: 60
                        range_from: 0
                        range_to: 100
                        step: 33.3
                        rollover: false
                        digits: 3
                        #decimal_places: 1
                        on_value:
                          then:
                            - homeassistant.service:
                                service: fan.set_percentage
                                data:
                                  percentage: !lambda return x;
                                  entity_id: fan.master_fan
                    - btn:
                        id: speed_up
                        align: right_mid
                        bg_opa: transp               
                        width: 50
                        height: 50
                        on_click:
                          - lvgl.spinbox.increment: fan_speed
                        widgets:
                          - label:
                                align: right_mid
                                text_align: right
                                text_font: montserrat_36
                                text: "+"
                        on_press:
                          then:
                            - homeassistant.service:
                                service: fan.increase_speed
                                data:
                                  entity_id: fan.master_fan     

            on_short_click:
              - homeassistant.service:
                  service: fan.toggle
                  data:
                    entity_id: fan.master_fan


        - obj:
            width: 230
            checkable: true
            id: lv_button_11
            widgets:
              - label:
                  text_font: light32
                  align: top_right
                  text: $curtains
                  id: lv_button_11_icon
              - label:
                  align: bottom_right
                  text: "Curtains"
                  #long_mode: dot   
            on_short_click:
              - homeassistant.service:
                  service: cover.toggle
                  data:
                    entity_id: cover.master_bedroom_all_covers    
############## Second Page#######################
    - id: second_page
      skip: true
      #layout: flex
      #flex_flow: row_WRAP
      width: 100%
      bg_color: 0x000000
      bg_opa: cover
      pad_all: 5 
      layout: # enable the FLEX layout for the children widgets
        type: FLEX
        flex_flow: ROW_WRAP # the order of the widgets starts top left
        flex_align_cross: CENTER      

      widgets:
############## Covers###################
          - btn:
              x: 10
              y: 30
              width: 70
              height: 68
              widgets:
                - label:
                    id: cov_up_myroom
                    align: CENTER
                    text:  "\U000F0143"
              on_press:
                then:
                  - homeassistant.service:
                      service: cover.open
                      data:
                        entity_id: cover.shades_curtain
          - btn:
              x: 10
              y: 103
              width: 70
              height: 68
              widgets:
                - label:
                    id: cov_stop_myroom
                    align: CENTER
                    text: STOP
              on_press:
                then:
                  - homeassistant.service:
                      service: cover.stop
                      data:
                        entity_id: cover.shades_curtain
          - btn:
              x: 10
              y: 178
              width: 70
              height: 68
              widgets:
                - label:
                    id: cov_down_myroom
                    align: CENTER
                    
                    text: "\U000F0140"
              on_press:
                then:
                  - homeassistant.service:
                      service: cover.close
                      data:
                        entity_id: cover.shades_curtain


####################HVAC##############################

#-------------------------------------------
# Internal outputs
#-------------------------------------------
output:
    # Backlight LED
  - platform: ledc
    pin: GPIO38
    id: GPIO38
    frequency: 100Hz
    
    # Built in 120v relay
  - id: internal_relay_1
    platform: gpio
    pin: 40

#-------------------------------------------
# LIGHTS
#-------------------------------------------
light:
  - platform: monochromatic
    output: GPIO38
    name: Backlight
    id: backlight
    restore_mode: ALWAYS_ON


#-------------------------------------------
# Graphicsd and Fonts
#-------------------------------------------
image:
  - file: https://esphome.io/_images/logo.png
    id: boot_logo
    resize: 200x200
    type: RGB565

  - file: "fonts/wall-sconce-180.svg"
    id: wallsconce_180
    resize: 20x20
    
font:
  
  - file: "gfonts://Roboto"
    id: roboto24
    size: 24
    bpp: 4
    extras:
      - file: 'fonts/materialdesignicons-webfont.ttf' # http://materialdesignicons.com/cdn/7.4.47/ 
        glyphs: [
          "\U000F004B",
          "\U0000f0ed",
          "\U000F006E",
          "\U000F012C",
          "\U000F179B",
          "\U000F0748",
          "\U000F1A1B",
          "\U000F02DC",
          "\U000F0A02",
          "\U000F035F",
          "\U000F0156",
          "\U000F0C5F", 
          "\U000f0084",
          "\U000f0091",
          "\U000F058E",
          "\U000F10C3",
          "\U000F03F0", # mdi-percent
          "\U000F0504", # mdi- celcius
          "\U000F091E",
          "\U000F0143", # mdi-arrow_up
          "\U000F0140", # mdi-arrow_down          
                    ]
  - file: 'fonts/materialdesignicons-webfont.ttf' # http://materialdesignicons.com/cdn/7.4.47/ 
    id: weather70
    size: 70
    bpp: 4
    glyphs: &mdi-weather-glyphs
      - "\U000F0590" # mdi-weather-cloudy
      - "\U000F0F2F" # mdi-weather-cloudy-alert
      - "\U000F0E6E" # mdi-weather-cloudy-arrow-right
      - "\U000F0591" # mdi-weather-fog
      - "\U000F0592" # mdi-weather-hail
      - "\U000F0F30" # mdi-weather-hazy
      - "\U000F0898" # mdi-weather-hurricane
      - "\U000F0593" # mdi-weather-lightning
      - "\U000F067E" # mdi-weather-lightning-rainy
      - "\U000F0594" # mdi-weather-clear-night
      - "\U000F0F31" # mdi-weather-night-partly-cloudy
      - "\U000F0595" # mdi-weather-partly-cloudy
      - "\U000F0F32" # mdi-weather-partly-lightning
      - "\U000F0F33" # mdi-weather-partly-rainy
      - "\U000F0F34" # mdi-weather-partly-snowy
      - "\U000F0F35" # mdi-weather-partly-snowy-rainy
      - "\U000F0596" # mdi-weather-pouring
      - "\U000F0597" # mdi-weather-rainy
      - "\U000F0598" # mdi-weather-snowy
      - "\U000F0F36" # mdi-weather-snowy-heavy
      - "\U000F067F" # mdi-weather-snowy-rainy
      - "\U000F0599" # mdi-weather-sunny
      - "\U000F0F37" # mdi-weather-sunny-alert
      - "\U000F14E4" # mdi-weather-sunny-off
      - "\U000F059A" # mdi-weather-sunset
      - "\U000F059B" # mdi-weather-sunset-down
      - "\U000F059C" # mdi-weather-sunset-up
      - "\U000F0F38" # mdi-weather-tornado
      - "\U000F059D" # mdi-weather-windy
      - "\U000F059E" # mdi-weather-windy-variant

  - file: 'fonts/materialdesignicons-webfont.ttf' # http://materialdesignicons.com/cdn/7.4.47/ 
    id: light32
    size: 32
    bpp: 4
    glyphs: [
      "\U000F0335", # mdi-lightbulb
      "\U000F0769", # mdi-ceiling-light
      "\U000F08DD", # mdi-floor-lamp
      "\U000F12BA", # mdi-string-lights
      "\U000F0150", # mdi-clock
      "\U000F1797", # mdi-ceiling_fan
      "\U000F179B", # mdi-light_recessed
      "\U000F1A2B", # mdi-blinds_horizontal
      "\U000F1A2C", # mdi-blinds_horizontal_closed
      "\U000F1847", # mdi-curtains_closed
      "\U000F1846", # mdi-curtains
      "\U000F091C", # mdi-wallsconce
      "\U000F02E3", # mdi-bed
      "\U000F08A0", # mdi-bed_empty
      "\U000F10C2", # mdi-thermometer_high
      "\U000F058E", # mdi-humidity 
      "\U000F091E", # mdi-wallsconce_variant
      "\U000F0C73", # mdi-kiss
      "\U000F0D43", # mdi- hvac   
    ]          
      
  - file: "gfonts://Roboto"
    id: roboto10
    size: 10
    bpp: 4          

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

  on_touch:
    - 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
              );

  on_release:
    then:
      - if:
          condition: lvgl.is_paused
          then:
            - logger.log: "LVGL resuming"
            - lvgl.resume:
            - lvgl.widget.redraw:
            - light.turn_on: backlight

#-------------------------------------------
# Display st7701s spi
#-------------------------------------------
spi:
  - id: lcd_spi
    clk_pin: GPIO48
    mosi_pin: GPIO47
    
display:
  - platform: st7701s
    id: my_display
    update_interval: never
    auto_clear_enabled: True
    data_rate: 2MHz
    spi_mode: MODE3
    color_order: RGB
    invert_colors: false
    dimensions:
      width: 480
      height: 480
    transform:
      mirror_x: false
      mirror_y: false
    cs_pin: 39
      # reset not defined 
    de_pin: 18
    hsync_pin: 16
    vsync_pin: 17
    pclk_pin: 21
    init_sequence: 
      - 1
      - [0xFF, 0x77, 0x01, 0x00, 0x00, 0x10] # CMD2_BKSEL_BK0
      - [0xCD, 0x00] # disable MDT flag
    pclk_frequency: 12MHz
    pclk_inverted: false
    data_pins:
      red:
        - 11         # R1
        - 12         # R2
        - 13         # R3
        - 14         # R4
        - 0          # R5
      green:
        - 8          # G0
        - 20         # G1
        - 3          # G2
        - 46         # G3
        - 9          # G4
        - 10         # G5 
      blue:
        - 4          # B1
        - 5          # B2
        - 6          # B3
        - 7          # B4
        - 15         # B5


2 things I would like to add:

  1. AntiBurn ( for some reason itā€™s give me an error)
  2. Some how I want to add white color by default when I turn on My Light( itā€™s multi color light and when I change color, next time I turn on I want color to be white, not the color I left on when I turn off)
1 Like

Hey! How did you adjust the buttons to not be below the footer? Thank you!

Use a footer and Header styling

##########Pages####################
  top_layer:
    widgets:
      - label:
          text_font: roboto24
          text: "00:00 am"
          id: display_time
          align: bottom_mid
          #x: -2
          y: -10
          text_align: right
          text_color: 0xFFFFFF 
            
      - label:
          text_font: roboto24
          text: "-.- %"
          id: humidity_text
          align: bottom_right
          x: -20
          y: -10
          text_align: right
          text_color: 0xFFFFFF 
          on_press:
            then:
              - lvgl.page.show: second_page

      - label:
          text_font: roboto24
          text: "-.-Ā°C"
          id: temp_text
          align: bottom_left
          x: 12
          y: -10
          #text_align: right
          text_color: 0xFFFFFF
          on_press:
            then:
              - lvgl.page.show: main_page    

                

  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

####Header_Footer##########
    - id: header_footer
      bg_color: 0x0C7B5F
      bg_grad_color: 0x03291F
      bg_grad_dir: VER
      bg_opa: COVER
      border_width: 0
      radius: 0
      pad_all: 0
      pad_row: 0
      pad_column: 0
      border_color: 0x0077b3
      text_color: 0xFFFFFF
      width: 100%
      height: 30
2 Likes

Hello,

Iā€™m getting the feeling with the coding of the screen.

but I run into a problem. I use buttons on the screen to make turn on or off a switch in home assistant. And I want the background of the button change to the state of the entity.

in the code below on line 1151 there is a ā€œbg_color:ā€ line if I put a color in the button changes color. so far so good but it needs to be variable.

substitutions:
  name: guition-tuin
  friendly_name: guition-tuin
  device_description: "Guition ESP32-S3-4848S040 480*480 Smart Screen"
  project_name: "Guition.ESP32_S3_4848S040"
  project_version: "1.0.0"

  lightbulb: "\U000F0335"
  ceiling_light: "\U000F0769"
  lamp: "\U000F06B5"
  floor_lamp: "\U000F08DD"
  string_lights: "\U000F12BA"
  clock: "\U000F0150"
  ceiling_fan: "\U000F1797"
  light_recessed: "\U000F179B"
  blinds_horizontal: "\U000F1A2B"
  blinds_horizontal_closed: "\U000F1A2C"
  curtains_closed: "\U000F1847"
  curtains: "\U000F1846"
  wallsconce: "\U000F091C"
  bed: "\U000F02E3"
  bed_empty: "\U000F08A0"
  thermometer_high: "\U000F10C2"
  humidity: "\U000F058E" 
  pool: "\U000F0606"
  home: "\U000F07D0"
  music: "\U000F0387"
  volume_down: "\U000F075E"
  volume_off: "\U000F0581"
  volume_up:  "\U000F075D"
  cover_up:  "\U000F075D"
  cover_down:  "\U000F075D"
  fountain:  "\U000F096B" # mdi-fountain

esphome:
  name: "${name}"
  friendly_name: "${friendly_name}"
  #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:

api:
  encryption:
    key: "OF+IxRDrZuVHUxdWdgo8oTUtspPhX49xvbRTQmkWBKQ="

ota:
  - platform: esphome
    password: "f3d9af347d4086fb1911340933aff60a"

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

web_server:
  port: 80

external_components:
 - source: github://clydebarrow/esphome@lvgl_original
   refresh: 10min
   components: [ lvgl ]
   
time:
  - platform: sntp
    id: sntp_time
    timezone: Europe/Amsterdam
    servers:
     - 0.pool.ntp.org
     - 1.pool.ntp.org
     - 2.pool.ntp.org
    on_time_sync:
      - script.execute: time_update
    on_time:
      - minutes: '*'
        seconds: 0
        then:
          - script.execute: time_update

script:
  - id: time_update
    then:
      - lvgl.label.update:
          id: display_time
          text: !lambda |-
            static char time_buf[17];
            auto now = id(sntp_time).now();            
            bool is_pm = now.hour >= 12;
            int hour_12 = now.hour % 12;
            if (hour_12 == 0) {
                hour_12 = 12; // 12 AM/PM should be displayed as 12, not 0
            }
            snprintf(time_buf, sizeof(time_buf), "%2d:%02d%s", now.hour, now.minute, is_pm ? "" : "");
            return time_buf; 

################### Home-Assistant sensors ################
sensor:
  - platform: homeassistant
    entity_id: sensor.achtertuin_temperatuur_temperature
    id: outdoor_temperature
    on_value:
      - lvgl.label.update:
          id: temp_text
          text:
            format: "\U000F10C3 %.1fĀ°C"
            args: [ 'x' ]  

  - platform: homeassistant
    id: room_humidity
    entity_id: sensor.achtertuin_temperatuur_humidity
    on_value:
      - lvgl.label.update:
          id: humidity_text
          text:
            format: "\U000F058E %.1f%%"
            args: [ 'x' ]  

  - platform: homeassistant
    id: bloembak_meisje
    entity_id: sensor.bloembak_meisje_moisture
    on_value:
      - lvgl.label.update:
          id: bloembak_meisje_text
          text:
            format: "\U000F058E %.1f%%"
            args: [ 'x' ]  

  - platform: homeassistant
    id: bloembak_huis
    entity_id: sensor.bloembak_huis_moisture
    on_value:
      - lvgl.label.update:
          id: bloembak_huis_text
          text:
            format: "\U000F058E %.1f%%"
            args: [ 'x' ]  

  - platform: homeassistant
    id: bloembak_groot
    entity_id: sensor.flower_care_moisture
    on_value:
      - lvgl.label.update:
          id: bloembak_groot_text
          text:
            format: "\U000F058E %.1f%%"
            args: [ 'x' ]  

  - platform: homeassistant
    id: cover_screen_pos
    entity_id: cover.screen_woonkamer
    attribute: current_position
    on_value:
      - if:
          condition:
            lambda: |-
              return x == 100;
          then:
            - lvgl.widget.update:
                id: cov_up_screen
                text_opa: 60%
          else:
            - lvgl.widget.update:
                id: cov_up_screen
                text_opa: 100%
      - if:
          condition:
            lambda: |-
              return x == 0;
          then:
            - lvgl.widget.update:
                id: cov_down_screen
                text_opa: 60%
          else:
            - lvgl.widget.update:
                id: cov_down_screen
                text_opa: 100%

  - platform: homeassistant
    id: cover_zonnescherm_pos
    entity_id: cover.zonnescherm
    attribute: current_position
    on_value:
      - if:
          condition:
            lambda: |-
              return x == 0;
          then:
            - lvgl.widget.update:
                id: cov_up_zonnescherm
                text_opa: 60%
          else:
            - lvgl.widget.update:
                id: cov_up_zonnescherm
                text_opa: 100%
      - if:
          condition:
            lambda: |-
              return x == 100;
          then:
            - lvgl.widget.update:
                id: cov_down_zonnescherm
                text_opa: 60%
          else:
            - lvgl.widget.update:
                id: cov_down_zonnescherm
                text_opa: 100%

#  - platform: homeassistant
#    id: time_ha
#    entity_id: sensor.achtertuin_temperatuur_humidity
#    on_value:
#      - lvgl.label.update:
#          id: display_time_ha

  # Uptime sensor.
  - platform: uptime
    name: Uptime

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: WiFi Signal
    update_interval: 60s


################TEXT Sensors################
text_sensor:
  - platform: homeassistant
    id: cover_screen_state
    entity_id: cover.screen_woonkamer
    on_value:
      - if:
          condition:
            lambda: |-
              return ((0 == x.compare(std::string{"opening"})) or (0 == x.compare(std::string{"closing"})));
          then:
            - lvgl.label.update:
                id: cov_stop_screen
                text: "STOP"
          else:
            - lvgl.label.update:
                id: cov_stop_screen
                text:
                  format: "%.0f%%"
                  args: [ 'id(cover_screen_pos).get_state()' ]

  - platform: homeassistant
    id: cover_zonnescherm_state
    entity_id: cover.zonnescherm
    on_value:
      - if:
          condition:
            lambda: |-
              return ((0 == x.compare(std::string{"opening"})) or (0 == x.compare(std::string{"closing"})));
          then:
            - lvgl.label.update:
                id: cov_stop_zonnescherm
                text: "STOP"
          else:
            - lvgl.label.update:
                id: cov_stop_zonnescherm
                text:
                  format: "%.0f%%"
                  args: [ 'id(cover_zonnescherm_pos).get_state()' ]

  - platform: homeassistant
    id: switch_meisje_state
    entity_id: input_boolean.test
    on_value:
      - if:
          condition:
           lambda: |-
              return x == 1;
          then:
            - lvgl.label.update:
                id: btn_water_meisje
                bg_color:  0x0C7B5F
          else:
            - lvgl.label.update:
                id: btn_water_meisje
                bg_color:  0xCC5E14

################lvgl Buttons################

lvgl:
  displays:
    - display_id: my_display
  touchscreens:
    - touchscreen_id: my_touchscreen
  on_idle:
    - timeout: 90s
      then:
        - logger.log: idle timeout
        - lvgl.pause:
        - light.turn_off:
            id: backlight
            transition_length: 5s

##########Pages####################
  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

####Header_Footer##########
    - id: header_footer
      bg_color: 0x0C7B5F
      bg_grad_color: 0x03291F
      bg_grad_dir: VER
      bg_opa: COVER
      border_width: 0
      radius: 0
      pad_all: 0
      pad_row: 0
      pad_column: 0
      border_color: 0x0077b3
      text_color: 0xFFFFFF
      width: 100%
      height: 40

  theme:
    btn:
      text_font: roboto24
      scroll_on_focus: true
      group: general
      radius: 25
      width: 150
      height: 97
      pad_left: 10px
      pad_top: 10px
      pad_bottom: 10px
      pad_right: 10px
      shadow_width: 0
      bg_color: 0x0C7B5F
      text_color: 0xB6B6B6
      checked:
        bg_color: 0xCC5E14
        text_color: 0xB6B6B6

#########################################################
#                      Waterornamenten
#########################################################

    - id: page_waterornamenten
      bg_color: 0x000000
      widgets:  
        - label:
            text_font: roboto50
            text_color: 0xFFFAFF
            x: 0
            y: 0
            width: 480
            height: 68
            text: "Waterornamenten"
            text_align: CENTER

        - btn:
            x: 20
            y: 140
            width: 200
            height: 200
            bg_color: btn_water_meisje
            widgets:
              - label:
                  text_font: roboto100
                  align: CENTER
                  text: $fountain
                  id: btn_meisje_icon
              - label:
                  id: btn_meisje
                  align: bottom_mid
                  text: "Meisje"
            on_click:
              - homeassistant.service:
                  service: homeassistant.toggle
                  data:
                    entity_id: input_boolean.test
        - btn:
            x: 260
            y: 140
            width: 200
            height: 200
            widgets:
              - label:
                  text_font: roboto100
                  align: CENTER
                  text: $fountain
                  id: btn_waterbakjes_icon
              - label:
                  id: btn_waterbakjes
                  align: bottom_mid
                  text: "Waterbakjes"
            on_click:
              - homeassistant.service:
                  service: homeassistant.toggle
                  data:
                    entity_id: input_boolean.test

        - btn:
            x: 206
            y: 395
            width: 68
            height: 68
            id: page_waterornamenten_btn_home
            widgets:
              - label:
                  text_font: light32
                  align: center
                  text: $home
                  id: page_waterornamenten_btn_home_icon
            on_press:
              then:
                - lvgl.page.show: main_page   

With the code above the ESP-Home compiler trows the error below.

INFO ESPHome 2024.7.1
INFO Reading configuration /config/esphome/guition--tuin.yaml...
WARNING GPIO45 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
Failed config

text_sensor.homeassistant: [source /config/esphome/guition--tuin.yaml:286]
  platform: homeassistant
  id: switch_meisje_state
  entity_id: input_boolean.test
  on_value: 
    - then: 
        - if: 
            condition: 
              lambda: !lambda |-
                return x == 1;
            then: 
              - lvgl.label.update: 
                  
                  Couldn't find ID 'btn_water_meisje'. Please check you have defined an ID with that name in your configuration. These IDs look similar: "btn_meisje", "btn_waterbakjes", "btn_meisje_icon".
                  id: btn_water_meisje
                  bg_color: lv_color_hex(0xC7B5F)
            else: 
              - lvgl.label.update: 
                  
                  Couldn't find ID 'btn_water_meisje'. Please check you have defined an ID with that name in your configuration. These IDs look similar: "btn_meisje", "btn_waterbakjes", "btn_meisje_icon".
                  id: btn_water_meisje
                  bg_color: lv_color_hex(0xCC5E14)
  disabled_by_default: False

Who can/wants to point me to the error?

I removed a lot of unintresting code (pages due to the 32000 limit everything relevant should be there

When trying to compile the following

esphome:
  name: pooltoy
  friendly_name: PoolToy
  platformio_options:
    board_build.flash_mode: dio
  on_boot:
    - delay: 5s
    - lvgl.widget.hide: boot_screen

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:
  encryption:
    key: "jmCgYDFZCCMHuXIolnsws4oYXRb4keFvCwkx85oxHu0="
  on_client_connected:
    - if:
        condition:
          lambda: 'return (0 == client_info.find("Home Assistant "));'
        then:
          - lvgl.widget.show: lbl_hastatus
  on_client_disconnected:
    - if:
        condition:
          lambda: 'return (0 == client_info.find("Home Assistant "));'
        then:
          - lvgl.widget.hide: lbl_hastatus

ota:
  - platform: esphome
    password: "d34814fd15e289a7d66c34829fffe162"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: pooltoy.iot

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Pooltoy Fallback Hotspot"
    password: "senzafili"

captive_portal:

substitutions:
  lightbulb:     "\U000F0335"
  ceiling_light: "\U000F0769"
  floor_lamp:    "\U000F08DD"
  string_lights: "\U000F12BA"
  left:          "\U000F12BA"
  right:         "\U000F12BB"
  home:          "\U000F12BC"
  connection:    "\U000F12BD"
#-------------------------------------------
# ESPHOME PLATFORM SETTINGS
#-------------------------------------------
#esphome:
#  name: 480screen
#  friendly_name: 480screen
#  platformio_options:
#    board_build.flash_mode: dio

#-------------------------------------------
# ESP MCU SETTINGS for
# Guition ESP32-S3-4848S040
#-------------------------------------------
esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  flash_size: 16MB
  framework:
    type: esp-idf
    sdkconfig_options:
      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


# Enable Home Assistant API
web_server:
  port: 80  
  
external_components:
  - source: github://pr#6363
    refresh: 10min
    components: [lvgl]
   
time:
  - platform: sntp
    id: sntp_time
    timezone: America/New_York
    servers:
     - 0.pool.ntp.org
     - 1.pool.ntp.org
     - 2.pool.ntp.org
    on_time_sync:
      - script.execute: time_update
    on_time:
      - minutes: '*'
        seconds: 0
        then:
          - script.execute: time_update

script:
  - id: time_update
    then:
      - lvgl.label.update:
          id: display_time
          text: !lambda |-
            static char time_buf[17];
            auto now = id(sntp_time).now();            
            bool is_pm = now.hour >= 12;
            int hour_12 = now.hour % 12;
            if (hour_12 == 0) {
                hour_12 = 12; // 12 AM/PM should be displayed as 12, not 0
            }
            snprintf(time_buf, sizeof(time_buf), "%02d:%02d%s", hour_12, now.minute, is_pm ? "pm" : "am");
            return time_buf; 

#-------------------------------------------
# Buttons
#-------------------------------------------
switch:  
  - platform: lvgl
    name: Kitchen
    widget: lv_button_1
    on_turn_on:
      then:
        - lvgl.widget.update:
            id: lv_button_1_icon
            text_color: 0xFFFF00
        - homeassistant.service:
            service: light.turn_on
            data:
              entity_id: light.cespuglio_ingresso

    on_turn_off:
      then:
        - lvgl.widget.update:
            id: lv_button_1_icon
            text_color: 0xB6B6B6
        - homeassistant.service:
            service: light.turn_off
            data:
              entity_id: light.cespuglio_ingresso
  - platform: lvgl
    name: Outdoor
    widget: lv_button_2
    on_turn_on:
      then:
        - lvgl.widget.update:
            id: lv_button_2_icon
            text_color: 0xFFFF00
    on_turn_off:
      then:
        - lvgl.widget.update:
            id: lv_button_2_icon
            text_color: 0xB6B6B6            
       
#-------------------------------------------
# lvgl Buttons
#-------------------------------------------    
lvgl:
#  on_idle:
#    timeout: 90s
#    then:
#      - logger.log: "LVGL is idle"
#      - light.turn_off: backlight
#      - lvgl.pause:
  theme:
#    label:
#      text_font: roboto24 # set all your labels to use your custom defined font
    btn:
      width: 120
      height: 120
      bg_color: 0xFFFFFF #0x2F8CD8
      bg_grad_color: 0xFFFFFF #0x005782
      bg_grad_dir: VER
      bg_opa: COVER
      border_color: 0x0077b3
      border_width: 1
      text_color: 0x000000 #0xFFFFFF
      pressed: # set some btn colors to be different in pressed state
        bg_color: 0x006699
        bg_grad_color: 0x00334d
      checked: # set some btn colors to be different in checked state
        bg_color: 0x1d5f96
        bg_grad_color: 0x03324A
        text_color: 0xfff300
    btnmatrix:
      bg_opa: TRANSP
      border_color: 0x0077b3
      border_width: 0
      text_color: 0xFFFFFF
      pad_all: 0
      items: # set all your btnmatrix buttons to use your custom defined styles and font
        bg_color: 0x2F8CD8
        bg_grad_color: 0x005782
        bg_grad_dir: VER
        bg_opa: COVER
        border_color: 0x0077b3
        border_width: 1
        text_color: 0xFFFFFF
#        text_font: roboto24
        pressed:
          bg_color: 0x006699
          bg_grad_color: 0x00334d
        checked:
          bg_color: 0x1d5f96
          bg_grad_color: 0x03324A
          text_color: 0x005580
    switch:
      bg_color: 0xC0C0C0
      bg_grad_color: 0xb0b0b0
      bg_grad_dir: VER
      bg_opa: COVER
      checked:
        bg_color: 0x1d5f96
        bg_grad_color: 0x03324A
        bg_grad_dir: VER
        bg_opa: COVER
      knob:
        bg_color: 0xFFFFFF
        bg_grad_color: 0xC0C0C0
        bg_grad_dir: VER
        bg_opa: COVER
    slider:
      border_width: 1
      border_opa: 15%
      bg_color: 0xcccaca
      bg_opa: 15%
      indicator:
        bg_color: 0x1d5f96
        bg_grad_color: 0x03324A
        bg_grad_dir: VER
        bg_opa: COVER
      knob:
        bg_color: 0x2F8CD8
        bg_grad_color: 0x005782
        bg_grad_dir: VER
        bg_opa: COVER
        border_color: 0x0077b3
        border_width: 1
        text_color: 0xFFFFFF
  style_definitions:
    - id: header_footer
#      text_font: light32

      bg_color: 0x2F8CD8
      bg_grad_color: 0x005782
      bg_grad_dir: VER
      bg_opa: COVER
      border_width: 0
      radius: 0
      pad_all: 0
      pad_row: 0
      pad_column: 0
      border_color: 0x0077b3
      text_color: 0xFFFFFF
      width: 100%
      height: 30
  displays:
    - display_id: my_display
  touchscreens:
    - touchscreen_id: my_touchscreen

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

#  theme:
#    btn:
#      text_font: roboto24
#      scroll_on_focus: true
#      radius: 25
#      group: general
#      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

  
  top_layer:
    widgets:
      - btnmatrix:
          align: bottom_mid
          styles: header_footer
          pad_all: 0
          outline_width: 0
          id: top_layer
          items:
            styles: header_footer
          rows:
            - buttons:
              - id: page_prev
                text: "\uF053"
                on_press:
                  then:
                    lvgl.page.previous:
              - id: page_home
                text: "\uF015"
                on_press:
                  then:
                    lvgl.page.show: stato_piscina
              - id: page_next
                text: "\uF054"
                on_press:
                  then:
                    lvgl.page.next:
      - label:
          text: "\uF1EB"
          id: lbl_hastatus
          hidden: true
          align: top_right
          text_align: right
          text_color: 0xFFFFFF          
      - obj:
          id: boot_screen
          x: 0
          y: 0
          width: 100%
          height: 100%
          bg_color: 0xffffff
          bg_opa: COVER
          radius: 0
          pad_all: 0
          border_width: 0
          widgets:
            - img:
                align: CENTER
                src: boot_logo
            - spinner:
                align: CENTER
                y: 150
                height: 50
                width: 50
                spin_time: 1s
                arc_length: 60deg
                arc_width: 8
                indicator:
                  arc_color: 0x18bcf2
                  arc_width: 8
          on_press:
            - lvgl.widget.hide: boot_screen               

       
  page_wrap: true
  
  pages:
    - id: stato_piscina
      widgets:
        - obj:
            id: statoph
            align: TOP_MID
            styles: header_footer
            widgets:
            - label:
                text: "Stato"
                align: CENTER
                text_align: CENTER
                text_color: 0xFFFFFF   
        - obj:
            id: statopp
            align: CENTER
            width: 480
            height: 420
            text_font: montserrat_26
            pad_all: 0
            pad_column: 0
            scrollable: OFF
            layout:
              type: GRID
              grid_rows: [ FR(52), FR(52),FR(52),FR(52),FR(52),FR(52),FR(52),FR(52)]
              grid_columns: [FR(60), FR(420)]
            widgets:
              #ROW 1
              - img:
                  src: temperatura_esterna
                  grid_cell_row_pos: 0
                  grid_cell_column_pos: 0
              - label:
                  text: "Temperatura Ambiente"
                  text_align: RIGHT
                  grid_cell_row_pos: 0
                  grid_cell_column_pos: 1
            #ROW 2
              - img:
                  src: temperatura_acqua
                  grid_cell_row_pos: 1
                  grid_cell_column_pos: 0
              - label:
                  text: "Temperatura Acqua"
                  id: lbl_temperatura_acqua
                  text_align: RIGHT
                  grid_cell_row_pos: 1
                  grid_cell_column_pos: 1
            # ROW 3
              - img:
                  src: raggi_uv
                  grid_cell_row_pos: 2
                  grid_cell_column_pos: 0
              - obj:
                  grid_cell_row_pos: 2
                  grid_cell_column_pos: 1
                  width: 420
                  height: 52
                  scrollable: OFF
                  radius: 0
                  pad_all: 0
                  bg_opa: cover   
                  widgets:
                    - obj: 
                        x: 0
                        width: 84
                        height: 48
                        radius: 0
                    - obj:
                        x: 84
                        width: 84
                        height: 48
                        radius: 0
                    - obj: 
                        x: 168
                        width: 84
                        height: 48
                        radius: 0
                    - obj: 
                        x: 252
                        width: 84
                        height: 48
                        radius: 0
                    - obj:
                        x: 336
                        width: 84
                        height: 48
                        radius: 0

            # ROW 4
              - img:
                  src: ph
                  grid_cell_row_pos: 3
                  grid_cell_column_pos: 0
              - bar:
                  pad_top: 5
                  pad_bottom: 5
                  grid_cell_row_pos: 3
                  grid_cell_column_pos: 1
                  id: bar_id1
                  align: CENTER
                  value: 75
                  min_value: 1
                  max_value: 100
                  width: 420
                  height: 28
                  radius: 0

              - img:
                  src: orp
                  grid_cell_row_pos: 4
                  grid_cell_column_pos: 0
              - label:
                  text: "orp"
                  text_align: RIGHT
                  grid_cell_row_pos: 4
                  grid_cell_column_pos: 1

              - img:
                  src: salinita
                  grid_cell_row_pos: 5
                  grid_cell_column_pos: 0
              - label:
                  text: "salinita"
                  text_align: RIGHT
                  grid_cell_row_pos: 5
                  grid_cell_column_pos: 1

              - img:
                  src: livello_tanica
                  grid_cell_row_pos: 6
                  grid_cell_column_pos: 0
              - label:
                  text: "Livello Tanica"
                  text_align: RIGHT
                  grid_cell_row_pos: 6
                  grid_cell_column_pos: 1

              - img:
                  src: manutenzione
                  grid_cell_row_pos: 7
                  grid_cell_column_pos: 0
              - label:
                  text: "Ultimo Controlavaggio"
                  text_align: RIGHT
                  grid_cell_row_pos: 7
                  grid_cell_column_pos: 1

    - id: luci_e_interruttori
      layout: 
        type: flex
        flex_flow: ROW_WRAP
        flex_align_main: SPACE_EVENLY
        flex_align_cross: SPACE_EVENLY
      widgets:
        - obj:
            align: TOP_MID
            styles: header_footer
            widgets:
              - label:
                  text: "Luci e Interruttori"
                  align: CENTER
                  text_align: CENTER
                  text_color: 0xFFFFFF
        - btn:
            checkable: true
            id: lv_button_1
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $lightbulb
                  id: lv_button_1_icon
              - label:
                  align: bottom_left
                  text: "Cespuglio Ingresso"
                  long_mode: dot
        - btn:
            checkable: true
            id: lv_button_2
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $string_lights
                  id: lv_button_2_icon
              - label:
                  align: bottom_left
                  text: "Outdoor"
                  long_mode: dot              
        - btn:
            checkable: true
            id: lv_button_3
            widgets:
              #- label:
              #    text_font: light32
              #    align: top_left
              #    text: $floor_lamp
              #    id: lv_button_3_icon
              #- label:
              #    align: bottom_left
              #    text: "Living Room"
              #    long_mode: dot

              - img:
                  align: CENTER
                  src: wink
                  id: salinita_id
              - label:
                  align: bottom_left
                  text: "Cespuglio Ingresso"
                  long_mode: dot                  
        - btn:
            checkable: true
            id: lv_button_4
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $lightbulb
                  id: lv_button_4_icon
              - label:
                  align: bottom_left
                  text: "Accent"
                  long_mode: dot
        - btn:
            checkable: true
            id: lv_button_5
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $lightbulb
                  id: lv_button_5_icon
              - label:
                  align: bottom_left
                  text: "Bed Room"
                  long_mode: dot              
        - btn:
            checkable: true
            id: lv_button_6
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $lightbulb
                  id: lv_button_6_icon
              - label:
                  id: display_time
                  align: bottom_left
                  text: "00:00am"
                  long_mode: dot
        - btn:
            checkable: true
            id: lv_button_7
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $lightbulb
                  id: lv_button_7_icon
              - label:
                  align: bottom_left
                  text: "Fan"
                  long_mode: dot
        - btn:
            checkable: true
            id: lv_button_8
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $lightbulb
                  id: lv_button_8_icon
              - label:
                  align: bottom_left
                  text: "Timer"
                  long_mode: dot              
        - btn:
            checkable: true
            id: lv_button_9
            widgets:
              - label:
                  text_font: light32
                  align: top_left
                  text: $lightbulb
                  id: lv_button_9_icon
              - label:
                  align: bottom_left
                  text: "Lamp"
                  long_mode: dot
    - id: musica
      layout: 
        type: flex
        flex_flow: COLUMN_WRAP
      widgets:
        - obj:
            align: TOP_MID
            styles: header_footer
            widgets:
              - label:
                  text: "Musica"
                  align: CENTER
                  text_align: CENTER
                  text_color: 0xFFFFFF
              - bar:
                  x: 10
                  y: 100
                  id: bar_id
                  align: CENTER
                  width: 480
                  height: 100
                  value: 75
                  min_value: 1
                  max_value: 100
    - id: sicurezza
      layout: 
        type: flex
        flex_flow: COLUMN_WRAP
      widgets:
        - obj:
            align: TOP_MID
            styles: header_footer
            widgets:
              - label:
                  text: "Sicurezza"
                  align: CENTER
                  text_align: CENTER
                  text_color: 0xFFFFFF
        - img:
            align: CENTER
            src: wink
      



#-------------------------------------------
# Internal outputs
#-------------------------------------------
output:
    # Backlight LED
  - platform: ledc
    pin: GPIO38
    id: GPIO38
    frequency: 100Hz
    
    # Built in 240v relay
  - id: internal_relay_1
    platform: gpio
    pin: 40



#-------------------------------------------
# Graphicsd and Fonts
#-------------------------------------------
image:
  - file: https://esphome.io/_images/logo.png
    id: boot_logo_original
    resize: 480x480
    type: RGB565

#  - file: "images/001.png"
#    id: wallsconce_180
#    resize: 20x20
    
 # - file: "images/carbon.jpg"
#    id: wall_carbon
#    resize: 480x480
#    type: RGB565    

# sensori
  - file: "images/pooltoy/pooltoy.png"
    id: boot_logo
    resize: 480x480
    type: RGB565
  - file: "images/pooltoy/noun-grounding-rod-6993401.jpg"
    id: orp_2
    resize: 52x52
    type: RGB565
  - file: "images/pooltoy/noun-ph-5797721.jpg"
    id: ph
    resize: 52x52
    type: RGB565
  - file: "images/pooltoy/noun-soil-salinity-6490657.jpg"
    id: salinita
    resize: 52x52
    type: RGB565
  - file: "images/pooltoy/noun-temperatureexternal-6844994.jpg"
    id: temperatura_esterna
    resize: 52x52
    type: RGB565
  - file: "images/pooltoy/noun-temperature-6970346.jpg"
    id: temperatura_acqua
    resize: 52x52
    type: RGB565  
  - file: "images/pooltoy/noun-uv-protection-6043887.jpg"
    id: raggi_uv
    resize: 52x52
    type: RGB565  
  - file: "images/pooltoy/noun-beaker-7710.jpg"
    id: livello_tanica
    resize: 52x52
    type: RGB565  
  - file: "images/pooltoy/noun-orp.jpg"
    id: orp
    resize: 52x52
    type: RGB565  
  - file: "images/pooltoy/wink.png"
    id: wink
    resize: 52x52
    type: RGB565  

# Luci e Interruttori
  - file: "images/pooltoy/noun-grass-5105978.jpg"
    id: luci_giardino
    resize: 52x52
    type: RGB565
  - file: "images/pooltoy/noun-olive-tree-6942066.jpg"
    id: luci_ulivo
    resize: 52x52
    type: RGB565
  - file: "images/pooltoy/noun-lamp-4897109.jpg"
    id: luci_esterno_casa
    resize: 52x52
    type: RGB565
  - file: "images/pooltoy/noun-maintenance-6731622.jpg"
    id: manutenzione
    resize: 52x52
    type: RGB565
  - file: "images/pooltoy/noun-pool-pump-6952149.jpg"
    id: pompa_piscina
    resize: 52x52
    type: RGB565
  - file: "images/pooltoy/noun-pool-6935336.jpg"
    id: luci_piscina
    resize: 52x52
    type: RGB565  


    
font:
  - file: "fonts/materialdesignicons-webfont.ttf"
    id: icons_100
    size: 100
    bpp: 4
    glyphs: [
      "\U000F0594", # clear-night
      "\U000F0590", # cloudy
      "\U000F0F2F", # exceptional
      "\U000F0591", # fog
      "\U000F0592", # hail
      "\U000F0593", # lightning
      "\U000F067E", # lightning-rainy
      "\U000F0595", # partlycloudy
      "\U000F0596", # pouring
      "\U000F0597", # rainy
      "\U000F0598", # snowy
      "\U000F067F", # snowy-rainy
      "\U000F0599", # sunny
      "\U000F059D", # windy
      "\U000F059E", # windy-variant
      "\U000F14E4", # sunny-off
      ]
  - file: "gfonts://Roboto"
    id: roboto24
    size: 24
    bpp: 4
    extras:
      - file: 'fonts/materialdesignicons-webfont.ttf' # http://materialdesignicons.com/cdn/7.4.47/ 
        glyphs: [
          "\U000F004B",
          "\U0000f0ed",
          "\U000F006E",
          "\U000F012C",
          "\U000F179B",
          "\U000F0748",
          "\U000F1A1B",
          "\U000F02DC",
          "\U000F0A02",
          "\U000F035F",
          "\U000F0156",
          "\U000F0C5F", 
          "\U000f0084",
          "\U000f0091",
          ]
  - file: 'fonts/materialdesignicons-webfont.ttf' # http://materialdesignicons.com/cdn/7.4.47/ 
    id: weather70
    size: 70
    bpp: 4
    glyphs: &mdi-weather-glyphs
      - "\U000F0590" # mdi-weather-cloudy
      - "\U000F0F2F" # mdi-weather-cloudy-alert
      - "\U000F0E6E" # mdi-weather-cloudy-arrow-right
      - "\U000F0591" # mdi-weather-fog
      - "\U000F0592" # mdi-weather-hail
      - "\U000F0F30" # mdi-weather-hazy
      - "\U000F0898" # mdi-weather-hurricane
      - "\U000F0593" # mdi-weather-lightning
      - "\U000F067E" # mdi-weather-lightning-rainy
      - "\U000F0594" # mdi-weather-clear-night
      - "\U000F0F31" # mdi-weather-night-partly-cloudy
      - "\U000F0595" # mdi-weather-partly-cloudy
      - "\U000F0F32" # mdi-weather-partly-lightning
      - "\U000F0F33" # mdi-weather-partly-rainy
      - "\U000F0F34" # mdi-weather-partly-snowy
      - "\U000F0F35" # mdi-weather-partly-snowy-rainy
      - "\U000F0596" # mdi-weather-pouring
      - "\U000F0597" # mdi-weather-rainy
      - "\U000F0598" # mdi-weather-snowy
      - "\U000F0F36" # mdi-weather-snowy-heavy
      - "\U000F067F" # mdi-weather-snowy-rainy
      - "\U000F0599" # mdi-weather-sunny
      - "\U000F0F37" # mdi-weather-sunny-alert
      - "\U000F14E4" # mdi-weather-sunny-off
      - "\U000F059A" # mdi-weather-sunset
      - "\U000F059B" # mdi-weather-sunset-down
      - "\U000F059C" # mdi-weather-sunset-up
      - "\U000F0F38" # mdi-weather-tornado
      - "\U000F059D" # mdi-weather-windy
      - "\U000F059E" # mdi-weather-windy-variant

  - file: 'fonts/materialdesignicons-webfont.ttf' # http://materialdesignicons.com/cdn/7.4.47/ 
    id: light32
    size: 32
    bpp: 4
    glyphs: [
      "\U000F0335", # mdi-lightbulb
      "\U000F0769", # mdi-ceiling-light
      "\U000F08DD", # mdi-floor-lamp
      "\U000F12BA", # mdi-string-lights
      "\U000F12BB", # mdi-string-lights
      "\U000F12BC", # mdi-string-lights
      "\U000F12BD", # mdi-string-lights
      "\U000F12BE", # mdi-string-lights
      ]          
      
  - file: "gfonts://Roboto"
    id: roboto10
    size: 10
    bpp: 4    

#-------------------------------------------
# Touchscreen gt911 i2c
#-------------------------------------------
i2c:
  - id: bus_a
    sda: GPIO19
    scl: GPIO45
    #frequency: 100kHz
    
touchscreen:
  platform: gt911
  transform:
    mirror_x: false
    mirror_y: false
  id: my_touchscreen
  display: my_display
  on_touch:
    - 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
          );

  on_release:
      - if:
          condition: lvgl.is_paused
          then:
            - logger.log: "LVGL resuming"
            - lvgl.resume:
            - lvgl.widget.redraw:
            - light.turn_on: backlight

#-------------------------------------------
# Display st7701s spi
#-------------------------------------------
spi:
  - id: lcd_spi
    clk_pin: GPIO48
    mosi_pin: GPIO47
    
display:
  - platform: st7701s
    id: my_display
    update_interval: never
    auto_clear_enabled: True
    data_rate: 2MHz
    spi_mode: MODE3
    color_order: RGB
    invert_colors: false
    dimensions:
      width: 480
      height: 480
    transform:
      mirror_x: false
      mirror_y: false
    cs_pin: 39
      # reset not defined 
    de_pin: 18
    hsync_pin: 16
    vsync_pin: 17
    pclk_pin: 21
    init_sequence: 
      - 1
      - [0xFF, 0x77, 0x01, 0x00, 0x00, 0x10] # CMD2_BKSEL_BK0
      - [0xCD, 0x00] # disable MDT flag
    pclk_frequency: 12MHz
    pclk_inverted: false
    data_pins:
      red:
        - 11         # R1
        - 12         # R2
        - 13         # R3
        - 14         # R4
        - 0          # R5
      green:
        - 8          # G0
        - 20         # G1
        - 3          # G2
        - 46         # G3
        - 9          # G4
        - 10         # G5 
      blue:
        - 4          # B1
        - 5          # B2
        - 6          # B3
        - 7          # B4
        - 15         # B5


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

text:
  - platform: lvgl
    name: fr_cond_icon
    widget: lbl_temperatura_acqua
    mode: text
  - platform: lvgl
    name: fr_cond_name
    widget: lbl_temperatura_acqua
    mode: text
#-------------------------------------------
# LIGHTS
#-------------------------------------------

light:
  - platform: monochromatic
    output: GPIO38
    name: Backlight
    id: backlight
    restore_mode: ALWAYS_ON

#  - platform: binary
#    output: internal_relay_1
#    name: Internal Light
#    id: internal_light
#    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

If I try to add a
bg_color:
option at the page stato_piscina - ROW 3

either at parent object or at children (as below)

             - obj:
                  grid_cell_row_pos: 2
                  grid_cell_column_pos: 1
                  width: 420
                  height: 52
                  scrollable: OFF
                  radius: 0
                  pad_all: 0
                  bg_opa: cover   
                  widgets:
                    - obj: 
                        x: 0
---                    bg_color: #000000
                        width: 84```

I get the following error

Couldn't find any component that can be used for 'Color'. Are you missing a hub declaration?.
No quick fix available

wrong color format
bg_color: #000000

1 Like

Does this error message not give you some clue?

Thank you for your reply,

unfortunaly not. i have checked it and its declared like other stats. (zonnescherm/screen)

Hello,
has anybody been able to successfully use the action lvgl.slider.update ? It just wonā€™t update between esphome and HA. If I change the widget to arc and use lvgl.arc.update, it works without any other changes. So I donā€™t think my code is faulty.

  - platform: homeassistant
    id: light_brightness
    entity_id: light.fan_living_room_light
    attribute: brightness
    on_value:
      - lvgl.slider.update:
          id: dimmer_slider
          value: !lambda return x;
        - obj:
            checkable: true
            id: light_button_4
            height: 210
            widgets:
            - slider:
                id: dimmer_slider
                #width: 30
                #height: 150
                min_value: 0
                max_value: 255
                on_release:
                  - homeassistant.service:
                      service: light.turn_on
                      data:
                        entity_id: light.fan_living_room_light
                        brightness: !lambda return int(x);

There is either a language or a comprehension barrier here. Let me break it down very simply;

Your code:

            - lvgl.label.update:
                id: btn_water_meisje
                bg_color:  0x0C7B5F

is attempting to change the state of a label, and itā€™s specified that that label should have an id of btn_water_meisje. So somewhere in your config there should be a label defined, like this:

    - label:
        id: btn_water_meisje

The error message is Couldn't find ID 'btn_water_meisje' so itā€™s saying there is nothing in the yaml declared with that id (label or otherwise.)

So letā€™s look at the rest of the config. First search for all the labels - look for the pattern - label:. There are 6 in all. One doesnā€™t have id defined at all, the others are:

              - label:
                  text_font: roboto100
                  align: CENTER
                  text: $fountain
                  id: btn_meisje_icon
              - label:
                  id: btn_meisje
                  align: bottom_mid
                  text: "Meisje"

...

              - label:
                  text_font: roboto100
                  align: CENTER
                  text: $fountain
                  id: btn_waterbakjes_icon
              - label:
                  id: btn_waterbakjes
                  align: bottom_mid
                  text: "Waterbakjes"

...

              - label:
                  text_font: light32
                  align: center
                  text: $home
                  id: page_waterornamenten_btn_home_icon

Look carefully at the id: key for each of those - do any of them have the id btn_water_meisje? I would say no, even though I donā€™t understand Nederlands.

So I agree with the yaml parser - there is no label defined with that ID.

So when you say

i have checked it and its declared like other stats.

you must have been looking at something completely different, or ā€œitā€ means something else entirely. I have no idea, since you didnā€™t say what ā€œitā€ was and I can only go on the yaml you provided. Perhaps the ā€œuninterestingā€ stuff you omitted is important? Either way, there is no label defined with that ID, because thatā€™s what the error message says. No amount of denial changes that.

If you think you have defined such a label, show us the code that you think does so and somebody will be able to point out your error.

Fixed recently, make sure you are using the latest version of the PR.

1 Like

Hello! I have a few questions about LVGL (ESPHome) and this display in particular. Could you spare a little time and answer a few questions?
Questions:

  1. How do I change the background in the switch widget when it is on?
indicator:
   bg_color: 0xFF0000

not working
2) What should I write in external_components to always get the latest version?
3) I get beautiful things in LVGL, but there are problems with the gradient, as well as the alpha channel. If I remove the background from the picture, aliasing appears. I have to make weather icons using glyphs, which is very inconvenient. As far as I understand, in both cases the problem is in RGB565? Can this display output RGB888? If so, is there an implementation of this functionality in LVGL 8.4 or do I need version 9?
4) I saw the LVGL-9 branch on GitHub. Is this version usable and is there documentation for it?

Thank you very much in advance for answering my questions.
Best regards, Alex

        - switch:
            id: lv_switch
            indicator:
              checked:
                bg_color: 0xFF0000
external_components:
  - source: github://clydebarrow/esphome@lvgl
    refresh: 10min
    components: [ lvgl]

Yes, this is because RGB565 does not have an alpha channel. There is support in LVGL for RGB565A images but this is not yet supported in ESPHome.

Itā€™s not complete and would not help with the transparency issue in any case.

1 Like
- switch:
    id: lv_switch
    indicator:
      checked:
      bg_color: 0xFF0000

It works)) I tried the ā€œindicatorā€ and ā€œcheckcedā€ separately, but didnā€™t think of doing it together (this should be corrected in the documentation). Thankā€™s a lot))

Iā€™m working on a thermostat, it works very well, but I would like the ā€œtarget temperatureā€ to be displayed as a dot, like in home assistant. Is this possible? And is it possible to superimpose another ā€œarcā€ from this dot, like in Home Assistant?

But it should be like in home Assistant. Is it possible?

And another question, why in the ā€œgridā€ mode there are indents on the right and down? Small, about 2 pixels, how to remove them?

P.S. Once again, I would like to express my deep gratitude to you for your work.

Yes, all thatā€™s possible, probably with multiple superimposed arc widgets. But Iā€™m a programmer not a designer so canā€™t really help much more than that.

why in the ā€œgridā€ mode there are indents on the right and down? Small, about 2 pixels, how to remove them?

Without seeing it, at a guess I would say they are scroll bars, due to the content being just a bit too big for the container.