Blackymas / NSPanel_HA_Blueprint

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

Home Assistant icon is shown in red #1908

Closed dpetrovichev closed 2 months ago

dpetrovichev commented 3 months ago

TFT Version

4.2.6

ESPHome Version

4.2.6

Blueprint Version

No response

Panel Model

EU

What is the bug?

I tried everything described in https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/error_initializing.md#blueprint-is-not-detected. All commands from the ESPHome interface work fine: reboot, load blank TFT, buttons click, relays switching etc.

Steps to Reproduce

  1. Just follow all the instructions to setup NSPanel and blueprint.
  2. We see Home Assistant icon is shown in red
  3. Let's try everything described in https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/error_initializing.md#blueprint-is-not-detected.
  4. We see Home Assistant icon is shown in red

Your Panel's YAML

substitutions:
  # Settings - Editable values
  device_name: "nspanel-01"
  wifi_ssid: xxxxxx
  wifi_password: xxxxxxx
  nextion_update_url: "http://192.168.3.28:8123/local/nspanel_eu.tft"  # Optional
  # Add-on configuration (if needed)
  # heater_relay: "1"  # Possible values: "1" or "2"

# Customization area
##### My customization - Start #####
##### My customization - End #####

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    files:
      - nspanel_esphome.yaml # Core package
      # Optional advanced and add-on configurations
      # - advanced/esphome/nspanel_esphome_advanced.yaml
      # - nspanel_esphome_addon_climate_cool.yaml
      # - nspanel_esphome_addon_climate_heat.yaml
      # - nspanel_esphome_addon_climate_dual.yaml
    refresh: 300s

ESPHome Logs

nspanel.log3.txt

Home Assistant Logs

No response

edwardtfn commented 3 months ago

Please take a look at this: Panel startup issues - Blueprint is not detected

dpetrovichev commented 3 months ago

Please take a look at this: Panel startup issues - Blueprint is not detected

I have tried everything and in different combinations: remove panel, reboot HA, remove automation and project, update project, clean build and update firmware etc. too many times. The TFT always loads (includes blank TFT), but does not connect to the blueprint.

edwardtfn commented 3 months ago

Ok. Your logs shows you still having ESPHome v4.2.6, but if you flashed it again, would expect v4.3.0. This is the issue to be solved first.


[22:43:42][I][script.watchdog:3219]: Wi-Fi:         Excellent (-47 dBm)
[22:43:42][I][script.watchdog:3238]: API:           Connected
[22:43:42][I][script.watchdog:3256]: Blueprint:
[22:43:42][W][script.watchdog:3261]:   Init steps:  0 (0.0%)
[22:43:42][W][script.watchdog:3262]:   State:       Pending
[22:43:42][I][script.watchdog:3263]: Requesting blueprint settings
[22:43:42][I][script.watchdog:3273]: ESPHome:
[22:43:42][I][script.watchdog:3274]:   Version:     4.2.6
[22:43:42][I][script.watchdog:3285]:   Heap:        148088 bytes (52%)
[22:43:42][I][script.watchdog:3287]:   Framework:   Arduino
[22:43:42][I][script.watchdog:3290]: UART:
[22:43:42][I][script.watchdog:3291]:   Baud rate:   115200 bps
[22:43:42][I][script.watchdog:3292]:   Queue size:  8
[22:43:42][I][script.watchdog:3296]: Nextion:
[22:43:42][I][script.watchdog:3297]:   Queue size:  2
[22:43:42][I][script.watchdog:3299]:   Is setup:    True
[22:43:42][W][script.watchdog:3308]:   Init:        False
[22:43:42][I][script.watchdog:3312]:   TFT:         4.2.6

Could you please try changing from ref: main to ref: beta, clean build files and flash it again and please let me know if the version changes?

edwardtfn commented 3 months ago

By the way, which version of Home Assistant and ESPHome comoiler are you running?

Please make sure you have the required versions as shown here: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/version_compatibility.md

dpetrovichev commented 3 months ago

By the way, which version of Home Assistant and ESPHome comoiler are you running?

Please make sure you have the required versions as shown here: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/version_compatibility.md

Home Assistant Core 2024.3.0 Supervisor 2024.03.0 I'm using the latest build esphome/esphome:latest (created 8 days ago) running under the latest version of docker. "INFO ESPHome 2024.2.2"

edwardtfn commented 3 months ago

That should be fine. Could you please share the logs of ESPHome compiling this?

c4software commented 3 months ago

Same problem here everything up to date, after multiple reboot I managed to make it work until it crash and reboot again.

Since then I'm stuck with. The red home assistant icon.

When it was working everything seems normal, I succesfully configured the utilities dashboard for example.

