NSPanel ESPHOME issue

Hi,

I have a working configuration of my NSPanel with ESPHome. See complete working code at the bottom

When I add section to control my screens (see code hereafter) and install it on the NS panel things go crazy :face_with_thermometer:
Flashing of the code is succesful, but when the NSpanel starts the screen is flashing on and of randomly
The logging I get is this:

Linking /data/ns-panel-keuken/.pioenvs/ns-panel-keuken/firmware.elf
RAM:   [=         ]  13.2% (used 43320 bytes from 327680 bytes)
Flash: [=======   ]  67.0% (used 1229832 bytes from 1835008 bytes)
Building /data/ns-panel-keuken/.pioenvs/ns-panel-keuken/firmware.bin
esp32_create_combined_bin(["/data/ns-panel-keuken/.pioenvs/ns-panel-keuken/firmware.bin"], ["/data/ns-panel-keuken/.pioenvs/ns-panel-keuken/firmware.elf"])
Wrote 0x13c470 bytes to file /data/ns-panel-keuken/.pioenvs/ns-panel-keuken/firmware-factory.bin, ready to flash to offset 0x0
========================= [SUCCESS] Took 49.66 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.0.64
INFO Uploading /data/ns-panel-keuken/.pioenvs/ns-panel-keuken/firmware.bin (1229936 bytes)
Uploading: [============================================================] 100% Done...

INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.0.64 using esphome API
WARNING Can't connect to ESPHome API for 192.168.0.64: Timeout while connecting to ('192.168.0.64', 6053)
INFO Trying to reconnect to 192.168.0.64 in the background

The NSpanel is connected to WiFi,the boot process seems not complete.
I can reflash the NSPanel without the screen code and it’s working normal.
Any help is more than welcome :pray:

  - platform: nextion
    name: $device_name Screen Links Open
    page_id: 3
    component_id: 2
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: cover.open_cover
            data:
              entity_id: cover.screen_links
# Set some variables for convenience
substitutions:
  node_name: ns-panel-keuken
  device_name: NS Panel Keuken
  
# Note: this may not be needed if the pull request has been merged.
# Check https://github.com/esphome/esphome/pull/2956 for current status.
external_components:
  - source: github://pr#2956
    components: [nextion]
    refresh: 1h

esphome:
  name: $node_name
  comment: $device_name

esp32:
  board: esp32dev

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

web_server:
  port: 80 
# Enable logging
logger:

# Enable wireless updates
ota:

# Enable Home Assistant API
api:
  services:
    # Service to play a song
    - service: play_rtttl
      variables:
        song_str: string
      then:
        - rtttl.play:
            rtttl: !lambda 'return song_str;'
    - service: upload_tft_keuken_display
      then:
        - lambda: 'id(disp1)->upload_tft();'

# A reboot button is always useful
button:
  - platform: restart
    name: Restart $device_name

time:
  - platform: sntp
    id: sntp_time  
  - platform: homeassistant
    id: esptime    
    
# Define some inputs
binary_sensor:
  - platform: gpio
    name: $device_name Left Button
    pin:
      number: 14
      inverted: true
    # on_click:
    #   - switch.toggle: relay_1

  - platform: gpio
    name: $device_name Right Button
    pin:
      number: 27
      inverted: true
    # on_click:
    #   - switch.toggle: relay_2
    
# Open door
  - platform: nextion
    name: $device_name Open door Button
    page_id: 0
    component_id: 9   
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: script.1638210729999
            data:
              {}
              
