Blackymas / NSPanel_HA_Blueprint

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

`Bug` BLE support with xiaomi_hhccjcy01 #2146

Closed mcrodriguezb closed 4 months ago

mcrodriguezb commented 4 months ago

TFT Version

4.3.8

ESPHome Version

2024.5.5

Blueprint Version

4.3.8

Panel Model

EU

What is the bug?

I have an ESPHome device configure with ble tracker for the xiaomi hhccjcy01 (https://esphome.io/components/sensor/xiaomi_ble.html).

As I have migrated my nspanel from tasmota to NSPanel HA blueprint, I would like to move the ble tracker from the initial ESP32 to the nspanel. I moved my working configuration to the nspanel and I got an error generating the firmware.

Working configuration: yaml file provided below with no sensor configured. Non working configuration: yaml file provided below

Steps to Reproduce

  1. Change the yaml file
  2. Select install -> Wirelessly

Your Panel's YAML

substitutions:
  # Settings - Editable values
  device_name: "nspanel1"
  friendly_name: "nspanel1"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  nextion_update_url: "http://XX.XX.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 #####
api:
  encryption:
    key: !secret apikey_encryption_nspanel1

esp32_ble_tracker:
#  scan_parameters:
#    active: "false"
#    continuous: false
  on_scan_end:
    - then:
        - lambda: |-
             ESP_LOGD("ble_auto", "The scan has ended!");

sensor:
  - platform: xiaomi_hhccjcy01
    mac_address: 'XX:XX:XX:XX:XX:XX'
    temperature:
      name: "Temperature"
    moisture:
      name: "Moisture"
    illuminance:
      name: "Illuminance"
    conductivity:
      name: "Soil Conductivity"
    battery_level:
      name: "Battery Level"

##### 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
      - esphome/nspanel_esphome_addon_ble_tracker.yaml
      # - esphome/nspanel_esphome_addon_bluetooth_proxy.yaml
      # - esphome/nspanel_esphome_addon_climate_cool.yaml
      # - esphome/nspanel_esphome_addon_climate_heat.yaml
      # - esphome/nspanel_esphome_addon_climate_dual.yaml

ESPHome Logs

INFO ESPHome 2024.5.5 INFO Reading configuration /config/nspanel1.yaml... INFO Updating https://github.com/Blackymas/NSPanel_HA_Blueprint@v4.3.8 INFO Detected timezone 'Etc/UTC' INFO Generating C++ source... INFO Compiling app... Processing nspanel1 (board: esp32dev; framework: espidf; platform: platformio/espressif32@5.4.0)

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash

Home Assistant Logs

No response

edwardtfn commented 4 months ago

I could compile your yaml with no issues. Could you please try cleaning your build files and then try to compile again? https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/error_compiling.md#clean-up-build-files

mcrodriguezb commented 4 months ago

Thanks. Cleaning the files solved the issue.

edwardtfn commented 4 months ago

Please let me know how good is this working. I'm also planning to use some of my panels to track devices, but I'm afraid the screen in front of the antenna could affect it's Bluetooth coverage.

mcrodriguezb commented 4 months ago

I will as soon as I flash the device. As moving from tasmota I need to do a serial data, and removing the screen from the wall is quite hard. I wasn't able to do in that device yet. If you have any suggestion for removing it, please feel free to share it.

edwardtfn commented 4 months ago

Well, you don't have to remove the full thing just the front panel, ok?

There is a small dent at the bottom where you should insert a screwdriver and carefully lift off the screen. The entire front panel will come out. Be cautious not to bend the pins on the connector between the two parts.