Blackymas / NSPanel_HA_Blueprint

This allows you to configure your complete NSPanel via Blueprint with UI and without changing anything in the code
1.48k stars 264 forks source link

`Bug` Homage is not loading fully after wakeup / Random restart sometimes #2345

Closed feinadam closed 6 days ago

feinadam commented 1 month ago

TFT Version

4.3.11

Firmware Version

4.3.11

Blueprint Version

4.3.11

Panel Model

EU

What is the bug?

Sometimes the homepage seems not loading fully after wakeup. Entity page icon is missing. 2024-10-23_09h24_19

I have double checked all the entities which is used by the blueprint if they are fully available. Even at none was temporary offline state.

Additionally I have discovered a few times that NSpanel is restarts itself.

Steps to Reproduce

After wakeup the entity icon is missing. If I'm changing something on the blueprint, than is is loading fully again for some time. In case I'm restarting the NsPanel, does not help. In case I'm restarting the homeasisstant server it is again working for some time.

Your Panel's YAML

No response

ESPHome Logs

INFO ESPHome 2024.10.1 INFO Reading configuration /config/esphome/kijelzo.yaml... INFO Updating https://github.com/Blackymas/NSPanel_HA_Blueprint@v4.3.11 INFO Detected timezone 'Europe/Budapest' INFO Starting log output from using esphome API INFO Successfully connected to kijelzo @ in 0.111s INFO Successful handshake with kijelzo @ *** in 0.022s [09:41:43][I][app:100]: ESPHome version 2024.10.1 compiled on Oct 22 2024, 07:12:27 [09:41:43][I][app:102]: Project esphome.NSPanel_HA_Blueprint version 4.3.11

[09:41:43][C][wifi:428]: Local MAC: [09:41:43][C][wifi:433]: SSID: ''[redacted] [09:41:43][C][wifi:436]: IP Address: [09:41:43][C][wifi:440]: BSSID: [redacted]

[09:41:43][C][wifi:443]: Signal strength: -44 dB ▂▄▆█ [09:41:43][C][wifi:447]: Channel: 12 [09:41:43][C][wifi:448]: Subnet: 255.255.255.0 [09:41:43][C][wifi:449]: Gateway: 192.168.1.1 [09:41:43][C][wifi:450]: DNS1: 192.168.1.1 [09:41:43][C][wifi:451]: DNS2: 192.168.1.1

[09:41:43][C][logger:186]: Level: DEBUG [09:41:43][C][logger:188]: Log Baud Rate: 0 [09:41:43][C][logger:189]: Hardware UART: UART0 [09:41:43][C][uart.idf:159]: UART Bus 0: [09:41:43][C][uart.idf:160]: TX Pin: GPIO16 [09:41:43][C][uart.idf:161]: RX Pin: GPIO17 [09:41:43][C][uart.idf:163]: RX Buffer Size: 256 [09:41:43][C][uart.idf:165]: Baud Rate: 115200 baud [09:41:43][C][uart.idf:166]: Data Bits: 8 [09:41:43][C][uart.idf:167]: Parity: NONE [09:41:43][C][uart.idf:168]: Stop bits: 1 [09:41:43][C][ledc.output:180]: LEDC Output: [09:41:43][C][ledc.output:181]: Pin GPIO21 [09:41:43][C][ledc.output:182]: LEDC Channel: 0 [09:41:43][C][ledc.output:183]: PWM Frequency: 1000.0 Hz [09:41:43][C][ledc.output:184]: Phase angle: 0.0° [09:41:43][C][ledc.output:185]: Bit depth: 16 [09:41:43][C][template.binary_sensor:028]: Template Binary Sensor 'Nextion display' [09:41:43][C][template.binary_sensor:028]: Device Class: 'connectivity' [09:41:43][C][template.number:050]: Template Number 'Display Brightness' [09:41:43][C][template.number:050]: Unit of Measurement: '%' [09:41:43][C][template.number:051]: Optimistic: YES [09:41:43][C][template.number:052]: Update Interval: 60.0s [09:41:43][C][template.number:050]: Template Number 'Display Brightness Dimdown' [09:41:43][C][template.number:050]: Unit of Measurement: '%' [09:41:43][C][template.number:051]: Optimistic: YES [09:41:43][C][template.number:052]: Update Interval: 60.0s [09:41:43][C][template.number:050]: Template Number 'Display Brightness Sleep' [09:41:43][C][template.number:050]: Unit of Measurement: '%' [09:41:43][C][template.number:051]: Optimistic: YES [09:41:43][C][template.number:052]: Update Interval: 60.0s [09:41:43][C][template.number:050]: Template Number 'Temperature Correction' [09:41:43][C][template.number:050]: Unit of Measurement: '°C' [09:41:43][C][template.number:051]: Optimistic: YES [09:41:43][C][template.number:052]: Update Interval: 60.0s [09:41:43][C][template.number:050]: Template Number 'Timeout Page'