# Radio 
  - platform: nextion
    name: $device_name Radio 1 Button
    page_id: 1
    component_id: 3
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: media_player.play_media
            data:
              entity_id: media_player.mass_sonos_arc
              media_content_id: media-source://radio_browser/96126f56-0601-11e8-ae97-52543be04c81
              media_content_type: audio/aac
              
  - platform: nextion
    name: $device_name Radio 2 Button
    page_id: 1
    component_id: 4   
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: media_player.play_media
            data:
              entity_id: media_player.mass_sonos_arc
              media_content_id: media-source://radio_browser/96126e82-0601-11e8-ae97-52543be04c81
              media_content_type: music          
  - platform: nextion
    name: $device_name Radio 3 Button
    page_id: 1
    component_id: 5   
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: media_player.play_media
            data:
              entity_id: media_player.mass_sonos_arc
              media_content_id: media-source://radio_browser/0c62b9d7-8de0-4693-9842-6bf9b50229d3
              media_content_type: music       
  - platform: nextion
    name: $device_name Skyradio Button
    page_id: 1
    component_id: 6 
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: media_player.play_media
            data:
              entity_id: media_player.mass_sonos_arc
              media_content_id: media-source://radio_browser/960d7b8c-0601-11e8-ae97-52543be04c81
              media_content_type: music      
  - platform: nextion
    name: $device_name Radio 538 Button
    page_id: 1
    component_id: 7   
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: media_player.play_media
            data:
              entity_id: media_player.mass_sonos_arc
              media_content_id: media-source://radio_browser/9621245c-0601-11e8-ae97-52543be04c81
              media_content_type: music    
  - platform: nextion
    name: $device_name Qmusic Button
    page_id: 1
    component_id: 8 
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: media_player.play_media
            data:
              entity_id: media_player.mass_sonos_arc
              media_content_id: media-source://radio_browser/46fa6110-f53b-4d9d-85c2-6534c830f27c
              media_content_type: music      
  - platform: nextion
    name: $device_name Radio Veronica Button
    page_id: 1
    component_id: 9 
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: media_player.play_media
            data:
              entity_id: media_player.mass_sonos_arc
              media_content_id: media-source://radio_browser/960d4f91-0601-11e8-ae97-52543be04c81
              media_content_type: music      
  - platform: nextion
    name: $device_name Soulshow Button
    page_id: 1
    component_id: 10    
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: media_player.play_media
            data:
              entity_id: media_player.mass_sonos_arc
              media_content_id: media-source://radio_browser/96123c26-0601-11e8-ae97-52543be04c81
              media_content_type: music    

  - platform: nextion
    name: $device_name Volume Down Button
    page_id: 1
    component_id: 11   
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: media_player.volume_down  
            data:            
              entity_id: media_player.mass_sonos_arc
  - platform: nextion
    name: $device_name Volume Up Button
    page_id: 1
    component_id: 12    
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: media_player.volume_up
            data:
              entity_id: media_player.mass_sonos_arc
  - platform: nextion
    name: $device_name Radio Stop Button
    page_id: 1
    component_id: 13   
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: media_player.media_stop
            data:
              entity_id: media_player.mass_sonos_arc


#--------------------------------scenarios-----------------------------------
  - platform: nextion
    name: $device_name Lampen Binnen
    page_id: 5
    component_id: 4
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: scene.turn_on
            data:
              entity_id: scene.alle_lampen
  - platform: nextion
    name: $device_name Lampen Beneden
    page_id: 5
    component_id: 5
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: scene.turn_on
            data:
              entity_id: scene.alle_lampen_beneden_uit
  - platform: nextion
    name: $device_name Lampen Boven
    page_id: 5
    component_id: 6
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: scene.turn_on
            data:
              entity_id: scene.alle_lampen_boven_uit
  - platform: nextion
    name: $device_name Lampen Buiten
    page_id: 5
    component_id: 7
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: scene.turn_on
            data:
              entity_id: scene.alle_buiten_verlichting_uit
  - platform: nextion
    name: $device_name Woonkamer Normaal
    page_id: 5
    component_id: 8
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: scene.turn_on
            data:
              entity_id: scene.woonkamer_normaal
  - platform: nextion
    name: $device_name TV Kijken
    page_id: 5
    component_id: 9
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: scene.turn_on
            data:
              entity_id: scene.woonkamer_tv_kijken
  - platform: nextion
    name: $device_name Slapen
    page_id: 5
    component_id: 10
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: scene.turn_on
            data:
              entity_id: scene.slapen
  - platform: nextion
    name: $device_name Opstaan
    page_id: 5
    component_id: 11
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: scene.turn_on
            data:
              entity_id: scene.opstaan


                                                       