(I'm still using the Arduino, I don't know if it's important to note.)

c4software commented 3 months ago

My log (in ESPHome) :

[06:49:27][D][sensor:094]: 'nspanel Temperature': Sending state 21.37553 °C with 1 decimals of accuracy
[06:49:30][I][script.watchdog:3103]: Wi-Fi:         Excellent (-47 dBm)
[06:49:30][I][script.watchdog:3123]: API:           Connected
[06:49:30][W][script.watchdog:3143]: Blueprint:     Pending
[06:49:30][I][script.watchdog:3144]: Requesting blueprint settings
[06:49:30][I][script.watchdog:3154]: ESPHome:
[06:49:30][I][script.watchdog:3155]:   Version:     4.2
[06:49:30][I][script.watchdog:3158]:   Framework:   arduino
[06:49:30][I][script.watchdog:3164]: UART:
[06:49:30][I][script.watchdog:3165]:   Baud rate:   115200 bps
[06:49:30][I][script.watchdog:3166]:   Queue size:  8
[06:49:30][I][script.watchdog:3170]: Nextion:
[06:49:30][I][script.watchdog:3171]:   Queue size:  2
[06:49:30][I][script.watchdog:3173]:   Is setup:    True
[06:49:30][I][script.watchdog:3180]:   Init:        True
[06:49:30][I][script.watchdog:3188]:   TFT:         4.3.0
[06:49:30][W][nextion:405]: Nextion reported variable name invalid!
[06:49:30][W][nextion:405]: Nextion reported variable name invalid!
[06:49:39][D][sensor:094]: 'nspanel RSSI': Sending state -46.00000 dBm with 0 decimals of accuracy

Edit : After reflashing this morning, it seems working again. I will see if it crash again and lose the connection.

edwardtfn commented 3 months ago

@c4software, your case looks different, as it looks to be related to the framework issue described on #1821. Could you please share your panel's yaml? Please hide any private info before sharing.

dpetrovichev commented 3 months ago

Ok. Your logs shows you still having ESPHome v4.2.6, but if you flashed it again, would expect v4.3.0. This is the issue to be solved first.


[22:43:42][I][script.watchdog:3219]: Wi-Fi:         Excellent (-47 dBm)
[22:43:42][I][script.watchdog:3238]: API:           Connected
[22:43:42][I][script.watchdog:3256]: Blueprint:
[22:43:42][W][script.watchdog:3261]:   Init steps:  0 (0.0%)
[22:43:42][W][script.watchdog:3262]:   State:       Pending
[22:43:42][I][script.watchdog:3263]: Requesting blueprint settings
[22:43:42][I][script.watchdog:3273]: ESPHome:
[22:43:42][I][script.watchdog:3274]:   Version:     4.2.6
[22:43:42][I][script.watchdog:3285]:   Heap:        148088 bytes (52%)
[22:43:42][I][script.watchdog:3287]:   Framework:   Arduino
[22:43:42][I][script.watchdog:3290]: UART:
[22:43:42][I][script.watchdog:3291]:   Baud rate:   115200 bps
[22:43:42][I][script.watchdog:3292]:   Queue size:  8
[22:43:42][I][script.watchdog:3296]: Nextion:
[22:43:42][I][script.watchdog:3297]:   Queue size:  2
[22:43:42][I][script.watchdog:3299]:   Is setup:    True
[22:43:42][W][script.watchdog:3308]:   Init:        False
[22:43:42][I][script.watchdog:3312]:   TFT:         4.2.6

Could you please try changing from ref: main to ref: beta, clean build files and flash it again and please let me know if the version changes?

I made clean build with 'beta'. Log attached. nspanel.log5.txt

substitutions:
  # Settings - Editable values
  device_name: "nspanel-01"
  wifi_ssid: "xxxxxxx"
  wifi_password: "xxxxxxxx"
  nextion_update_url: "http://192.168.3.28:8123/local/nspanel_eu.tft"  # Optional
  # Add-on configuration (if needed)
  # heater_relay: "1"  # Possible values: "1" or "2"

# Customization area
##### My customization - Start #####
##### My customization - End #####

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: beta
    files:
      - nspanel_esphome.yaml # Core package
      # Optional advanced and add-on configurations
      # - advanced/esphome/nspanel_esphome_advanced.yaml
      # - nspanel_esphome_addon_climate_cool.yaml
      # - nspanel_esphome_addon_climate_heat.yaml
      # - nspanel_esphome_addon_climate_dual.yaml
    refresh: 300s
edwardtfn commented 3 months ago

Could you please go to the device's page (Settings > Devices and Services > ESPHome), select the right display model (EU, US or US Landscape) and the press "Update TFT"?

I woukd appreciate if you could capture log during that process and share it here.

c4software commented 3 months ago

@c4software, your case looks different, as it looks to be related to the framework issue described on #1821. Could you please share your panel's yaml? Please hide any private info before sharing.

I don't think so, because it works several hours before having the issue. But, there is my YAML :

substitutions:
  device_name: "nspanel" 
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password

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

time:
  - id: !extend time_provider
    platform: sntp
    timezone: Europe/Paris
    servers:
      - europe.pool.ntp.org
      - 0.pool.ntp.org

And I made a clean build each time.

c4software commented 3 months ago

I will try enforcing the framework, and see if the problem occurred again :

esp32:
  framework:
    type: arduino
edwardtfn commented 3 months ago

I don't think so, because it works several hours before having the issue. But, there is my YAML :

This could be the case, as OTA works with two different partitions and the boot loader should manage to always boot from the latest, however when you change frameworks via OTA you will have a different framework flashed to each partition, and it could be that the boot loader boots from the older one sometimes, but not every time.

dpetrovichev commented 3 months ago

Could you please go to the device's page (Settings > Devices and Services > ESPHome), select the right display model (EU, US or US Landscape) and the press "Update TFT"?

I woukd appreciate if you could capture log during that process and share it here.

Now it's working (beta clean build). 4.3.0 is everywhere.

Log reordered during updating TFT attached. nspanel.log6.txt

edwardtfn commented 3 months ago

What if you change it back to ref: main?

dpetrovichev commented 3 months ago

What if you change it back to ref: main?

I removed esphome image from docker, pulled it again and did a clean build with "main".

It does not work - red HA sign. And at the start it shows TFT - 4.3.0, ESPHome - 4.2.6 and nothing for Blueprint.

Should I return to beta? What's wrong with main?

edwardtfn commented 3 months ago

Yes, please go back to beta until we find out what is happening when you try main.

edwardtfn commented 3 months ago

Beta and main are identical at this moment.

Dust-E commented 3 months ago

@dpetrovichev Are you running the NSPanel on a different VLAN?

dpetrovichev commented 3 months ago

@dpetrovichev Are you running the NSPanel on a different VLAN?

No, I'm not.

Dust-E commented 3 months ago

I had the same problem and solved it by placing the following config in the ESP Please note that I work with multiple VLANs

wifi:
  manual_ip: 
    static_ip: 192.168.xx.xx
    gateway: 192.168.xx.xx
    subnet: 255.255.255.0
edwardtfn commented 2 months ago

Hey @dpetrovichev,

Coukd you please try ref: main again (now with v4.3.2) and let us know the results?

dpetrovichev commented 2 months ago

Hey @dpetrovichev,

Coukd you please try ref: main again (now with v4.3.2) and let us know the results?

Clean build on the latest esphome image finished with error. build.log.txt docker esphome

Configuration:

substitutions:
  # Settings - Editable values
  device_name: "nspanel-02"
  wifi_ssid: "xxxx"
  wifi_password: "xxxx"
  nextion_update_url: "http://192.168.xx.xx:8123/local/nspanel_eu.tft"  # Optional
  # Add-on configuration (if needed)
  # heater_relay: "1"  # Possible values: "1" or "2"

# Customization area
##### My customization - Start #####
##### My customization - End #####

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    files:
      - nspanel_esphome.yaml # Core package
      # Optional advanced and add-on configurations
      # - advanced/esphome/nspanel_esphome_advanced.yaml
      # - nspanel_esphome_addon_climate_cool.yaml
      # - nspanel_esphome_addon_climate_heat.yaml
      # - nspanel_esphome_addon_climate_dual.yaml
    refresh: 300s
edwardtfn commented 2 months ago

@dpetrovichev, your yaml is not explicitly setting Arduino framework, so it will try to use ESP-IDF, However I can see in your logs that you previously used Arduino. You shoukd either explicity define Arduino or flash using a serial cable. More details about this here.

However, the error you reports is not directly related to this. For some reason (I really d I nt know why) your system is failing to download the latest code and then is using the last one fro cache. At the same time, you are using the latest ESPHome compiler with comes with a breaking change in the IP address call (the one failing in your case). Probably changing the reference will force the system to download the new code, so changing from ref: main to ref: latest or ref: v4.3.2 or even ref: beta will allow you to compile. At this moment, all of those will point to the exactly same code.

dpetrovichev commented 2 months ago

@dpetrovichev, your yaml is not explicitly setting Arduino framework, so it will try to use ESP-IDF, However I can see in your logs that you previously used Arduino. You shoukd either explicity define Arduino or flash using a serial cable. More details about this here.

However, the error you reports is not directly related to this. For some reason (I really d I nt know why) your system is failing to download the latest code and then is using the last one fro cache. At the same time, you are using the latest ESPHome compiler with comes with a breaking change in the IP address call (the one failing in your case). Probably changing the reference will force the system to download the new code, so changing from ref: main to ref: latest or ref: v4.3.2 or even ref: beta will allow you to compile. At this moment, all of those will point to the exactly same code.

I removed all the folders and built "ref: main" from the scratch. After it updated the firmware on the panel I clicked "Update TFT display" and while it was loading the tft file I updated the NSPanel project. And finally, now it works. I see states, chips and buttons.

Now I will reflash the remaining 5 panels. I hope it will works.

Thank you!!!

edwardtfn commented 2 months ago

So, how it was with the other panels?

edwardtfn commented 2 months ago

Hey @dpetrovichev, I'm closing this as I understood you managed to solve it. Please reopen if you still facing this issue.