jdeath/BLE-YC01

config entry issues

Closed this issue · 3 comments

getting this error:

    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

Using BLE proxy on an ESP with the following config:

esphome:
  name: ble-proxy-1
  friendly_name: ble-proxy-1

esp32:
  board: esp32dev
  framework:
    type: esp-idf
    version: recommended

logger:

api:

ota:
  password: !secret ota_password

web_server:
  port: 80

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "ble-proxy-1 Fallback Hotspot"
    password: !secret wifi_fallback_password

captive_portal:

binary_sensor:
  - platform: status
    name: "ESP32 Status"
    
text_sensor:
  - platform: wifi_info
    ip_address:
      name: "ble-proxy-1 IP Address"
    ssid:
      name: "ble-proxy-1 Wi-Fi SSID"
    bssid:
      name: "ble-proxy-1 Wi-Fi BSSID"

  - platform: version
    name: "ESPHome Version"
    hide_timestamp: true

time:
  - platform: sntp
    id: sntp_time
    timezone: !secret ntp_timezone
    servers: !secret ntp_servers

sensor:
  - platform: uptime
    name: "ble-proxy-1 Uptime"

  - platform: wifi_signal
    name: "ble-proxy-1 Wi-Fi Signal"
    update_interval: 60s

switch:
  - platform: restart
    name: "Restart"
    id: switch_restart

# bluetooth proxy
# https://esphome.io/components/bluetooth_proxy.html
esp32_ble_tracker:
  scan_parameters:
    active: true

bluetooth_proxy:
  active: true
jdeath commented

I have not seen that error and not sure what it is (most of the code was copied from others). Your ESPHome setup looks fine. The pool device can only be 3-4 meters from the ESPHome device, but it should not give an error.

Restarted HA, and now got this instead:

Logger: homeassistant.loader
Source: custom_components/ble_yc01/sensor.py:74
Integration: BLE_YC01 ([documentation](https://www.github.com/jdeath/BLE_YC01), [issues](https://github.com/jdeath/BLE_YC01/issues))
First occurred: 20:26:51 (1 occurrences)
Last logged: 20:26:51

Unexpected exception importing platform custom_components.ble_yc01.sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/ble_yc01/sensor.py", line 74, in <module>
    device_class=SensorDeviceClass.PH,
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 783, in __getattr__
    raise AttributeError(name) from None
AttributeError: PH

Upgraded to 2023.8.4 seems to have solved the issue