Code Monkey home page Code Monkey logo

bms_connector's People

Contributors

dependabot[bot] avatar flip555 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sofkaski

bms_connector's Issues

Incorrect alarm interpretation

BMS Version ๐Ÿ”„

Seplos V2. (Integration reports: Device Details for 0x00: {'device_name': '1101-JK06 ', 'software_version': '16.4', 'manufacturer_name': 'CAN:PNG_DYE_'}

Connection Method ๐ŸŒ

USB-RS485

Pre-submission Checklist โœ…

  • This issue is focused on a single problem (For multiple issues, create separate reports).
  • I've checked for existing issues and confirmed mine is unique.

What's happening? ๐Ÿค”

The battery pack has 'Monomer overvoltage protection' and 'Intermittent charging' alarms on based on EN BMS Android application. These warning/alarms makes sense based on the actual state of the battery pack.

What gets reported by bms_connector integration are Alarm Event 1: Temperature sensor fault and Alarm Event 5: Charge over current protection .

These interpretations seem to be offset by one. The correct interpretation can be found from Alarm Event 2 and Alarm Event 6

Steps to Reproduce ๐Ÿ”

  1. Observe alarms and warnings that are on from the Android app
  2. Observe the state of entity BMS - 0x00 - Alarm Event 1 and BMS - 0x00 - Alarm Event 5 (BMS is the prefix I use)

Debug logs ๐Ÿ“œ

2024-05-03 11:50:55.444 DEBUG (SyncWorker_5) [custom_components.bms_connector.connector.local_serial.local_serial] ['~20004642E00200FD37\r', '~20004644E00200FD35\r', '~20004647E00200FD32\r', '~20
004651E00200FD37\r']
2024-05-03 11:50:55.451 DEBUG (SyncWorker_5) [custom_components.bms_connector.connector.local_serial.local_serial] ~20004642E00200FD37
2024-05-03 11:50:55.952 DEBUG (SyncWorker_5) [custom_components.bms_connector.connector.local_serial.local_serial] ~20004644E00200FD35
2024-05-03 11:50:56.455 DEBUG (SyncWorker_5) [custom_components.bms_connector.connector.local_serial.local_serial] ~20004647E00200FD32
2024-05-03 11:50:56.957 DEBUG (SyncWorker_5) [custom_components.bms_connector.connector.local_serial.local_serial] ~20004651E00200FD37
2024-05-03 11:50:57.461 DEBUG (SyncWorker_5) [custom_components.bms_connector.connector.local_serial.local_serial] ['~2000460010960000100CF10DF90CF00DE90CF10D1F0CF10D850CF10CF00CF10CF10CF10CF10CF
10CF1060BC70BCA0BC60BCA0C0C0BC9000014FB254A0A254A03E86D60003D03E81535FFFC00070BE50B6CDC11', '~20004600806200001000020002000000020000000000000000060000000000000000140002000000020182001000000000000
000000010EB21', '~200046008152003C0DAC0D480B540C1C0E420D480A8C0C1C0D4805DC15E01518122012C01680151810E012C0189C17D40C9F0C810ABF0ADD0CD10C9F0A470AAB0CB30C810A470AC90CD10C9F0A150AAB0AAB0B0F0C9F0C810
AAB0AC90D030CD10A470AAB0E2F0DFD0E930DFD4E204C2CAFECB0B45208ADF88AD007D06D6036B01B321E1E140A100A0A1E3C0505010A0A1EF0300F0560506409000D0008FFFFFF3FBF9FAF1E313130312D4A4B303620B27A', '~20004600C0403
13130312D4A4B303620100743414E3A504E475F4459455F4C7578705F544242F017']
2024-05-03 11:50:57.464 DEBUG (MainThread) [custom_components.bms_connector.bms.seplos.v2.data_parser] Calculated Checksum: DC11
2024-05-03 11:50:57.465 DEBUG (MainThread) [custom_components.bms_connector.bms.seplos.v2.data_parser] Telemetry Result for 0x00: {'cellsCount': 16, 'cellVoltage': [3313, 3577, 3312, 3561, 3313, 
3359, 3313, 3461, 3313, 3312, 3313, 3313, 3313, 3313, 3313, 3313], 'tempCount': 6, 'temperatures': [28.4, 28.7, 28.3, 28.7, 35.3, 28.6], 'current': 0.0, 'voltage': 53.71, 'resCap': 95.46, 'custom
Number': 10, 'capacity': 95.46, 'soc': 100.0, 'ratedCapacity': 280.0, 'cycles': 61, 'soh': 100.0, 'portVoltage': 54.29}
2024-05-03 11:50:57.465 DEBUG (MainThread) [custom_components.bms_connector.bms.seplos.v2.data_parser] About to return from extract_data_from_message. Telemetry: cellsCount: 16, cellVoltage: [331
3, 3577, 3312, 3561, 3313, 3359, 3313, 3461, 3313, 3312, 3313, 3313, 3313, 3313, 3313, 3313], tempCount: 6, temperatures: [28.4, 28.7, 28.3, 28.7, 35.3, 28.6], current: 0.0, voltage: 53.71, resCa
p: 95.46, customNumber: 10, capacity: 95.46, soc: 100.0, ratedCapacity: 280.0, cycles: 61, soh: 100.0, portVoltage: 54.29
2024-05-03 11:50:57.466 DEBUG (MainThread) [custom_components.bms_connector.bms.seplos.v2.data_parser] Calculated Checksum: EB21
2024-05-03 11:50:57.466 DEBUG (MainThread) [custom_components.bms_connector.bms.seplos.v2.data_parser] Teledata Result for 0x00: {'cellsCount': 16, 'cellAlarm': [0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 
0, 0, 0, 0, 0], 'tempCount': 6, 'tempAlarm': [0, 0, 0, 0, 0, 0], 'currentAlarm': 0, 'voltageAlarm': 0, 'customAlarms': 20, 'alarmEvent0': 0, 'alarmEvent1': 2, 'alarmEvent2': 0, 'alarmEvent3': 0, 
'alarmEvent4': 0, 'alarmEvent5': 2, 'onOffState': 1, 'equilibriumState0': 130, 'equilibriumState1': 0, 'systemState': 16, 'disconnectionState0': 0, 'disconnectionState1': 0, 'alarmEvent6': 0, 'al
armEvent7': 0}
2024-05-03 11:50:57.466 DEBUG (MainThread) [custom_components.bms_connector.bms.seplos.v2.data_parser] About to return from extract_data_from_message. Teledata: cellsCount: 16, cellAlarm: [0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0], tempCount: 6, tempAlarm: [0, 0, 0, 0, 0, 0], currentAlarm: 0, voltageAlarm: 0, customAlarms: 20, alarmEvent0: 0, alarmEvent1: 2, alarmEvent2: 0, alarmEv:

Diagnostics dump ๐Ÿ“ฆ

No response

Add to HACS store

Would like to look at adding this to the HACS store.

If anyone wants to help out feel free to do a PR or guidance ๐Ÿ‘

Support for multiple batteries - automatic detection or manually select the battery pack number

We currently only request data from one pack.

It would be good to be able to either scan through all the pack addresses automatically or just ADD ENTRY in Integrations> Seplos, this would bring up config_flow where you could select the pack address.

To do this I think we will need to prefix the sensor names with the pack number so we can have multiple sensors

The commands the code currently sends are

COMMAND_1 = "~20004642E00200FD37\r"
COMMAND_2 = "~20004644E00200FD35\r"

These are then processed through extract_data_from_message() function which splits them to parse_telemetry_info() and parse_teledata_info() to parse.

I believe we already get battery pack number in extract_data_from_message() - address_string = '0x' + form_battery_id_str(address)

42 Command Gets Voltages:

ASCII Modbus 42 00: "~20004642E00200FD37\r"
ASCII Modbus 42 01: "~20004642E00201FD36\r"
ASCII Modbus 42 02: "~20004642E00202FD35\r"
ASCII Modbus 42 03: "~20004642E00203FD34\r"
ASCII Modbus 42 04: "~20004642E00204FD33\r"
ASCII Modbus 42 05: "~20004642E00205FD32\r"
ASCII Modbus 42 06: "~20004642E00206FD31\r"
ASCII Modbus 42 07: "~20004642E00207FD30\r"
ASCII Modbus 42 08: "~20004642E00208FD2F\r"
ASCII Modbus 42 09: "~20004642E00209FD2E\r"
ASCII Modbus 42 10: "~20004642E00210FD36\r"
ASCII Modbus 42 11: "~20004642E00211FD35\r"
ASCII Modbus 42 12: "~20004642E00212FD34\r"
ASCII Modbus 42 13: "~20004642E00213FD33\r"
ASCII Modbus 42 14: "~20004642E00214FD32\r"
ASCII Modbus 42 15: "~20004642E00215FD31\r"

44 Command Gets Alarm Data:

ASCII Modbus 44 00: "~20004644E00200FD35\r"
ASCII Modbus 44 01: "~20004644E00201FD34\r"
ASCII Modbus 44 02: "~20004644E00202FD33\r"
ASCII Modbus 44 03: "~20004644E00203FD32\r"
ASCII Modbus 44 04: "~20004644E00204FD31\r"
ASCII Modbus 44 05: "~20004644E00205FD30\r"
ASCII Modbus 44 06: "~20004644E00206FD2F\r"
ASCII Modbus 44 07: "~20004644E00207FD2E\r"
ASCII Modbus 44 08: "~20004644E00208FD2D\r"
ASCII Modbus 44 09: "~20004644E00209FD2C\r"
ASCII Modbus 44 10: "~20004644E00210FD34\r"
ASCII Modbus 44 11: "~20004644E00211FD33\r"
ASCII Modbus 44 12: "~20004644E00212FD32\r"
ASCII Modbus 44 13: "~20004644E00213FD31\r"
ASCII Modbus 44 14: "~20004644E00214FD30\r"
ASCII Modbus 44 15: "~20004644E00215FD2F\r"

bug #30 is not closed.

BMS Version ๐Ÿ”„

seplos v 2

Connection Method ๐ŸŒ

USB-RS485

Pre-submission Checklist โœ…

  • This issue is focused on a single problem (For multiple issues, create separate reports).
  • I've checked for existing issues and confirmed mine is unique.

What's happening? ๐Ÿค”

Your suggestion to try:

https://github.com/flip555/bms_connector

doesn't solve the problem: I got the same error. This is not a valid repository.

Steps to Reproduce ๐Ÿ”

...

Debug logs ๐Ÿ“œ

No response

Diagnostics dump ๐Ÿ“ฆ

No response

Fix config_flow

Has issues still. Will allow you to add another entry with same pack number.
Few other little bits

Parallel BMS

BMS Version ๐Ÿ”„

seplos v.2

Connection Method ๐ŸŒ

USB-RS485

Problem Description ๐Ÿค”

Currently many installations have battery packs in parallel each one with its own BMS; in my case 4 packs with 4 Seplos x v.2. BMS RS485 ports of all Seplos are linked by UTP cables in a daisy chain configuration and Seplos switches set accordingly with installation manual in order to address each pack and set the total number of packs in parallel. One end of RS485 cable goes to PC Window APP provided by Seplos through a RS485 to USB converter.
The RS485 connection also provides the Master Seplos BMS with the capability to drive the load distribution among each pack of the parallel.
The App provides either a view of all parameters of each single selected pack by clicking the pack number on the Window screen or a recap of all packs parameters in anoher screen.
Currently it appears the BMS Connector doesn't work in this configuration.
Could you please put an eye on the protocol and see if it would be possible to have this upgrade @bms Connector v. 2? Thank you in advance

Proposed Solution ๐Ÿ› ๏ธ

I suspect the Seplos protocol adds some preamble string to identify the total number of packs in parallel and the pack address of following data.

Alternatives Considered ๐Ÿ”„

No response

Additional context ๐Ÿ“„

No response

entities not available with 4 HUBs for 4 Seplos v. 2

BMS Version ๐Ÿ”„

1.05

Connection Method ๐ŸŒ

USB-RS485

Pre-submission Checklist โœ…

  • This issue is focused on a single problem (For multiple issues, create separate reports).
  • I've checked for existing issues and confirmed mine is unique.

What's happening? ๐Ÿค”

I have a stack of 4x14kWh LifePO4 batteries in parallel, controlled by 4xBMS Seplos v. 2, using 4 HUBs of the BMS Connector running on a Raspberry Pi4 with Homeassistant through the ports USB0, USB1, USB2, USB3:
I configured 4 HUBs (Pack1, Pack2, Pack3 and Pack4) on BMS connector; each HUB acquires 193 entities from its own Seplos.

So for each HUB in the home assistant dashboard I show:
-Current,
-Voltage,
-SOC%
then for each HUB I add and display the totals of:
-Residual Capacity,
-Rated Capacity
-(Rated Capacity -Residual Capacity)
In total I use 20 entities and show 15 of which 3 are calculated.
I disabled all the other unused entities of the 4 HUBs.
So of 193x4=772 entities acquired by the 4 HUBs, I only use 20 of them, the others are disabled.

I) Unfortunately the dashboard is unable to show any of these 20 entities, which are: "not available".

II)Naturally even with all 772 entities enabled, the dashboard does not show these 20 entities which are all "not available".

III)If in the BMS Connector configuration I disable at least 2 HUBs (it doesn't matter which ones), then the dashboard shows the correct values of the two HUBs not disabled.

lV)If I disable polling of at least 2 HUBs in the BMS Connector configuration, then the dashboard shows the "static" values of the entities of the 2 disabled HUBs and the "dynamic" values of the remaining enabled entities.

I imagine there is a sampling time problem in the case of a high number of entities transmitted by each Seplos BMS.

Do you have any chance to fix this problem with 4 HUBs configured?
Thanks for your attention.

Steps to Reproduce ๐Ÿ”

1.configure 4 HUB USB-RS485 with 4 Seplos v. 2 (not inteconnected)
2.
3.
...

Debug logs ๐Ÿ“œ

Logger: homeassistant.helpers.integration_platform
Source: helpers/integration_platform.py:50
First occurred: 16:36:37 (4 occurrences)
Last logged: 21:07:13

Unexpected error importing hacs/recorder.py
Unexpected error importing hacs/media_source.py
Unexpected error importing hacs/logbook.py
Unexpected error importing hacs/hardware.py
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 50, in _async_process_single_integration_platform_component
platform = integration.get_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 859, 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 "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.hacs_old.recorder'

Not sure this log belongings to BMS_Connector

Diagnostics dump ๐Ÿ“ฆ

No response

Bug

BMS Version ๐Ÿ”„

V 2.0

Connection Method ๐ŸŒ

USB-RS485

Pre-submission Checklist โœ…

  • This issue is focused on a single problem (For multiple issues, create separate reports).
  • I've checked for existing issues and confirmed mine is unique.

What's happening? ๐Ÿค”

Entities are not loaded

Steps to Reproduce ๐Ÿ”

...

Debug logs ๐Ÿ“œ

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/bms_connector/sensor.py", line 22, in async_setup_entry
await hass.data[DOMAIN]["HOME_ENERGY_HUB_SENSOR_COORDINATOR"+entry_id].async_refresh()
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'HOME_ENERGY_HUB_SENSOR_COORDINATORdf7cf633016891488a69c9e081246d5c'
2024-02-26 20:27:19.777 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up bms_connector platform for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/bms_connector/binary_sensor.py", line 22, in async_setup_entry
await hass.data[DOMAIN]["HOME_ENERGY_HUB_SENSOR_COORDINATOR"+entry_id].async_refresh()
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'HOME_ENERGY_HUB_SENSOR_COORDINATORdf7cf633016891488a69c9e081246d5c'
2024-02-26 20:27:24.079 DEBUG (MainThread) [custom_components.bms_connector] Seplos V2 BMS Device Selected..
2024-02-26 20:27:24.080 DEBUG (MainThread) [custom_components.bms_connector.modules.bms.seplos.v2] ['~20004642E00200FD37\r', '~20004644E00200FD35\r', '~20004647E00200FD32\r', '~20004651E00200FD37\r']
2024-02-26 20:27:24.092 DEBUG (MainThread) [custom_components.bms_connector.modules.bms.seplos.v2] ~20004642E00200FD37
2024-02-26 20:27:24.603 DEBUG (MainThread) [custom_components.bms_connector.modules.bms.seplos.v2] ~20004644E00200FD35
2024-02-26 20:27:25.112 ERROR (MainThread) [custom_components.bms_connector] Error setting up BMS Connector: 'utf-8' codec can't decode byte 0xa8 in position 12: invalid start byte
2024-02-26 20:27:25.115 INFO (MainThread) [homeassistant.components.sensor] Setting up bms_connector.sensor
2024-02-26 20:27:25.116 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up bms_connector.binary_sensor
2024-02-26 20:27:25.118 INFO (MainThread) [homeassistant.components.select] Setting up bms_connector.select
2024-02-26 20:27:25.119 INFO (MainThread) [homeassistant.components.number] Setting up bms_connector.number
2024-02-26 20:27:25.123 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up bms_connector platform for sensor

Diagnostics dump ๐Ÿ“ฆ

No response

https://github.com/flip555/seplos_bms_ha is not a valid repository

BMS Version ๐Ÿ”„

seplos 2

Connection Method ๐ŸŒ

USB-RS485

Pre-submission Checklist โœ…

  • This issue is focused on a single problem (For multiple issues, create separate reports).
  • I've checked for existing issues and confirmed mine is unique.

What's happening? ๐Ÿค”

when try to add Hacs app I get:

https://github.com/flip555/seplos_bms_ha is not a valid add-on repository.
HA CORE 2023.9.2
Please help.

Steps to Reproduce ๐Ÿ”

...

Debug logs ๐Ÿ“œ

No response

Diagnostics dump ๐Ÿ“ฆ

No response

Urgent Fixes

BMS Version ๐Ÿ”„

v2

Connection Method ๐ŸŒ

USB-RS485

Pre-submission Checklist โœ…

  • This issue is focused on a single problem (For multiple issues, create separate reports).
  • I've checked for existing issues and confirmed mine is unique.

What's happening? ๐Ÿค”

  • fix sensor data type - getting graphs on all the alarms instead of string
  • change sensor name values! - WARNING all sensor names will be changing!
  • incorporate a few more sensors

Steps to Reproduce ๐Ÿ”

...

Debug logs ๐Ÿ“œ

No response

Diagnostics dump ๐Ÿ“ฆ

No response

Sensor update

BMS Version ๐Ÿ”„

SEPLOS V2

Connection Method ๐ŸŒ

USB-RS485

Pre-submission Checklist โœ…

  • This issue is focused on a single problem (For multiple issues, create separate reports).
  • I've checked for existing issues and confirmed mine is unique.

What's happening? ๐Ÿค”

Hello,

I don't know where I'm making a mistake, but my sensor data is not updated automatically. I have to manually reload the integration to read new data. Where is the problem with me or the integration?? I couldn't find the time to update the data anywhere.

Thank you for suport

Steps to Reproduce ๐Ÿ”

...
data is not refreshed

Debug logs ๐Ÿ“œ

No response

Diagnostics dump ๐Ÿ“ฆ

No response

Rename temp sensors 5 & 6

BMS Version ๐Ÿ”„

V2

Connection Method ๐ŸŒ

USB-RS485

Pre-submission Checklist โœ…

  • This issue is focused on a single problem (For multiple issues, create separate reports).
  • I've checked for existing issues and confirmed mine is unique.

What's happening? ๐Ÿค”

Temperatures 5 and 6 should be called System and Environment Temps

Steps to Reproduce ๐Ÿ”

...

Debug logs ๐Ÿ“œ

No response

Diagnostics dump ๐Ÿ“ฆ

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.