#--------------------------------Thermostat----------------------------------- 
  - platform: nextion
    name: $device_name Thermostat 18C
    page_id: 6
    component_id: 3
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: climate.set_temperature
            data:
              entity_id: climate.nibe_126820_s1_room
              temperature: '18'  
  - platform: nextion
    name: $device_name Thermostat 20C
    page_id: 6
    component_id: 4
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: climate.set_temperature
            data:
              entity_id: climate.nibe_126820_s1_room
              temperature: '20'                
      
  - platform: nextion
    name: $device_name Thermostat up
    page_id: 6
    component_id: 7
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: climate.set_temperature
            data_template:
              entity_id: climate.nibe_126820_s1_room
              temperature: "{{(state_attr('climate.nibe_126820_s1_room' , 'temperature')|round(0)) + 1 }}"
              
  - platform: nextion
    name: $device_name Thermostat down
    page_id: 6
    component_id: 8
    internal: true
    on_press:
      then:
        - homeassistant.service:
            service: climate.set_temperature
            data_template:
              entity_id: climate.nibe_126820_s1_room
              temperature: "{{(state_attr('climate.family_room' , 'temperature')|round(0)) - 1 }}"
              
sensor:              

  # - platform: wifi_signal
  #   name: $device_name WiFi Signal
  #   update_interval: 60s

  # - platform: ntc
  #   id: temperature
  #   sensor: resistance_sensor
  #   calibration:
  #     b_constant: 3950
  #     reference_temperature: 25°C
  #     reference_resistance: 10kOhm
  #   name: $device_name Temperature

  # - platform: resistance
  #   id: resistance_sensor
  #   internal: true
  #   sensor: ntc_source
  #   configuration: DOWNSTREAM
  #   resistor: 11.2kOhm

  # - platform: adc
  #   id: ntc_source
  #   pin: 38
  #   update_interval: 10s
  #   attenuation: 11db
  #   internal: true

  # Grab current inside temperature/humidty/co2 from Home Assistant
  - platform: homeassistant
    id: current_temperature
    entity_id: sensor.netatmo_casa_du_pre_weer_station_temperature
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("temp", "%.1f ""\xb0""C", x);'

  - platform: homeassistant
    id: current_humidity
    entity_id: sensor.netatmo_casa_du_pre_weer_station_humidity
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("humidity", "%.0f ""\x25""%", x);'
        
  - platform: homeassistant
    id: current_co2
    entity_id: sensor.netatmo_casa_du_pre_weer_station_co2
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("co2", "%.0f ""ppm", x);'
        
  # Grab current outside temperature/humidty/wind/baro from Home Assistant
  - platform: homeassistant
    id: current_otemp
    entity_id: sensor.netatmo_casa_du_pre_woonkamer_buitenmodule_temperature
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.otemp", "%.1f ""\xb0""C", x);'

  - platform: homeassistant
    id: current_ohum
    entity_id: sensor.netatmo_casa_du_pre_woonkamer_buitenmodule_humidity
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.ohum", "%.0f ""\x25""%", x);'
        
  - platform: homeassistant
    id: current_owind
    entity_id: sensor.netatmo_casa_du_pre_weer_station_windmeter_wind_strength
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.owind", "%.0f ""km/u", x);'
      
  - platform: homeassistant
    id: current_obaro
    entity_id: sensor.netatmo_casa_du_pre_weer_station_pressure
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.obaro", "%.0f ""mbar", x);'

  # Grab current weather predictions from Home Assistant
  - platform: homeassistant
    id: max1
    entity_id: sensor.buienradar_temperature_1d
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.max1", "%.1f ""\xb0""C", x);'
  - platform: homeassistant
    id: min1
    entity_id: sensor.buienradar_minimum_temperature_1d
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.min1", "%.1f ""\xb0""C", x);'
  - platform: homeassistant
    id: max2
    entity_id: sensor.buienradar_temperature_2d
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.max2", "%.1f ""\xb0""C", x);'
  - platform: homeassistant
    id: min2
    entity_id: sensor.buienradar_minimum_temperature_2d
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.min2", "%.1f ""\xb0""C", x);'
  - platform: homeassistant
    id: max3
    entity_id: sensor.buienradar_temperature_3d
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.max3", "%.1f ""\xb0""C", x);'
  - platform: homeassistant
    id: min3
    entity_id: sensor.buienradar_minimum_temperature_3d
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.min3", "%.1f ""\xb0""C", x);'
  - platform: homeassistant
    id: max4
    entity_id: sensor.buienradar_temperature_4d
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.max4", "%.1f ""\xb0""C", x);'
  - platform: homeassistant
    id: min4
    entity_id: sensor.buienradar_minimum_temperature_4d
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.min4", "%.1f ""\xb0""C", x);'
  - platform: homeassistant
    id: max5
    entity_id: sensor.buienradar_temperature_5d
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.max5", "%.1f ""\xb0""C", x);'
  - platform: homeassistant
    id: min5
    entity_id: sensor.buienradar_minimum_temperature_5d
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("weather.min5", "%.1f ""\xb0""C", x);'

        
  # Grab current heatpomp from Home Assistant
  - platform: homeassistant
    id: current_thermostat_temperature
    entity_id: climate.nibe_126820_s1_room
    attribute: current_temperature
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("thermostat.huidig", "%.1f ""\xb0""C", x);'
  - platform: homeassistant
    id: current_thermostat_setpoint
    entity_id: climate.nibe_126820_s1_room
    attribute: temperature
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("thermostat.setpoint", "%.1f ""\xb0""C", x);'   
  - platform: homeassistant
    id: current_hotwater_temperature
    entity_id: water_heater.nibe_hot_water
    attribute: current_temperature
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("thermostat.tapwater", "%.1f ""\xb0""C", x);'

  # Grab current energy from Home Assistant
  - platform: homeassistant
    id: huidig_verbruik_huis
    entity_id: sensor.actueel_huis_energy_consumption
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("energy.hvhuis", "%.0f ""W", x);'
  - platform: homeassistant
    id: totaal_verbruik_huis
    entity_id: sensor.huis_verbruik_vandaag
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("energy.tvhuis", "%.0f ""kWh", x);'   
  - platform: homeassistant
    id: huidig_levering_net
    entity_id: sensor.power_kwh_to_watt
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("energy.hlnet", "%.0f ""W", x);'
  - platform: homeassistant
    id: totaal_levering_net
    entity_id: sensor.daily_power
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("energy.tlnet", "%.1f ""kWh", x);'   
  - platform: homeassistant
    id: huidig_teruglevering_net
    entity_id: sensor.power_consumption_kwh_to_watt
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("energy.htnet", "%.0f ""W", x);'
  - platform: homeassistant
    id: totaal_teruglevering_net
    entity_id: sensor.daily_power_production
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("energy.ttnet", "%.1f ""kWh", x);'           
  - platform: homeassistant
    id: huidig_zonnepanelen
    entity_id: sensor.casa_du_pre_total_output_power
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("energy.hzon", "%.0f ""W", x);'
  - platform: homeassistant
    id: totaal_zonnepanelen
    entity_id: sensor.zonnepanelen_opbrengst_vandaag
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("energy.tvzon", "%.1f ""kWh", x);'           
  - platform: homeassistant
    id: huidig_laadpaal_verbruik
    entity_id: sensor.laadpaal_power_channel_abc
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("energy.hlverbruik", "%.0f ""W", x);'
  - platform: homeassistant
    id: totaal_laadpaal_verbruik
    entity_id: sensor.laadpaal_energy
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("energy.tlverbruik", "%.1f ""kWh", x);'     
        
