NSPanel_HA_Blueprint icon indicating copy to clipboard operation
NSPanel_HA_Blueprint copied to clipboard

`Bug` Addging Bluetooth Code to ESP Home is giving errors

Open rudgej opened this issue 5 months ago • 5 comments

TFT Version

No response

Firmware Version

No response

Blueprint Version

No response

Panel Model

None

What is the bug?

I have added the bluetooth code but it gives compiler errors

Steps to Reproduce

Add the bluetooth code to the end of the esp home config

INFO ESPHome 2024.9.0 INFO Reading configuration /config/esphome/musicroom.yaml... ERROR Error while reading config: Invalid YAML syntax:

expected a single document in the stream in "/config/esphome/musicroom.yaml", line 1, column 1 but found another document in "/config/esphome/musicroom.yaml", line 48, column 1

Your Panel's YAML

substitutions:

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

  device_name: "musicroom" 
  wifi_ssid: "Automation"
  wifi_password: "zzzzzz"

  #nextion_update_url: "http://homeassistant.local:8123/local/nspanel_eu.tft"  # Optional for `esp-idf` framework
  # 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

esp32:
  framework:
    type: esp-idf

    # Set Nextion comms baud rate to 921600 bps
uart:
  - id: !extend tf_uart
    baud_rate: 921600

#####################################################################################################
##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint  #####
##### ESPHome Add-on for Bluetooth proxy                                                        #####
##### PLEASE only make changes if it is necessary and also the required knowledge is available. #####
##### For normal use with the Blueprint, no changes are necessary.                              #####
#####################################################################################################
##### ATTENTION: This will add climate elements to the core system and requires the core part.  #####
#####################################################################################################
---

esphome:
  platformio_options:
    build_flags:
      - -D NSPANEL_HA_BLUEPRINT_ADDON_BLUETOOTH_PROXY

bluetooth_proxy:
  id: ble_proxy

packages:
  ble_base_package: !include nspanel_esphome_addon_ble_tracker.yaml

script:
  - id: !extend dump_config
    then:
      - lambda: |-
          // Check if this is installed with Arduino
          #ifdef USE_ARDUINO
            #error "Invalid settings for add-on Bluetooth Proxy. Arduino framework is not supported when using Bluetooth in this project."
          #endif
          if (!id(is_uploading_tft)) {
            static const char *const TAG = "nspanel_ha_blueprint";
            ESP_LOGCONFIG(TAG, "Add-on Bluetooth Proxy:");
            ESP_LOGCONFIG(TAG, "  Mode:        %s", ble_proxy->has_active() ? "Active" : "Passive");
            ESP_LOGCONFIG(TAG, "  Connections: %i", int(ble_proxy->get_bluetooth_connections_limit() -
                                                        ble_proxy->get_bluetooth_connections_free()));
            ESP_LOGCONFIG(TAG, "  Limit:       %i", int(ble_proxy->get_bluetooth_connections_limit()));
          }

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

ESPHome Logs

No response

Home Assistant Logs

No response

rudgej avatar Sep 19 '24 14:09 rudgej