Blackymas / NSPanel_HA_Blueprint

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

Customization overloads HA and crashes it #1348

Closed eavyon closed 9 months ago

eavyon commented 9 months ago

I have setup a new nspanel with latest update in dev 4.1.2 with this great blueprint. 4.1.1 didnt want to update the TFT, see other issue. Im running ESP-IDF. Trouble started when I added the customization "set display as a light".

The part "id: !extend set_brightness" makes a loop setting the brightness over and over again as can be seen in debug log. Im not able to debug right now but after removing only that part of the code the debug log is quiet again and HA stays up. If someone able to reproduce it because I dont understand why it keeps calling this script and setting brightness as fast as it can.

Log repeats this part: [15:25:11][D][script.set_brightness:1700]: brightness: 69% [15:25:11][D][script.set_brightness(custom):138]: brightness: 69 [15:25:11][D][light:036]: 'nspanel Display' Setting: [15:25:11][D][light:051]: Brightness: 69%

n4rrOx commented 9 months ago

Hello,

I can confirm the same.... with Blueprint 4.1.1 and ESP-arduino.

edwardtfn commented 9 months ago

I will look at that.

Just to confirm, you are talking about this one, right?

edwardtfn commented 9 months ago

I believe that is fixed now. Could you please update your code with the one available now on the Customization docs and try again?

n4rrOx commented 9 months ago

Hello edward,

thanks for your hard work! For me at least the messages with the brightness are gone....

But now I have different messages and I'm not sure if there are related that (every minute):

[20:52:48][W][component:214]: Component adc.sensor took a long time for an operation (0.06 s). [20:52:48][W][component:215]: Components should block for at most 20-30ms.

edwardtfn commented 9 months ago

This is not related to this project. It is something from a change on ESPHome 2023.7. You can get this message independently of the customization.

More details here: https://esphome.io/changelog/2023.7.0.html#a-new-warning-in-the-logs And a huge amount of people reporting the same on the different components: https://github.com/esphome/issues/issues/4717

eavyon commented 9 months ago

After many tries I have to conclude your updated code has fixed this particular problem. Except only after adding your code and compiling again the Nextion screen isnt detected anymore. It stays now forever on boot screen with TFT 4.1.1.

I tried almost everything. Running 4.1.1 and dev 4.1.2. Esp-IDF and arduino framework. Different baudrates. This isnt probably related but it happened directly after only that simple code update. Will look into it tomorrow and open new issue probably. :(

edwardtfn commented 9 months ago

The code on dev is currently broken and I have exactly the same issue you reported. The code currently on dev requires a TFT upload (you shall use the TFT v4.2dev, also on dev). beta and main are working fine with TFT v4.1.x.

edwardtfn commented 9 months ago

It stays now forever on boot screen with TFT 4.1.1.

OK, TFT version is 4.1.1, but what about esphome version shown in that screen?

eavyon commented 9 months ago

That is 4.2dev because I used your pr#5825 earlier. And I did try a TFT upload because the screen got recognised again. But also that and reverting to 4.1.2 did not recover it. 4.1.2 doesnt recognise the screen. Added log with what happened. 231128_nspanel.txt

eavyon commented 9 months ago

I would say close this issue because it seems the current problem is diagnosed here https://github.com/Blackymas/NSPanel_HA_Blueprint/issues/1350 Running beta on arduino now and screen is working again.