text_sensor:

  - platform: homeassistant
    id: sun_sun
    entity_id: sun.sun

  # Weather symbol, HA weather entity to pull data from
  - platform: homeassistant
    id: weather_symbol
    entity_id: sensor.openweathermap_condition
    on_value:
      then:
        - lambda: |-
            int symbol=5; // 5 is a empty box.
            if (id(weather_symbol).state == "clear-night") {
              symbol=6;
            } else if (id(weather_symbol).state == "cloudy") {
              symbol=7;
              if (id(sun_sun).state == "below_horizon") {
                symbol=8;
              }
            } else if (id(weather_symbol).state == "fog") {
              symbol=9;
            } else if (id(weather_symbol).state == "hail" || id(weather_symbol).state == "snowy-rainy") {
              symbol=10;
            } else if (id(weather_symbol).state == "lightning") {
              symbol=11;
            } else if (id(weather_symbol).state == "lightning-rainy" || id(weather_symbol).state == "exceptional") {
              symbol=12;
              if (id(sun_sun).state == "below_horizon") {
                symbol=13;
              }
            } else if (id(weather_symbol).state == "partlycloudy") {
              symbol=14;
              if (id(sun_sun).state == "below_horizon") {
                symbol=8;
              }
            } else if (id(weather_symbol).state == "pouring") {
              symbol=15;
            } else if (id(weather_symbol).state == "rainy") {
              symbol=16;
            } else if (id(weather_symbol).state == "snowy") {
              symbol=17;
            } else if (id(weather_symbol).state == "sunny") {
              symbol=18;
              if (id(sun_sun).state == "below_horizon") {
                symbol = 6;
              }
            } else if (id(weather_symbol).state == "windy" || id(weather_symbol).state == "windy-variant") {
              symbol=19;              
            }
            id(disp1).send_command_printf("weather.weather_symbol.pic=%i", symbol);

  - platform: homeassistant
    id: home_status
    entity_id: input_select.thuis_status


switch:
  - platform: gpio
    name: $device_name Relay 1
    id: relay_1
    pin:
      number: 22
  - platform: gpio
    name: $device_name Relay 2
    id: relay_2
    pin:
      number: 19

  # Pin 4 always needs to be on to power up the display
  - platform: gpio
    id: screen_power
    entity_category: config
    pin:
      number: 4
      inverted: true
    restore_mode: ALWAYS_ON

number:
  platform: template
  name: $device_name Brightness
  id: brightness
  entity_category: config
  unit_of_measurement: '%'
  min_value: 0
  max_value: 100
  step: 1
  initial_value: 80
  set_action:
    then:
      - lambda: 'id(disp1).set_backlight_brightness(x/100);'

# Configure the internal bleeper
output:
  - platform: ledc
    id: buzzer_out
    pin:
      number: 21

# Enable ringtone music support
rtttl:
  id: buzzer
  output: buzzer_out

# Configure UART for communicating with the screen
uart:
  id: tf_uart
  tx_pin: 16
  rx_pin: 17
  baud_rate: 115200

# Configure the screen itself
display:
  - platform: nextion
    id: disp1
    uart_id: tf_uart
    tft_url: !secret ns_panel_upload_url_keuken
    on_setup:
      then:
        - number.set:
            id: brightness
            value: 80
        - lambda: |-
            id(disp1).set_component_text_printf("temp", "%.1f ""\xb0""C", id(current_temperature).state);
        - lambda: |-
            id(disp1).set_component_text_printf("humidity", "%.0f ""\x25""%", id(current_humidity).state);
        - lambda: |-
            id(disp1).set_component_text_printf("co2", "%.0f ""ppm", id(current_co2).state);
        - lambda: |-
            id(disp1).set_component_text_printf("weather.otemp", "%.1f ""\xb0""C", id(current_otemp).state);
        - lambda: |-
            id(disp1).set_component_text_printf("weather.ohum", "%.0f ""\x25""%", id(current_ohum).state);
        - lambda: |-
            id(disp1).set_component_text_printf("weather.owind", "%.0f ""km/u", id(current_owind).state);
        - lambda: |-
            id(disp1).set_component_text_printf("weather.obaro", "%.0f ""mbar", id(current_obaro).state);
        - lambda: |-
            id(disp1).set_component_text_printf("energy.hvhuis", "%.0f ""W", id(huidig_verbruik_huis).state);
        - lambda: |-
            id(disp1).set_component_text_printf("energy.tvhuis", "%.0f ""kWh", id(totaal_verbruik_huis).state);
        - lambda: |-
            id(disp1).set_component_text_printf("energy.hlnet", "%.0f ""W", id(huidig_levering_net).state);
        - lambda: |-
            id(disp1).set_component_text_printf("energy.tlnet", "%.1f ""kWh", id(totaal_levering_net).state);
        - lambda: |-
            id(disp1).set_component_text_printf("energy.htnet", "%.0f ""W", id(huidig_teruglevering_net).state);
        - lambda: |-
            id(disp1).set_component_text_printf("energy.ttnet", "%.1f ""kWh", id(totaal_teruglevering_net).state);
        - lambda: |-
            id(disp1).set_component_text_printf("energy.hzon", "%.0f ""W", id(huidig_zonnepanelen).state);
        - lambda: |-
            id(disp1).set_component_text_printf("energy.tvzon", "%.1f ""kWh", id(totaal_zonnepanelen).state);
        - lambda: |-
            id(disp1).set_component_text_printf("energy.hlverbruik", "%.0f ""W", id(huidig_laadpaal_verbruik).state);
        - lambda: |-
            id(disp1).set_component_text_printf("energy.tlverbruik", "%.1f ""kWh", id(totaal_laadpaal_verbruik).state);
  
        - lambda: 'id(disp1).set_component_text_printf("weather.max1", "%.1f ""\xb0""C");' 
        - lambda: 'id(disp1).set_component_text_printf("weather.max2", "%.1f ""\xb0""C");' 
        - lambda: 'id(disp1).set_component_text_printf("weather.max3", "%.1f ""\xb0""C");' 
        - lambda: 'id(disp1).set_component_text_printf("weather.max4", "%.1f ""\xb0""C");' 
        - lambda: 'id(disp1).set_component_text_printf("weather.max5", "%.1f ""\xb0""C");' 
        - lambda: 'id(disp1).set_component_text_printf("weather.min1", "%.1f ""\xb0""C");' 
        - lambda: 'id(disp1).set_component_text_printf("weather.min2", "%.1f ""\xb0""C");' 
        - lambda: 'id(disp1).set_component_text_printf("weather.min3", "%.1f ""\xb0""C");' 
        - lambda: 'id(disp1).set_component_text_printf("weather.min4", "%.1f ""\xb0""C");' 
        - lambda: 'id(disp1).set_component_text_printf("weather.min5", "%.1f ""\xb0""C");' 

        - lambda: 'id(disp1).set_component_text_printf("thermostat.setpoint", "%.1f ""\xb0""C");' 
        - lambda: 'id(disp1).set_component_text_printf("thermostat.huidig", "%.1f ""\xb0""C");'
        - lambda: 'id(disp1).set_component_text_printf("thermostat.tapwater", "%.1f ""\xb0""C");'
        
        - rtttl.play: "twobits:d=4,o=5,b=220:c6,8g,8g,a,g,p,b,c6"
    lambda: |-
      auto time_text = id(sntp_time).now().strftime("%H:%M");
      it.set_component_text("time", time_text.c_str()); 
      

