Skip to content

Commit bbc15fc

Browse files
authored
Fix ECO-WORTHY, DCHOUSE detection due to wrong manufacturer ID (#180)
* fix ECO-WORTHY detection due to wrong manufacturer ID * also fixes #157 for DCHOUSE detection
1 parent ceaae79 commit bbc15fc

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ This integration allows to monitor Bluetooth Low Energy (BLE) battery management
2727
- Ective batteries
2828
- JBD BMS, Jiabaida (show up as `SP..S`…)
2929
- accurat batteries (show up as `GJ-`…)
30-
- ECO-WORTHY batteries (show up as `DP..S`…)
31-
- Supervolt v3 batteries (show up as `SX1*`…)
30+
- ECO-WORTHY batteries (show up as `DP04S`…)
31+
- Supervolt v3 batteries (show up as `SX1`…)
3232
- JK BMS, Jikong, (HW version ≥ 6 required)
3333
- Offgridtec LiFePo4 Smart Pro: type A & B (show up as `SmartBat-A`… or `SmartBat-B`…)
3434
- LiTime, Power Queen, and Redodo batteries

custom_components/bms_ble/manifest.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,9 @@
4242
"service_uuid": "0000ff00-0000-1000-8000-00805f9b34fb"
4343
},
4444
{
45-
"manufacturer_id": 6226,
45+
"local_name": "DP04S*",
4646
"service_uuid": "0000ff00-0000-1000-8000-00805f9b34fb"
47-
},
48-
{
49-
"manufacturer_id": 8856,
50-
"service_uuid": "0000ff00-0000-1000-8000-00805f9b34fb"
51-
},
47+
},
5248
{
5349
"local_name": "SP0*",
5450
"service_uuid": "0000fff0-0000-1000-8000-00805f9b34fb"

custom_components/bms_ble/plugins/jbd_bms.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,7 @@ def matcher_dict_list() -> list[dict]:
5757
"service_uuid": BMS.uuid_services()[0],
5858
"connectable": True,
5959
}
60-
for pattern in ["SP0?S*", "SP1?S*", "SP2?S*", "GJ-*", "SX1*"]
61-
] + [
62-
{ # ECO-WORTHY LiFePO4
63-
"service_uuid": BMS.uuid_services()[0],
64-
"manufacturer_id": manufacturer_id,
65-
"connectable": True,
66-
}
67-
for manufacturer_id in [0x1852, 0x2298]
60+
for pattern in ["SP0?S*", "SP1?S*", "SP2?S*", "GJ-*", "SX1*", "DP04S*"]
6861
]
6962

7063
@staticmethod

tests/advertisement_data.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
( # source LOG (https://github.com/patman15/BMS_BLE-HA/issues/144)
243243
generate_advertisement_data( # ECO-WORTHY LiFePO4 12V 100Ah
244244
local_name="DP04S007L4S100A",
245-
manufacturer_data={6226: b"\x28\x37\xc2\xa5"},
245+
manufacturer_data={6226: b"\x28\x37\xc2\xa5"}, # MAC address, wrong
246246
service_uuids=["0000ff00-0000-1000-8000-00805f9b34fb"],
247247
rssi=-57,
248248
),
@@ -252,11 +252,22 @@
252252
generate_advertisement_data( # ECO-WORTHY LiFePO4 12V 100Ah
253253
local_name="DP04S007L4S100A",
254254
service_uuids=["0000ff00-0000-1000-8000-00805f9b34fb"],
255-
manufacturer_data={8856: "\x28\x37\xc2\xa5"},
255+
manufacturer_data={8856: "\x28\x37\xc2\xa5"}, # MAC address, wrong
256256
rssi=-53,
257257
),
258258
"jbd_bms",
259259
),
260+
( # source LOG (https://github.com/patman15/BMS_BLE-HA/issues/134)
261+
# (https://github.com/patman15/BMS_BLE-HA/issues/157)
262+
generate_advertisement_data( # ECO-WORTHY LiFePO4 12V 150Ah, DCHOUSE FW v6.6
263+
local_name="DP04S007L4S120A",
264+
manufacturer_data={42435: b"\x27\x37\xc2\xa5"}, # MAC address, wrong
265+
service_uuids=["0000ff00-0000-1000-8000-00805f9b34fb"],
266+
tx_power=-127,
267+
rssi=-49,
268+
),
269+
"jbd_bms",
270+
),
260271
( # source LOG (https://github.com/patman15/BMS_BLE-HA/issues/160#issuecomment-2629318416)
261272
generate_advertisement_data(
262273
local_name="SP17S005P17S120A",

0 commit comments

Comments
 (0)