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

Fix ECO-WORTHY, DCHOUSE detection due to wrong manufacturer ID #180

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ 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 batteries (show up as `DP..S`…)
- Supervolt v3 batteries (show up as `SX1*`…)
- ECO-WORTHY batteries (show up as `DP04S`…)
- 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`…)
- LiTime, Power Queen, and Redodo batteries
Expand Down
8 changes: 2 additions & 6 deletions custom_components/bms_ble/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,9 @@
"service_uuid": "0000ff00-0000-1000-8000-00805f9b34fb"
},
{
"manufacturer_id": 6226,
"local_name": "DP04S*",
"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"
Expand Down
9 changes: 1 addition & 8 deletions custom_components/bms_ble/plugins/jbd_bms.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,7 @@ def matcher_dict_list() -> list[dict]:
"service_uuid": BMS.uuid_services()[0],
"connectable": True,
}
for pattern in ["SP0?S*", "SP1?S*", "SP2?S*", "GJ-*", "SX1*"]
] + [
{ # ECO-WORTHY LiFePO4
"service_uuid": BMS.uuid_services()[0],
"manufacturer_id": manufacturer_id,
"connectable": True,
}
for manufacturer_id in [0x1852, 0x2298]
for pattern in ["SP0?S*", "SP1?S*", "SP2?S*", "GJ-*", "SX1*", "DP04S*"]
]

@staticmethod
Expand Down
15 changes: 13 additions & 2 deletions tests/advertisement_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
( # source LOG (https://github.com/patman15/BMS_BLE-HA/issues/144)
generate_advertisement_data( # ECO-WORTHY LiFePO4 12V 100Ah
local_name="DP04S007L4S100A",
manufacturer_data={6226: b"\x28\x37\xc2\xa5"},
manufacturer_data={6226: b"\x28\x37\xc2\xa5"}, # MAC address, wrong
service_uuids=["0000ff00-0000-1000-8000-00805f9b34fb"],
rssi=-57,
),
Expand All @@ -252,11 +252,22 @@
generate_advertisement_data( # ECO-WORTHY LiFePO4 12V 100Ah
local_name="DP04S007L4S100A",
service_uuids=["0000ff00-0000-1000-8000-00805f9b34fb"],
manufacturer_data={8856: "\x28\x37\xc2\xa5"},
manufacturer_data={8856: "\x28\x37\xc2\xa5"}, # MAC address, wrong
rssi=-53,
),
"jbd_bms",
),
( # source LOG (https://github.com/patman15/BMS_BLE-HA/issues/134)
# (https://github.com/patman15/BMS_BLE-HA/issues/157)
generate_advertisement_data( # ECO-WORTHY LiFePO4 12V 150Ah, DCHOUSE FW v6.6
local_name="DP04S007L4S120A",
manufacturer_data={42435: b"\x27\x37\xc2\xa5"}, # MAC address, wrong
service_uuids=["0000ff00-0000-1000-8000-00805f9b34fb"],
tx_power=-127,
rssi=-49,
),
"jbd_bms",
),
( # source LOG (https://github.com/patman15/BMS_BLE-HA/issues/160#issuecomment-2629318416)
generate_advertisement_data(
local_name="SP17S005P17S120A",
Expand Down