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 234 forks source link

`Bug` Compiling Errors: "'N' is an invalid character for names." and more... #2012

Closed nightcat91 closed 2 months ago

nightcat91 commented 2 months ago

TFT Version

unknown

ESPHome Version

2024.3.1

Blueprint Version

none yet

Panel Model

EU

What is the bug?

Following the guide here: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/install.md#setting-up-a-device-on-esphome-dashboard There are multiple small mistakes that I found so far. Some I was able to fix and others not (yet).

First compile problem:

Under 8.) Clear all existing content and paste the following YAML configuration: I think there is an identation mistake in the provided code here:

packages:
remote_package:
   url: https://github.com/Blackymas/NSPanel_HA_Blueprint
.....

Should be:

# Core and optional configurations
packages:
  remote_package:
     url: https://github.com/Blackymas/NSPanel_HA_Blueprint
     ref: main
     files:
        - nspanel_esphome.yaml # Basic package
        # Optional advanced and add-on configurations
        # - 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

If this is not fixed you will get the following error when trying to compile:

INFO ESPHome 2024.3.1
INFO Reading configuration /config/esphome/nspanel.yaml...
Failed config

packages: [source /config/esphome/nspanel.yaml:32]

  expected a dictionary.

Second compile problem

After the first one is fixed the following compile error shows up:

INFO ESPHome 2024.3.1
INFO Reading configuration /config/esphome/nspanel.yaml...
WARNING Found '${wifi_password}' (see substitutions->ota_password) which looks like a substitution, but 'wifi_password' was not declared
WARNING Found '${wifi_ssid}' (see wifi->networks->0->ssid) which looks like a substitution, but 'wifi_ssid' was not declared
WARNING Found '${wifi_password}' (see substitutions->ota_password) which looks like a substitution, but 'wifi_password' was not declared
WARNING Found '${wifi_ssid}' (see wifi->networks->0->ssid) which looks like a substitution, but 'wifi_ssid' was not declared
Failed config

esphome: [source /data/packages/566b10a3/esphome/nspanel_esphome_core.yaml:50]

  'N' is an invalid character for names. Valid characters are: abcdefghijklmnopqrstuvwxyz0123456789-_ (lowercase, no spaces).
  name: NSPanel
  friendly_name: NSPanel
  min_version: 2024.3.0
  platformio_options: 
....

I am not sure if the Warnings are a real problem or not, but I tried to fix the capital N first: Following the guide to use local files here: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/install.md#advanced-esphome-configuration I copied nspanel_esphome.yaml, nspanel_esphome_core.yaml and nspanel_esphome_addon_upload_tft.yaml to my local folders and changed Line 12 in nspanel_esphome_core.yaml from device_name: NSPanel to device_name: nspanel

that clears the error about the capital N

Third compile problem

but this is the new compile log now with new errors:

INFO ESPHome 2024.3.1
INFO Reading configuration /config/esphome/nspanel.yaml...
WARNING Found '${wifi_password}' (see substitutions->ota_password) which looks like a substitution, but 'wifi_password' was not declared
WARNING Found '${wifi_ssid}' (see wifi->networks->0->ssid) which looks like a substitution, but 'wifi_ssid' was not declared
WARNING Found '${wifi_password}' (see substitutions->ota_password) which looks like a substitution, but 'wifi_password' was not declared
WARNING Found '${wifi_ssid}' (see wifi->networks->0->ssid) which looks like a substitution, but 'wifi_ssid' was not declared
INFO Detected timezone 'Europe/Berlin'
Failed config

device_name: [source /config/esphome/nspanel.yaml:3]

  Component not found: device_name.
  nspanel
friendly_name: [source /config/esphome/nspanel.yaml:4]

  Component not found: friendly_name.
  nspanel
wifi_ssid: [source /config/esphome/nspanel.yaml:5]

  Component not found: wifi_ssid.
  !secret wifi_ssid
wifi_password: [source /config/esphome/nspanel.yaml:6]

  Component not found: wifi_password.
  !secret wifi_password
nextion_update_url: [source /config/esphome/nspanel.yaml:7]

  Component not found: nextion_update_url.
  http://homeassistant.local:8123/local/nspanel_eu.tft

Now I am out of ideas, and decided to write this bug report in the hope that it helps.

If I missed any info please let me know and I will gladly update and provide needed details!

Steps to Reproduce

Follow the guide: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/install.md

Your Panel's YAML

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

# Customization area
##### My customization - Start #####
# Enable Home Assistant API
api:
  encryption:
    key: !secret esphome_api_encryption
##### My customization - End #####

packages:
  local_package: !include packages/nspanel_esphome.yaml

# Core and optional configurations
#packages:
#  remote_package:
#     url: https://github.com/Blackymas/NSPanel_HA_Blueprint
#     ref: main
#     files:
#        - nspanel_esphome.yaml # Basic package
#        # Optional advanced and add-on configurations
#        # - 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

No response

Home Assistant Logs

No response

edwardtfn commented 2 months ago

Thanks for highlighting this. I've just fixed the manuals.

In your case, this should work:

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

# Customization area
##### My customization - Start #####
# Enable Home Assistant API
api:
  encryption:
    key: !secret esphome_api_encryption
##### My customization - End #####

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