[09:41:43][C][template.number:050]: Unit of Measurement: 's' [09:41:43][C][template.number:051]: Optimistic: YES [09:41:43][C][template.number:052]: Update Interval: 60.0s [09:41:43][C][template.number:050]: Template Number 'Timeout Dimming'

[09:41:43][C][template.number:050]: Unit of Measurement: 's' [09:41:43][C][template.number:051]: Optimistic: YES [09:41:43][C][template.number:052]: Update Interval: 60.0s [09:41:43][C][template.number:050]: Template Number 'Timeout Sleep'

[09:41:43][C][template.number:050]: Unit of Measurement: 's' [09:41:43][C][template.number:051]: Optimistic: YES [09:41:43][C][template.number:052]: Update Interval: 60.0s [09:41:43][C][template.select:065]: Template Select 'Baud rate'

[09:41:43][C][template.select:066]: Update Interval: 60.0s [09:41:43][C][template.select:069]: Optimistic: YES [09:41:43][C][template.select:070]: Initial Option: 115200 [09:41:43][C][template.select:071]: Restore Value: YES [09:41:43][C][template.select:065]: Template Select 'Wake-up page'

[09:41:43][C][template.select:066]: Update Interval: 60.0s [09:41:43][C][template.select:069]: Optimistic: YES [09:41:43][C][template.select:070]: Initial Option: home [09:41:43][C][template.select:071]: Restore Value: YES [09:41:43][C][template.select:065]: Template Select 'Update TFT display - Model'

[09:41:43][C][template.select:066]: Update Interval: 60.0s [09:41:43][C][template.select:069]: Optimistic: YES [09:41:43][C][template.select:070]: Initial Option: NSPanel EU [09:41:43][C][template.select:071]: Restore Value: YES [09:41:43][C][template.select:065]: Template Select 'Update TFT display - Baud rate'

[09:41:43][C][template.select:066]: Update Interval: 60.0s [09:41:43][C][template.select:069]: Optimistic: YES [09:41:43][C][template.select:070]: Initial Option: 921600 [09:41:43][C][template.select:071]: Restore Value: YES [09:41:43][C][switch.gpio:068]: GPIO Switch 'Nextion display - Power' [09:41:43][C][switch.gpio:091]: Restore Mode: always ON [09:41:43][C][switch.gpio:031]: Pin: GPIO4 [09:41:43][C][template.text_sensor:020]: Template Sensor 'Device Name'

[09:41:43][C][template.text_sensor:020]: Template Sensor 'Detailed Entity'

[09:41:43][C][template.text_sensor:020]: Template Sensor 'Notification Label' [09:41:43][C][template.text_sensor:020]: Template Sensor 'Notification Text' [09:41:43][C][template.text_sensor:020]: Template Sensor 'Version Blueprint'

[09:41:43][C][template.text_sensor:020]: Template Sensor 'Version ESPHome'

[09:41:43][C][template.sensor:022]: Template Sensor 'Blueprint' [09:41:43][C][template.sensor:022]: State Class: '' [09:41:43][C][template.sensor:022]: Unit of Measurement: '%' [09:41:43][C][template.sensor:022]: Accuracy Decimals: 1