Hi @RienduPre I am not 100% sure but I have help others resolve these types issues in the past. I think it has to do with time. So just maybe this will work… worth a try

ITS SCREEN / DISPLAY update_interval I think the screen is taking longer than the default 5s to display all the information and it is to busy to connect as it is in a loop… so try increasing it to 10s if it works go to 9s and so on until it doesn’t work then you will know your minimum settings. If 10s doesn’t work go to 20s and increase it if necessary. :crossed_fingers:

From this

# Configure the screen itself
display:
  - platform: nextion
    id: disp1
    uart_id: tf_uart
    tft_url: !secret ns_panel_upload_url_keuken
    on_setup:

To This

# Configure the screen itself
display:
  - platform: nextion
    id: disp1
    uart_id: tf_uart
    update_interval: 10s # default is 5s
    tft_url: !secret ns_panel_upload_url_keuken
    on_setup:

Hi @Blacky,

Thank you for your response.
I tried increasing up until 60 seconds, but the result stays the same.

Any others tips?

Thanks,
Rien

Are you on the latest ESPHome? I think this could been a issue in the past that has been fix. If not update ESPHome and update device

Yes I have the latest versions of everything

Not sure if this helps but… in your config you reference a pr in github.

It looks like an nspanel is just a nextion (I use them as display separate). It seems there is a comment from ssieb there. Worth to look into/try that?

@RienduPre I have had a look around for you… again not 100% sure. Disclaimer I don’t have one, just trying to help you.

I am focusing on your screen (display) as you said it work without the screen.

I have looked at your code and I see you are uploading a TFT file… your code looks good to me but under the API not 100% sure

should it be “update_nextion”

Also just checking your file path: http://(homeassistant):8123/www/file.tft as I can’t see it in secrets

    - service: update_nextion
      then:
        - lambda: 'id(disp1)->upload_tft();'

If not

One step would be to comment the TFT out and see if that works. Also look at the warning in the ESPHome link below. Your speed is 15200 so maybe 9600 would work.

hope this gets it :grinning:

Hi,

I found the problem.
It is like described in NSPanel ESP stuck in boot after adding working component

Strange I haven’t found this thread earlier, but it exactly described my issues No solution yet, but the workaround is to limit de referenced devices.
I close this topic for now.

Thanks for all that tried to help me.