From 1e960fb49995536ae117c03affb271582ca736ea Mon Sep 17 00:00:00 2001 From: patman15 <14628713+patman15@users.noreply.github.com> Date: Mon, 30 Dec 2024 10:40:10 +0100 Subject: [PATCH] add ECOWORTHY battery detection --- README.md | 1 + custom_components/bms_ble/manifest.json | 6 +++++- custom_components/bms_ble/plugins/jbd_bms.py | 6 ++++++ tests/advertisement_data.py | 11 +++++++++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4c09c61..6cc41c6 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ This integration allows to monitor Bluetooth Low Energy (BLE) battery management - Ective batteries - JBD BMS, Jiabaida (show up as `SP..S`…) - accurat batteries (show up as `GJ-`…) + - ECO-WORTHY bytteries (show up as `DP..S`…) - Supervolt v3 batteries (show up as `SX1*`…) - JK BMS, Jikong, (HW version ≥ 6 required) - Offgridtec LiFePo4 Smart Pro: type A & B (show up as `SmartBat-A`… or `SmartBat-B`…) diff --git a/custom_components/bms_ble/manifest.json b/custom_components/bms_ble/manifest.json index 78baa75..9bd668a 100644 --- a/custom_components/bms_ble/manifest.json +++ b/custom_components/bms_ble/manifest.json @@ -33,7 +33,11 @@ { "local_name": "SX1*", "service_uuid": "0000ff00-0000-1000-8000-00805f9b34fb" - }, + }, + { + "manufacturer_id": 8856, + "service_uuid": "0000ff00-0000-1000-8000-00805f9b34fb" + }, { "local_name": "SP0*", "service_uuid": "0000fff0-0000-1000-8000-00805f9b34fb" diff --git a/custom_components/bms_ble/plugins/jbd_bms.py b/custom_components/bms_ble/plugins/jbd_bms.py index 1bb09d7..19ced9d 100644 --- a/custom_components/bms_ble/plugins/jbd_bms.py +++ b/custom_components/bms_ble/plugins/jbd_bms.py @@ -58,6 +58,12 @@ def matcher_dict_list() -> list[dict[str, Any]]: "connectable": True, } for pattern in ["SP0?S*", "SP1?S*", "SP2?S*", "GJ-*", "SX1*"] + ] + [ + { # ECO-WORTHY LiFePO4 12V 100Ah + "service_uuid": BMS.uuid_services()[0], + "manufacturer_id": 0x2298, + "connectable": True, + } ] @staticmethod diff --git a/tests/advertisement_data.py b/tests/advertisement_data.py index ab7886c..8975378 100644 --- a/tests/advertisement_data.py +++ b/tests/advertisement_data.py @@ -179,11 +179,18 @@ "daly_bms", ), ( # source nRF (https://github.com/patman15/BMS_BLE-HA/issues/22#issuecomment-2198586195) - generate_advertisement_data( - local_name="SX100P-B230201", # Supervolt Battery + generate_advertisement_data( # Supervolt battery + local_name="SX100P-B230201", service_uuids=["0000ff00-0000-1000-8000-00805f9b34fb"], manufacturer_data={31488: "\x02\xFF\xFF\x7D"}, ), "jbd_bms", ), + ( # source bluetoothctl (https://github.com/patman15/BMS_BLE-HA/issues/134) + generate_advertisement_data( # ECO-WORTHY LiFePO4 12V 100Ah + service_uuids=["0000ff00-0000-1000-8000-00805f9b34fb"], + manufacturer_data={8856: "\x28\x37\xc2\xa5"}, + ), + "jbd_bms", + ), ]