[09:41:43][C][template.sensor:023]: Update Interval: 60.0s [09:41:43][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Left Button' [09:41:43][C][gpio.binary_sensor:016]: Pin: GPIO14 [09:41:43][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Right Button' [09:41:43][C][gpio.binary_sensor:016]: Pin: GPIO27 [09:41:43][C][switch.gpio:068]: GPIO Switch 'Relay 1' [09:41:43][C][switch.gpio:091]: Restore Mode: restore defaults to OFF [09:41:43][C][switch.gpio:031]: Pin: GPIO22 [09:41:43][C][switch.gpio:068]: GPIO Switch 'Relay 2' [09:41:43][C][switch.gpio:091]: Restore Mode: restore defaults to OFF [09:41:43][C][switch.gpio:031]: Pin: GPIO19 [09:41:44][C][template.switch:068]: Template Switch 'Notification unread' [09:41:44][C][template.switch:091]: Restore Mode: always OFF [09:41:44][C][template.switch:057]: Optimistic: YES [09:41:44][C][template.switch:068]: Template Switch 'Notification sound' [09:41:44][C][template.switch:091]: Restore Mode: restore defaults to OFF [09:41:44][C][template.switch:057]: Optimistic: YES

[09:41:44][C][psram:021]: Available: YES [09:41:44][C][psram:024]: Size: 2036 KB

[09:41:44][C][nextion:142]: Device Model: NX4832F035_011C [09:41:44][C][nextion:143]: Firmware Version: 72 [09:41:44][C][nextion:144]: Serial Number: *** [09:41:44][C][nextion:145]: Flash Size: 16777216 [09:41:44][C][nextion:147]: Wake On Touch: YES [09:41:44][C][nextion:148]: Exit reparse: YES [09:41:44][C][factory_reset.button:011]: Factory Reset Button 'Factory reset'

[09:41:44][C][restart.button:017]: Restart Button 'Restart'

[09:41:44][C][adc:097]: ADC Sensor 'ntc_source' [09:41:44][C][adc:097]: Device Class: 'voltage' [09:41:44][C][adc:097]: State Class: 'measurement' [09:41:44][C][adc:097]: Unit of Measurement: 'V' [09:41:44][C][adc:097]: Accuracy Decimals: 2 [09:41:44][C][adc:107]: Pin: GPIO38 [09:41:44][C][adc:122]: Attenuation: 12db [09:41:44][C][adc:141]: Samples: 4 [09:41:44][C][adc:142]: Update Interval: 10.0s [09:41:44][C][resistance:010]: Resistance Sensor 'resistance_sensor' [09:41:44][C][resistance:010]: State Class: 'measurement' [09:41:44][C][resistance:010]: Unit of Measurement: 'Ω' [09:41:44][C][resistance:010]: Accuracy Decimals: 1

[09:41:44][C][resistance:011]: Configuration: DOWNSTREAM [09:41:44][C][resistance:012]: Resistor: 11200.00Ω [09:41:44][C][resistance:013]: Reference Voltage: 3.3V [09:41:44][C][ntc:014]: NTC Sensor 'Temperature' [09:41:44][C][ntc:014]: Device Class: 'temperature' [09:41:44][C][ntc:014]: State Class: 'measurement' [09:41:44][C][ntc:014]: Unit of Measurement: '°C' [09:41:44][C][ntc:014]: Accuracy Decimals: 1 [09:41:44][C][homeassistant.time:010]: Home Assistant Time:

[09:41:44][C][mdns:117]: Hostname: kijelzo [09:41:44][C][esphome.ota:073]: Over-The-Air updates: [09:41:44][C][esphome.ota:074]: Address: kijelzo.local:3232 [09:41:44][C][esphome.ota:075]: Version: 2 [09:41:44][C][esphome.ota:078]: Password configured [09:41:44][C][safe_mode:018]: Safe Mode: [09:41:44][C][safe_mode:020]: Boot considered successful after 60 seconds [09:41:44][C][safe_mode:021]: Invoke after 3 boot attempts [09:41:44][C][safe_mode:023]: Remain in safe mode for 180 seconds [09:41:44][C][api:140]: API Server: [09:41:44][C][api:141]: Address: kijelzo.local:6053 [09:41:44][C][api:145]: Using noise encryption: NO [09:41:44][C][wifi_signal.sensor:010]: WiFi Signal 'RSSI' [09:41:44][C][wifi_signal.sensor:010]: Device Class: 'signal_strength' [09:41:44][C][wifi_signal.sensor:010]: State Class: 'measurement' [09:41:44][C][wifi_signal.sensor:010]: Unit of Measurement: 'dBm' [09:41:44][C][wifi_signal.sensor:010]: Accuracy Decimals: 0

[09:41:45][D][sensor:094]: 'ntc_source': Sending state 1.55383 V with 2 decimals of accuracy [09:41:45][D][resistance:039]: 'resistance_sensor' - Resistance 9966.4Ω [09:41:45][D][sensor:094]: 'resistance_sensor': Sending state 9966.36523 Ω with 1 decimals of accuracy [09:41:45][D][ntc:026]: 'Temperature' - Temperature: 25.1°C [09:41:45][D][sensor:094]: 'Temperature': Sending state 25.07584 °C with 1 decimals of accuracy [09:41:45][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0 [09:41:50][I][safe_mode:041]: Boot seems successful; resetting boot loop counter [09:41:50][D][esp32.preferences:114]: Saving 1 preferences to flash... [09:41:50][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed [09:41:53][C][nspanel_ha_blueprint:2224]: Wi-Fi: Excellent (-45 dBm) [09:41:53][C][nspanel_ha_blueprint:2235]: API: Connected

[09:41:53][C][nspanel_ha_blueprint:2245]: Version: 4.3.11 [09:41:53][C][nspanel_ha_blueprint:2246]: Init steps: 62 (100.0%)

[09:41:53][C][nspanel_ha_blueprint:2256]: Version: 4.3.11 [09:41:53][C][nspanel_ha_blueprint:2257]: Compiler: 2024.10.1 [09:41:53][C][nspanel_ha_blueprint:2262]: Framework: ESP-IDF [09:41:53][C][nspanel_ha_blueprint:2267]: Free heap: [09:41:53][C][nspanel_ha_blueprint:2271]: Internal: 203792 bytes (58.0%) [09:41:53][C][nspanel_ha_blueprint:2281]: PSRAM: 2018255 bytes (96.8%)

[09:41:53][C][nspanel_ha_blueprint:2289]: Baud rate: 115200 bps [09:41:53][C][nspanel_ha_blueprint:2290]: Queue size: 0

[09:41:53][C][nspanel_ha_blueprint:2295]: Queue size: 1 [09:41:53][C][nspanel_ha_blueprint:2297]: Is setup: True [09:41:53][C][nspanel_ha_blueprint:2304]: Init: True [09:41:53][C][nspanel_ha_blueprint:2310]: TFT: 4.3.11

[09:41:53][C][nspanel_ha_blueprint:2313]: - Core [09:41:53][C][nspanel_ha_blueprint:2322]: - Upload TFT [09:41:53][C][nspanel_ha_blueprint:097]: Add-on Upload TFT: [09:41:53][C][nspanel_ha_blueprint:098]: File model: NSPanel EU [09:41:53][C][nspanel_ha_blueprint:099]: Valid TFT: YES [09:41:55][D][sensor:094]: 'ntc_source': Sending state 1.55450 V with 2 decimals of accuracy [09:41:55][D][resistance:039]: 'resistance_sensor' - Resistance 9974.4Ω [09:41:55][D][sensor:094]: 'resistance_sensor': Sending state 9974.44824 Ω with 1 decimals of accuracy [09:41:55][D][ntc:026]: 'Temperature' - Temperature: 25.1°C [09:41:55][D][sensor:094]: 'Temperature': Sending state 25.05758 °C with 1 decimals of accuracy

[09:42:03][D][script.timer_dim:3266]: Waking up on page: home [09:42:03][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0

[09:42:04][D][script.timer_dim:3266]: Waking up on page: home [09:42:04][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0 [09:42:05][D][sensor:094]: 'ntc_source': Sending state 1.55483 V with 2 decimals of accuracy [09:42:05][D][resistance:039]: 'resistance_sensor' - Resistance 9978.5Ω [09:42:05][D][sensor:094]: 'resistance_sensor': Sending state 9978.49316 Ω with 1 decimals of accuracy [09:42:05][D][ntc:026]: 'Temperature' - Temperature: 25.0°C [09:42:05][D][sensor:094]: 'Temperature': Sending state 25.04846 °C with 1 decimals of accuracy [09:42:15][D][sensor:094]: 'ntc_source': Sending state 1.55467 V with 2 decimals of accuracy [09:42:15][D][resistance:039]: 'resistance_sensor' - Resistance 9976.5Ω [09:42:15][D][sensor:094]: 'resistance_sensor': Sending state 9976.47070 Ω with 1 decimals of accuracy [09:42:15][D][ntc:026]: 'Temperature' - Temperature: 25.1°C [09:42:15][D][sensor:094]: 'Temperature': Sending state 25.05302 °C with 1 decimals of accuracy

[09:42:20][D][script.timer_dim:3266]: Waking up on page: home [09:42:20][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0

[09:42:21][D][script.timer_dim:3266]: Waking up on page: home [09:42:21][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0

[09:42:22][D][script.timer_dim:3266]: Waking up on page: home [09:42:22][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0

[09:42:24][D][script.timer_dim:3266]: Waking up on page: home [09:42:24][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0 [09:42:25][D][sensor:094]: 'ntc_source': Sending state 1.55450 V with 2 decimals of accuracy [09:42:25][D][resistance:039]: 'resistance_sensor' - Resistance 9974.4Ω [09:42:25][D][sensor:094]: 'resistance_sensor': Sending state 9974.44824 Ω with 1 decimals of accuracy [09:42:25][D][ntc:026]: 'Temperature' - Temperature: 25.1°C [09:42:25][D][sensor:094]: 'Temperature': Sending state 25.05758 °C with 1 decimals of accuracy

[09:42:25][D][script.timer_dim:3266]: Waking up on page: home [09:42:25][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0

[09:42:28][D][script.timer_dim:3266]: Waking up on page: home [09:42:28][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0

[09:42:30][D][script.timer_dim:3266]: Waking up on page: home [09:42:30][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0

[09:42:31][D][script.timer_dim:3266]: Waking up on page: home [09:42:31][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0

Home Assistant Logs

No response

edwardtfn commented 1 month ago

I'm investigating this, but couldn't get that far... 😞

This sensor on your pictures is related to the entities pages. The information about this sensor visibility is sent to the panel on each boot (or automation reloaded) and after that it should never change. Then every time the home page is rendered, it checks for that flag and shows or hide that icon based on that flag set on boot. The flag set on boot is not related to the entities being available or not, but if any entity is assigned to a page, that page will be shown and it will be flagged to show that icon.

Additionally I have discovered a few times that NSpanel is restarts itself.

This could explain why it happens sometimes, but then we should investigate why your panel is restarting (very difficult if you don´t know already) and why this flag is not set properly on some boots.

For this last question, the error messages on your logs could give a clue:

[09:42:31][E][nextion:576]: ERROR: Received numeric return but next in queue "backlight_brightness" is not a valid sensor type 0

This is indicating ESPHome was expecting a response for the command to set brightness (which should be just an acknowledgment), but it's getting a number/value. Usually this happens when the display (Nextion) gets a buffer overflow (which happens when there are more things in the communication buffer than it can handle at that moment, as it is doing something else) and then all the queue is deleted, but ESPHome don't know exactly what was deleted and still waiting for a response from other commands it sent previously. This is also quite hard to troubleshoot, but I probably can have some delays during the boot (when lots of info is sent to the panel and it's still processing all that thing). I will take a look on what could be changed on this, but would appreciate if you can find some more clue from your side that could help understanding why your panel is restarting... like if it is HA being out, or poor WiFi, or some specific area you navigate in your panel, etc... Also, could you please let us know which add-ons are you using (or perhaps share your panel's yaml hiding any sensitive info)?

feinadam commented 1 month ago

Hi edwardtfn, thank you for your answer!

Here is my esphome config:

substitutions:

###### CHANGE ME START ######

  device_name: "kijelzo" 
  wifi_ssid: !secret wifi_ssidGarden
  wifi_password: !secret wifi_passwordGarden

  nextion_update_url: "http://myipaddress/local/nspanel_eu.tft" # URL to local tft File
  #nextion_update_url: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/nspanel_eu.tft" # URL to Github
esp32:
  framework:
    type: esp-idf
##### CHANGE ME END #####

# Set Wi-Fi power save mode to "LIGHT" as required for Bluetooth on ESP32
wifi:
  power_save_mode: LIGHT

##### DO NOT CHANGE ANYTHING! #####

packages:
  ##### download esphome code from Github
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    files: [nspanel_esphome.yaml]
    refresh: 300s

##### DO NOT CHANGE ANYTHING! #####
feinadam commented 1 month ago

The Wifi is strong, the panel is 2m far from the AP. I have no clue what could be the problem.

In the past there was some similar issue due to the climate page, but i have reported is and you already corrected it. I have tried to remove the climate now, but the issue came also in this case. I checked all the entities availability. I have not added new entity several month ago.

I'm using several addons, (see picture) 2024-10-24_14h46_26

The last installed addon was Frigate, but no entity is displayed on the panel from Frigate.

What makes testing even more difficult is that I can't reproduce the error, it just happens by chance.

feinadam commented 1 month ago

Now I have catched the following: Display was in sleep mode. I stepped front of it. Motion sensor detected motion, and sent wakeup. Display starts rebooting. After the reboot it looks as above or even worse, because also the value from the top right corner is missing. 2024-10-24_19h06_16

Here is the automation how the wake-up is working:

alias: Kijelző ébresztése mozgásérzékelésre
description: ""
mode: single
triggers:
  - entity_id:
      - binary_sensor.zone_nappali_open
    for:
      hours: 0
      minutes: 0
      seconds: 0
    trigger: state
conditions: []
actions:
  - data:
      reset_timer: false
    action: esphome.kijelzo_wake_up
edwardtfn commented 1 month ago

Nice! I will try to duplicate this here. Thanks a lot!

feinadam commented 4 weeks ago

One further observation: Once the issue occurs, it can gone only in the 2 use cases:

A simple NSpanel restart or even a build/update process does not fix the issue.

edwardtfn commented 4 weeks ago

Do you have any error under HA logs (Settings > System > Logs) which could be related to the automation using the Blueprint?

feinadam commented 4 weeks ago
Log: aioesphomeapi.connection
Source: runner.py:189
First Occurred: 08:20:06 (20 Events)
Last logged: 14:52:50

kijelzo@ 192.168.1.185: Connection error occurred: [Errno 104] Connection reset by peer

This is another epshome device where the signal wifi signal is poor.
vilagitas-4ch-relayboard @ 192.168.1.121: Connection error occurred: Ping response not received after 90.0 seconds
vilagitas-4ch-relayboard @ 192.168.1.121: Connection error occurred: vilagitas-4ch-relayboard @ 192.168.1.121: Connection lost
vilagitas-4ch-relayboard @ 192.168.1.121: Connection error occurred: vilagitas-4ch-relayboard @ 192.168.1.121: EOF received
feinadam commented 3 weeks ago

Hello!

After many unseccessful attempt i can see the light at the end of the tunnel. I am over many reflashing and software restart of the nspanel but i missed the most simple thing, the hardware restart. This morning i have cut off the power supply of the panel, since that time the issue seams disappeared. It seems the hardware restart is not equal with the restart which can be triggered from esphome gui.

feinadam commented 3 weeks ago

The the joy was early. Although thanks to the panel restart, it works fine for a longer period (12-16 hours), then everything starts over. I'm out of ideas.

feinadam commented 1 week ago

What is the differences in case of soft reset and hw reset? I noticed that the issue coming after the random reset. I'm trying to restart from the display or from HA the issue is still there. When I'm making a power cut than it is good again for a while.

2 additional notice: When the issue is there means the icons are missing, in case I'm touching its location (eg. entity page button) it opens the entity page. When I'm reloading the template in HA than it fixes again the issue for a while.

My feeling is that the root couse is related to the random restarts. Any hints what could I debug?

edwardtfn commented 1 week ago

What is the differences in case of soft reset and hw reset?

Well, I'm not sure if I can answer that question, but certainly there are differences. Even the timing of the different systems. The ESP32 takes longer to start when power cycled and the same happens, or even worse, to the Nextion display used in the NSPanel. A big part of the boot process is about syncing the Blueprint, ESP32 (ESPHome) and the Nextion display, so if one takes longer than other in specific situations, it can happen that things will run in a different order and this could be driving to the issue you are facing.

We force a soft reset to Nextion when it connects to ESPHome, so this should minimize the difference between the way it resets, but still some difference could happen.

https://github.com/esphome/esphome/blob/e819185de18f2f1d4f9b3e2c96190d1cefe53422/esphome/components/nextion/nextion.cpp#L24

Which version are you currently trying? I've done quite a lot of improvements on this boot sequence on v4.4.0 (which still in DEV and quite buggy) and hopefully this will be solved soon.

My feeling is that the root couse is related to the random restarts. Any hints what could I debug?

Yeah, we should be focusing on finding what is causing those restarts and try to fix that, but it's hard to troubleshoot with the info provided by the limited memory of an ESP32, so we have to rely more on your feelings on what you could be doing when it restarts (if it restarts while you are playing with it) or if something else happens in your network or Home Assistant that could be related to that. It's not an easy task. 😞

edwardtfn commented 1 week ago

I just got this issue with my panel not showing those icons... I still have some work to do. 😩

feinadam commented 1 week ago

There are a few logs what I would share. I assume it is due to the restart.

Napló: aioesphomeapi.connection Forrás: runner.py:189 Először fordult elő: 11:36:39 (4 Események) Utoljára naplózva: 15:01:44

kijelzo @ 192.168.1.185: Connection error occurred: [Errno 104] Connection reset by peer

Napló: homeassistant.helpers.template Forrás: helpers/template.py:2748 Először fordult elő: 02:56:06 (5 Események) Utoljára naplózva: 15:01:49

Template variable warning: list object has no element 1 when rendering '{{ timezone.split('(')[1]|replace(')', '') if timezone.split('(') | count > 0 else timezone }}'

feinadam commented 1 week ago

There is the following automomatism which I'm using to wakeup the display: (When binary sensor is switch to open state (due to motion detection of PIR) than it calls every time the wakeup action.) This binary sensor changes it's state quite often when there is a person in the room.

alias: Kijelző ébresztése mozgásérzékelésre description: "" triggers:

edwardtfn commented 1 week ago

Template variable warning: list object has no element 1 when rendering '{{ timezone.split('(')[1]|replace(')', '') if timezone.split('(') | count > 0 else timezone }}'

This issue was introduced with v4.3.12. Which time zone is selected in your blueprint settings?

feinadam commented 1 week ago

There was no time zone selected in the blueprint. Now I selected the Budapest one.

edwardtfn commented 1 week ago

Can you still see that error message?

feinadam commented 1 week ago

No, it seems disappeared.

feinadam commented 1 week ago

The issue is still there, but I have discovered some difference. Since I have set the timezone, when I'm triggering a restart from the display, the issue disappears for a while. Before this kind of restart never solved the issue. (Only hw reset, Blueprint reload or HA restart was working).

edwardtfn commented 6 days ago

I believe this is now solved in dev.

feinadam commented 6 days ago

Something went wrong. I have changed to dev:

remote_package: url: https://github.com/Blackymas/NSPanel_HA_Blueprint ref: dev files: [nspanel_esphome.yaml] refresh: 300s

I have already updated blueprint and tft. Did I missed something?

20241119_204639

De[20:45:53][C][nspanel_ha_blueprint:101]: Valid TFT: NO [20:45:53][W][component:237]: Component script took a long time for an operation (124 ms). [20:45:53][W][component:238]: Components should block for at most 30 ms. [20:45:53][W][nextion:091]: Nextion is not connected! [20:45:54][W][nextion:091]: Nextion is not connected! [20:45:54][W][nextion:091]: Nextion is not connected! [20:45:55][W][nextion:091]: Nextion is not connected! [20:45:55][W][nextion:091]: Nextion is not connected! [20:45:56][W][nextion:091]: Nextion is not connected! [20:45:56][W][nextion:091]: Nextion is not connected! [20:45:57][W][nextion:091]: Nextion is not connected! [20:45:57][W][nextion:091]: Nextion is not connected! [20:45:58][W][nextion:091]: Nextion is not connected! [20:45:58][W][nextion:091]: Nextion is not connected! [20:45:59][W][nextion:091]: Nextion is not connected! [20:45:59][W][component:237]: Component display took a long time for an operation (316 ms). [20:45:59][W][component:238]: Components should block for at most 30 ms. [20:46:00][W][nextion:091]: Nextion is not connected! [20:46:00][W][nextion:091]: Nextion is not connected! [20:46:01][W][nextion:091]: Nextion is not connected! [20:46:01][W][nextion:091]: Nextion is not connected! [20:46:02][W][nextion:091]: Nextion is not connected! [20:46:02][W][nextion:091]: Nextion is not connected!

feinadam commented 6 days ago

OK! I have uploaded blank.tft and after reflashing it seems better.

edwardtfn commented 6 days ago

It was probably related to baud rate as dev6 adds full support to 921600bps and somewhere you got a mismatch between the rate set in your ESPHome and Nextion. I will take a look if this can be more intuitive for users migrating...

feinadam commented 4 days ago

The fix seems working, however now the hw button text is missing. Sometimes it is there but more often not, the reset does not fixes it.

I have also experienced much slower load of the button pages elements than previously.

20241120_202820 20241120_071033

edwardtfn commented 4 days ago

I have also experienced much slower load of the button pages elements than previously.

Under your device's page (Settings > Devices & Services > ESPHome) there is an adjustment for "Display queue delay factor" (it may be hidden).

  1. Which value is set there?
  2. Could you please set it to 0 and try again?
feinadam commented 4 days ago

I have also experienced much slower load of the button pages elements than previously.

Under your device's page (Settings > Devices & Services > ESPHome) there is an adjustment for "Display queue delay factor" (it may be hidden).

  1. Which value is set there?
  2. Could you please set it to 0 and try again?

It was set to 8. Now I set it to 0. It seems OK now. Thank you!

edwardtfn commented 4 days ago

It should be set to l0 when you first installed, and it will increase by 1 when a buffer overflow happens, so it is also a counter of buffer overflows. I would appreciate if you can let me know if it's value keeps increasing as you play with your panel.

feinadam commented 4 days ago

It should be set to l0 when you first installed, and it will increase by 1 when a buffer overflow happens, so it is also a counter of buffer overflows. I would appreciate if you can let me know if it's value keeps increasing as you play with your panel.

Yes, it is increasing. It is 7 now.

edwardtfn commented 4 days ago

Ok, I will have to investigate this...

Is there a specific page or specific action where you see this happening? When a buffer overflow happens you should see an error in the logs and this number will increase, slowing down the system.