Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Supported Devices Found - Ecoworthy 12V 150AH (metal case version) #169

Closed
3 tasks done
Scope666 opened this issue Feb 3, 2025 · 9 comments · Fixed by #180
Closed
3 tasks done

No Supported Devices Found - Ecoworthy 12V 150AH (metal case version) #169

Scope666 opened this issue Feb 3, 2025 · 9 comments · Fixed by #180
Assignees
Labels
question Further information is requested

Comments

@Scope666
Copy link

Scope666 commented Feb 3, 2025

Checklist

  • I need support with using the integration.
  • My issue is not a feature request
  • I'm not avoiding to fill out the bug report form.

Describe the issue

Hi, I just setup a bluetooth proxy. It appears to be proxying requests, and I temp installed the Bermuda BLE integration to verify I can "see" the BMS chip. My HA setup is HA Core running in Docker on an Unraid server. I've tried some of the bluetoothctl commands I've seen you list from inside the docker container, but they seem to hang, not sure if they work with a setup like mine. (docker + proxy). When I tried to add the BMS I get the "No supported devices found via bluetooth" message, and because of that the integration won't appear in HA, so can't see the normal page where your diagnostics button would be.

HA Core version: 2025.1.4
ESPHome version: 2024.11.3

Here's some extra info:

ESPHome Diagnostics snippet:
NOTE: The device name matches what you have listed as compatible: ECO-WORTHY batteries (show up as DP..S…) ... also the UUID matches what you have in your detection code.

     "bluetooth": {
      "connections_free": 3,
      "connections_limit": 3,
      "available": true,
      "scanner": {
        "name": "btproxy1-815518 (3C:8A:1F:81:55:18)",
        "start_time": 1605937.150296092,
        "source": "3C:8A:1F:81:55:18",
        "scanning": true,
        "type": "ESPHomeScanner",
        "last_detection": 1606791.058140123,
        "monotonic_time": 1606791.086141202,
        "discovered_devices_and_advertisement_data": [
          {
-------SNIP---------           
            "name": "DP04S007L4S120A",
            "address": "A5:C2:37:2E:A5:C3",
            "rssi": -49,
            "advertisement_data": [
              "DP04S007L4S120A",
              {
                "42435": {
                  "__type": "<class 'bytes'>",
                  "repr": "b'.7\\xc2\\xa5'"
                }
              },
              {},
              [
                "0000ff00-0000-1000-8000-00805f9b34fb"
              ],
              -127,
              -49,
              []
            ],
            "details": {
              "source": "3C:8A:1F:81:55:18",
              "address_type": 0
            }
          },

HA Log:

2025-02-02 21:23:04.696 INFO (MainThread) [aioesphomeapi.reconnect_logic] Successfully connected to esp32-bluetooth-proxy-815518 @ 192.168.10.98 in 1.019s
2025-02-02 21:23:04.719 INFO (MainThread) [aioesphomeapi.reconnect_logic] Successful handshake with btproxy1-815518 @ 192.168.10.98 in 0.023s

YAML for BT Proxy just in case:

esphome:

  name: btproxy1-815518
  friendly_name: Bluetooth Proxy 1
  min_version: 2024.6.0
  name_add_mac_suffix: true

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

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

api:
logger:

ota:
  - platform: esphome
    id: ota_esphome

esp32_ble_tracker:
  scan_parameters:
    # We currently use the defaults to ensure Bluetooth
    # can co-exist with WiFi In the future we may be able to
    # enable the built-in coexistence logic in ESP-IDF
    active: true

bluetooth_proxy:
  active: true

button:
  - platform: safe_mode
    id: button_safe_mode
    name: Safe Mode Boot

  - platform: factory_reset
    id: factory_reset_btn
    name: Factory reset
    

Image

Image Image
@Scope666 Scope666 added the question Further information is requested label Feb 3, 2025
@Scope666
Copy link
Author

Scope666 commented Feb 3, 2025

Not sure how I managed to do this (I don't code), but digging around in other issues, I saw there's an alternative branch for an ECO-WORTHY 100 AH with an open issue. I changed the 5 digit vendor ID to match what I see in the ESPHome Diagnostics and now I seem to be getting info from it:

Image

@Scope666
Copy link
Author

Scope666 commented Feb 3, 2025

manifest.json edit: (edits made to 164-add-12v-100a-ecoworthy-battery branch which I pulled down as a zip and installed manually)

Image

jbd_bms.py edit:

Image

@patman15
Copy link
Owner

patman15 commented Feb 3, 2025

Hi! Thanks for the info. I start suspecting that ECO-WORTHY uses the MAC address for the vendor id, which is really stu...
Need to check and adapt the detection. If you could provide a debug log that would be great. I would need one including a restart of the integration.

@Scope666
Copy link
Author

Scope666 commented Feb 3, 2025

Let me know if this works for you, if not, happy to dig out anything you need.

I think you're right, what are the chances that my MAC ends in A5:C3 and I had to change the manufacturer_id to A5C3 to get the integration to load. (and converted to decimal and put it in manifest.json also)

2025-02-03 08:00:06.097 DEBUG (MainThread) [custom_components.bms_ble] Unloaded config entry: A5:C2:37:2E:A5:C3, ok? True!
2025-02-03 08:00:06.097 DEBUG (MainThread) [custom_components.bms_ble] Shutting down BMS device (DP04S007L4S120A)
2025-02-03 08:00:06.097 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: disconnecting BMS
2025-02-03 08:00:06.177 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: disconnected from BMS
2025-02-03 08:00:06.178 DEBUG (MainThread) [custom_components.bms_ble] Setup of <ConfigEntry entry_id=01JK5182RMV8RH4MTSNC8YXMBT version=1 domain=bms_ble title=DP04S007L4S120A state=ConfigEntryState.SETUP_IN_PROGRESS unique_id=A5:C2:37:2E:A5:C3>
2025-02-03 08:00:06.178 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: initializing Jiabaida Smart BMS, BT address: A5:C2:37:2E:A5:C3
2025-02-03 08:00:06.178 DEBUG (MainThread) [custom_components.bms_ble] Initializing coordinator for DP04S007L4S120A (A5:C2:37:2E:A5:C3) as Jiabaida Smart BMS
2025-02-03 08:00:06.178 DEBUG (MainThread) [custom_components.bms_ble] DP04S007L4S120A: advertisement: {'name': 'DP04S007L4S120A', 'address': 'A5:C2:37:2E:A5:C3', 'rssi': -49, 'manufacturer_data': {42435: b'.7\xc2\xa5'}, 'service_data': {}, 'service_uuids': ['0000ff00-0000-1000-8000-00805f9b34fb'], 'source': '3C:8A:1F:81:55:18', 'advertisement': AdvertisementData(local_name='DP04S007L4S120A', manufacturer_data={42435: b'.7\xc2\xa5'}, service_uuids=['0000ff00-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-49), 'device': BLEDevice(A5:C2:37:2E:A5:C3, DP04S007L4S120A), 'connectable': True, 'time': 1644011.069238759, 'tx_power': None}
2025-02-03 08:00:06.178 DEBUG (MainThread) [custom_components.bms_ble] DP04S007L4S120A: BMS data update
2025-02-03 08:00:06.178 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: connecting BMS
2025-02-03 08:00:06.178 DEBUG (MainThread) [bleak_retry_connector] A5:C2:37:2E:A5:C3 - A5:C2:37:2E:A5:C3: Connection attempt: 1
2025-02-03 08:00:08.324 DEBUG (MainThread) [bleak_retry_connector] A5:C2:37:2E:A5:C3 - A5:C2:37:2E:A5:C3: Connected after 1 attempts
2025-02-03 08:00:08.342 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: TX BLE data: dd a5 03 00 ff fd 77
2025-02-03 08:00:08.529 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (start): bytearray(b'\xdd\x03\x00"\x054\x00\x0034@t\x00\x001\x1a\x00\x00\x00\x00')
2025-02-03 08:00:08.530 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (cnt.): bytearray(b'\x00\x00fO\x03\x04\x01\x0b<\x00\x00\x00@t34\x00\x00\xfc ')
2025-02-03 08:00:08.531 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (cnt.): bytearray(b'w')
2025-02-03 08:00:08.532 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: TX BLE data: dd a5 04 00 ff fc 77
2025-02-03 08:00:08.659 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (start): bytearray(b'\xdd\x04\x00\x08\r\x03\r\x04\r\x03\r\x03\xff\xb7w')
2025-02-03 08:00:08.659 DEBUG (MainThread) [custom_components.bms_ble] DP04S007L4S120A: BMS data sample {'temp_sensors': 1, 'voltage': 13.32, 'current': 0.0, 'battery_level': 79, 'cycle_charge': 131.08, 'cycles': 0, 'temp#0': 14.5, 'cell#0': 3.331, 'cell#1': 3.332, 'cell#2': 3.331, 'cell#3': 3.331, 'delta_voltage': 0.001, 'cycle_capacity': 1745.986, 'power': 0.0, 'battery_charging': False, 'temperature': 14.5}
2025-02-03 08:00:08.659 DEBUG (MainThread) [custom_components.bms_ble] Finished fetching DP04S007L4S120A data in 2.481 seconds (success: True)
2025-02-03 08:00:08.659 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up bms_ble.binary_sensor
2025-02-03 08:00:08.660 INFO (MainThread) [homeassistant.components.sensor] Setting up bms_ble.sensor
2025-02-03 08:00:38.988 DEBUG (MainThread) [custom_components.bms_ble] DP04S007L4S120A: BMS data update
2025-02-03 08:00:38.988 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: BMS already connected
2025-02-03 08:00:38.988 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: TX BLE data: dd a5 03 00 ff fd 77
2025-02-03 08:00:39.140 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (start): bytearray(b'\xdd\x03\x00"\x054\x00\x0034@t\x00\x001\x1a\x00\x00\x00\x00')
2025-02-03 08:00:39.143 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (cnt.): bytearray(b'\x00\x00fO\x03\x04\x01\x0b<\x00\x00\x00@t34\x00\x00\xfc ')
2025-02-03 08:00:39.147 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (cnt.): bytearray(b'w')
2025-02-03 08:00:39.147 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: TX BLE data: dd a5 04 00 ff fc 77
2025-02-03 08:00:39.241 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (start): bytearray(b'\xdd\x04\x00\x08\r\x04\r\x05\r\x03\r\x04\xff\xb4w')
2025-02-03 08:00:39.241 DEBUG (MainThread) [custom_components.bms_ble] DP04S007L4S120A: BMS data sample {'temp_sensors': 1, 'voltage': 13.32, 'current': 0.0, 'battery_level': 79, 'cycle_charge': 131.08, 'cycles': 0, 'temp#0': 14.5, 'cell#0': 3.332, 'cell#1': 3.333, 'cell#2': 3.331, 'cell#3': 3.332, 'delta_voltage': 0.002, 'cycle_capacity': 1745.986, 'power': 0.0, 'battery_charging': False, 'temperature': 14.5}
2025-02-03 08:00:39.241 DEBUG (MainThread) [custom_components.bms_ble] Finished fetching DP04S007L4S120A data in 0.253 seconds (success: True)
2025-02-03 08:01:08.989 DEBUG (MainThread) [custom_components.bms_ble] DP04S007L4S120A: BMS data update
2025-02-03 08:01:08.989 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: BMS already connected
2025-02-03 08:01:08.989 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: TX BLE data: dd a5 03 00 ff fd 77
2025-02-03 08:01:09.154 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (start): bytearray(b'\xdd\x03\x00"\x054\x00\x0034@t\x00\x001\x1a\x00\x00\x00\x00')
2025-02-03 08:01:09.162 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (cnt.): bytearray(b'\x00\x00fO\x03\x04\x01\x0b<\x00\x00\x00@t34\x00\x00\xfc ')
2025-02-03 08:01:09.186 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (cnt.): bytearray(b'w')
2025-02-03 08:01:09.187 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: TX BLE data: dd a5 04 00 ff fc 77
2025-02-03 08:01:09.251 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (start): bytearray(b'\xdd\x04\x00\x08\r\x04\r\x05\r\x03\r\x03\xff\xb5w')
2025-02-03 08:01:09.251 DEBUG (MainThread) [custom_components.bms_ble] DP04S007L4S120A: BMS data sample {'temp_sensors': 1, 'voltage': 13.32, 'current': 0.0, 'battery_level': 79, 'cycle_charge': 131.08, 'cycles': 0, 'temp#0': 14.5, 'cell#0': 3.332, 'cell#1': 3.333, 'cell#2': 3.331, 'cell#3': 3.331, 'delta_voltage': 0.002, 'cycle_capacity': 1745.986, 'power': 0.0, 'battery_charging': False, 'temperature': 14.5}
2025-02-03 08:01:09.251 DEBUG (MainThread) [custom_components.bms_ble] Finished fetching DP04S007L4S120A data in 0.263 seconds (success: True)

While charging:

2025-02-03 08:35:41.212 DEBUG (MainThread) [custom_components.bms_ble] DP04S007L4S120A: BMS data sample {'temp_sensors': 1, 'voltage': 13.41, 'current': 4.89, 'battery_level': 79, 'cycle_charge': 131.15, 'cycles': 0, 'temp#0': 14.6, 'cell#0': 3.353, 'cell#1': 3.355, 'cell#2': 3.355, 'cell#3': 3.352, 'delta_voltage': 0.003, 'cycle_capacity': 1758.722, 'power': 65.575, 'battery_charging': True, 'temperature': 14.6}

@patman15
Copy link
Owner

patman15 commented Feb 3, 2025

Checked the rest of the manufacturer_data and they are the remaining bytes of the MAC. 😔 So I'll need to remove it from the detection filter and rely on the name and the service_id.

@Scope666
Copy link
Author

Scope666 commented Feb 3, 2025

I think somebody needs to show the BMS manufacturer this, it's the beginning part that they should be using, certainly not the end, that's unique per device.

Image

@patman15
Copy link
Owner

patman15 commented Feb 3, 2025

Or, even better, they could read chapter 1.4 of https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/CSS_v11/out/en/supplement-to-the-bluetooth-core-specification/data-types-specification.html 😉

@patman15 patman15 self-assigned this Feb 8, 2025
@patman15
Copy link
Owner

patman15 commented Feb 8, 2025

@Scope666 could you please try the linked branch via manual install and report back? Best case with a debug log? Thanks!

@Scope666
Copy link
Author

Scope666 commented Feb 8, 2025

@Scope666 could you please try the linked branch via manual install and report back? Best case with a debug log? Thanks!

Here you go, I replaced my hacked code with your linked branch, all seems good with detection, here's the debug of a reload:

2025-02-08 07:56:36.781 DEBUG (MainThread) [custom_components.bms_ble] Unloaded config entry: A5:C2:37:2E:A5:C3, ok? True!
2025-02-08 07:56:36.781 DEBUG (MainThread) [custom_components.bms_ble] Shutting down BMS device (DP04S007L4S120A)
2025-02-08 07:56:36.781 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: disconnecting BMS
2025-02-08 07:56:36.933 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: disconnected from BMS
2025-02-08 07:56:36.933 DEBUG (MainThread) [custom_components.bms_ble] Setup of <ConfigEntry entry_id=01JK5182RMV8RH4MTSNC8YXMBT version=1 domain=bms_ble title=DP04S007L4S120A state=ConfigEntryState.SETUP_IN_PROGRESS unique_id=A5:C2:37:2E:A5:C3>
2025-02-08 07:56:36.933 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: initializing Jiabaida Smart BMS, BT address: A5:C2:37:2E:A5:C3
2025-02-08 07:56:36.933 DEBUG (MainThread) [custom_components.bms_ble] Initializing coordinator for DP04S007L4S120A (A5:C2:37:2E:A5:C3) as Jiabaida Smart BMS
2025-02-08 07:56:36.933 DEBUG (MainThread) [custom_components.bms_ble] DP04S007L4S120A: advertisement: {'name': 'DP04S007L4S120A', 'address': 'A5:C2:37:2E:A5:C3', 'rssi': -47, 'manufacturer_data': {42435: b'.7\xc2\xa5'}, 'service_data': {}, 'service_uuids': ['0000ff00-0000-1000-8000-00805f9b34fb'], 'source': '3C:8A:1F:81:55:18', 'advertisement': AdvertisementData(local_name='DP04S007L4S120A', manufacturer_data={42435: b'.7\xc2\xa5'}, service_uuids=['0000ff00-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-47), 'device': BLEDevice(A5:C2:37:2E:A5:C3, DP04S007L4S120A), 'connectable': True, 'time': 2075779.311838468, 'tx_power': None}
2025-02-08 07:56:36.933 DEBUG (MainThread) [custom_components.bms_ble] DP04S007L4S120A: BMS data update
2025-02-08 07:56:36.933 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: connecting BMS
2025-02-08 07:56:36.933 DEBUG (MainThread) [bleak_retry_connector] A5:C2:37:2E:A5:C3 - A5:C2:37:2E:A5:C3: Connection attempt: 1
2025-02-08 07:56:37.654 DEBUG (MainThread) [bleak_retry_connector] A5:C2:37:2E:A5:C3 - A5:C2:37:2E:A5:C3: Connected after 1 attempts
2025-02-08 07:56:37.663 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: TX BLE data: dd a5 03 00 ff fd 77
2025-02-08 07:56:37.856 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (start): bytearray(b'\xdd\x03\x00"\x054\x00\x002\xe8@t\x00\x001\x1a\x00\x00\x00\x00')
2025-02-08 07:56:37.856 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (cnt.): bytearray(b'\x00\x00fO\x03\x04\x01\x0b?\x00\x00\x00@t2\xe8\x00\x00\xfa\xb7')
2025-02-08 07:56:37.856 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (cnt.): bytearray(b'w')
2025-02-08 07:56:37.857 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: TX BLE data: dd a5 04 00 ff fc 77
2025-02-08 07:56:37.958 DEBUG (MainThread) [custom_components.bms_ble.plugins.jbd_bms] DP04S007L4S120A[A5:C3]: RX BLE data (start): bytearray(b'\xdd\x04\x00\x08\r\x03\r\x04\r\x03\r\x03\xff\xb7w')
2025-02-08 07:56:37.958 DEBUG (MainThread) [custom_components.bms_ble] DP04S007L4S120A: BMS data sample {'temp_sensors': 1, 'voltage': 13.32, 'current': 0.0, 'battery_level': 79, 'cycle_charge': 130.32, 'cycles': 0, 'temp#0': 14.8, 'cell#0': 3.331, 'cell#1': 3.332, 'cell#2': 3.331, 'cell#3': 3.331, 'delta_voltage': 0.001, 'cycle_capacity': 1735.862, 'power': 0.0, 'battery_charging': False, 'temperature': 14.8}
2025-02-08 07:56:37.958 DEBUG (MainThread) [custom_components.bms_ble] Finished fetching DP04S007L4S120A data in 1.025 seconds (success: True)
2025-02-08 07:56:37.958 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up bms_ble.binary_sensor
2025-02-08 07:56:37.958 INFO (MainThread) [homeassistant.components.sensor] Setting up bms_ble.sensor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants