Coder Social home page Coder Social logo

bmspace's People

Contributors

elibl avatar jpmeijers avatar tertiush avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bmspace's Issues

Sporadic wrong byte_index when reading multiple packs

Hello @Tertiush,

I'm using the development version of the script to read out 4 Gobel Power packs. With the current BMS firmware 2.06 I recognized that implausible values are published via mqtt every now and then a few times per day. Reason for this is a wrong byte_index.
The analog data from my second battery pack sometimes contains 0x10 in the unused data following the SOH figure. This causes the condition in line 874 of the current version 2.3dev to start reading the next packs data prematurely.

In order not to trigger the condition if inc_data contains "10" after SOH I think it would make the script more robust to check for the sequence "00 00 10" instead.

Therefore, I changed line 874 to:

while (byte_index < len(inc_data)) and (cells != int(inc_data[byte_index-4:byte_index+2],16)):

This seems to solve my problem.
I think this might be the same issue that was reported here: #28

Thank you
as

Reading 2nd pack does not work

Reading 2nd pack does not work with latest code.

Starting up...
Loading config.yaml
Connection Type: Serial
MQTT connected with result code 0
Connecting to BMS...
trying to connect /dev/ttyUSB0
BMS serial connected
SOI:  0x7e
VER:  b'25'
ADR:  b'01'
CID1 (Type):  b'46'
RTN:  b'00'
LENGTH:  b'6028'
 - LCHKSUM:  54
 - LENID:  b'028'
 - LENID (int):  40
INFO:  b'50313653323030412D32313630362D312E303100'
CHKSUM:  b'F588'
Calc CHKSUM:  F588
BMS Version: P16S200A-21606-1.01@
SOI:  0x7e
VER:  b'25'
ADR:  b'01'
CID1 (Type):  b'46'
RTN:  b'00'
LENGTH:  b'B050'
 - LCHKSUM:  66
 - LENID:  b'050'
 - LENID (int):  80
INFO:  b'32313630363130323434303030303341202020204750535232504332303059573238303231313039'
CHKSUM:  b'EDBC'
Calc CHKSUM:  EDBC
BMS Serial Number: 216061024400003
Pack Serial Number: GPSR2PC200YW28
SOI:  0x7e
VER:  b'25'
ADR:  b'01'
CID1 (Type):  b'46'
RTN:  b'00'
LENGTH:  b'10F0'
 - LCHKSUM:  49
 - LENID:  b'0F0'
 - LENID (int):  240
INFO:  b'0002100D020D030D020D050D030D030D040D020D050D030D030D040D030D060D030D01060C150C0A0C120C080C3E0C5FFEB3D0344904036D60008D6D60100CFF0CFF0CFE0D000D040D010D000CFF0D090D000D060D030D040D010D010CFF060C090C000C0B
CHKSUM:  b'C9D0'
Calc CHKSUM:  C9D0
Packs: 2
Pack 1, Total cells: 16
Pack 1, V Cell1: 3330 mV
Pack 1, V Cell2: 3331 mV
Pack 1, V Cell3: 3330 mV
Pack 1, V Cell4: 3333 mV
Pack 1, V Cell5: 3331 mV
Pack 1, V Cell6: 3331 mV
Pack 1, V Cell7: 3332 mV
Pack 1, V Cell8: 3330 mV
Pack 1, V Cell9: 3333 mV
Pack 1, V Cell10: 3331 mV
Pack 1, V Cell11: 3331 mV
Pack 1, V Cell12: 3332 mV
Pack 1, V Cell13: 3331 mV
Pack 1, V Cell14: 3334 mV
Pack 1, V Cell15: 3331 mV
Pack 1, V Cell16: 3329 mV
Pack 1, Cell Max Diff Volt Calc: 5 mV
Pack 1, Total temperature sensors: 6
Pack 1, Temp1: 36.3 ℃
Pack 1, Temp2: 35.2 ℃
Pack 1, Temp3: 36.0 ℃
Pack 1, Temp4: 35.0 ℃
Pack 1, Temp5: 40.4 ℃
Pack 1, Temp6: 43.7 ℃
Pack 1, I Pack: -3.32 A
Pack 1, V Pack: 53.3 V
Pack 1, I Remaining Capacity: 186920 mAh
Pack 1, I Full Capacity: 280000 mAh
Pack 1, SOC: 66.76 %
Pack 1, Cycles: 141
Pack 1, Design Capacity: 280000 mAh
Pack 1, SOH: 100.0 %
Error parsing BMS analog data: Cannot read multiple packs
Error retrieving BMS analog data: Error parsing BMS analog data: Cannot read multiple packs
SOI:  0x7e
VER:  b'25'
ADR:  b'01'
CID1 (Type):  b'46'
RTN:  b'00'
LENGTH:  b'400C'
 - LCHKSUM:  52
 - LENID:  b'00C'
 - LENID (int):  12
INFO:  b'49046D606D60'
CHKSUM:  b'FB06'
Calc CHKSUM:  FB06
Pack Remaining Capacity: 186920 mAh
Pack Full Capacity: 280000 mAh
Pack Design Capacity: 280000 mAh
Pack SOC: 66.76 %
Pack SOH: 100.0 %
Script exiting

Numberin of packs and cell with 2 digits would help sorting

Hello again, sorry to bother you again @Tertiush

I like your project very much. When visualizing the data which is sent by MQTT the ordering is not given, because the pack and cell numbers are not numbered
01 02 03 ... 10 11 12...
but
1 2 3 ... 10 11 12...
If you could adapt this in a next release (I am using the actual dev release) this would be fantastic for correct order of the graphs and lists.
Today it will list
10 11 12.. 16 1 2 3 .. 9
Thank you very much.

Enersol Pace based Battery not reading correctly on 2 pack

Hi,

I have a pack of 2 enersol batteries which use the Pace BMS firmware. The second pack is not reading values correctly. These values are correct in the Pace BMS software and I have "swapped" the rs232 around between the batteries and it always seems the issue is on the 2nd pack ie the slave.

Debug outpur

INFO: b'0002100DAA0DA30DA70DAB0DA20D9A0DA40DA20DA40DA40DA50DAD0DA20DA70DA80DA7060B760B7A0B7F0B7D0B8E0B810000DA5326FF0227100008271064271027102710271064100DA60DAA0DAA0DAB0DA80DA70DAA0DA70DA80D9E0DA90DAA0DA60DA60DA60DA3060B5F0B6A0B690B6A0B7B0B6E0000DA7326FF0227100007271064271027102710271000'
CHKSUM: b'BFFE'
Calc CHKSUM: BFFE
Packs: 2
Pack 1, Total cells: 16
Pack 1, V Cell1: 3498 mV
Pack 1, V Cell2: 3491 mV
Pack 1, V Cell3: 3495 mV
Pack 1, V Cell4: 3499 mV
Pack 1, V Cell5: 3490 mV
Pack 1, V Cell6: 3482 mV
Pack 1, V Cell7: 3492 mV
Pack 1, V Cell8: 3490 mV
Pack 1, V Cell9: 3492 mV
Pack 1, V Cell10: 3492 mV
Pack 1, V Cell11: 3493 mV
Pack 1, V Cell12: 3501 mV
Pack 1, V Cell13: 3490 mV
Pack 1, V Cell14: 3495 mV
Pack 1, V Cell15: 3496 mV
Pack 1, V Cell16: 3495 mV
Pack 1, Cell Max Diff Volt Calc: 19 mV
Pack 1, Total temperature sensors: 6
Pack 1, Temp1: 20.4 ℃
Pack 1, Temp2: 20.8 ℃
Pack 1, Temp3: 21.3 ℃
Pack 1, Temp4: 21.1 ℃
Pack 1, Temp5: 22.8 ℃
Pack 1, Temp6: 21.5 ℃
Pack 1, I Pack: 0.0 A
Pack 1, V Pack: 55.891 V
Pack 1, I Remaining Capacity: 99830 mAh
Pack 1, I Full Capacity: 100000 mAh
Pack 1, SOC: 99.83 %
Pack 1, Cycles: 8
Pack 1, Design Capacity: 100000 mAh
Pack 1, SOH: 100.0 %
Pack 2, Total cells: 16
Pack 2, V Cell1: 10000 mV
Pack 2, V Cell2: 10000 mV
Pack 2, V Cell3: 10000 mV
Pack 2, V Cell4: 25616 mV
Pack 2, V Cell5: 3494 mV
Pack 2, V Cell6: 3498 mV
Pack 2, V Cell7: 3498 mV
Pack 2, V Cell8: 3499 mV
Pack 2, V Cell9: 3496 mV
Pack 2, V Cell10: 3495 mV
Pack 2, V Cell11: 3498 mV
Pack 2, V Cell12: 3495 mV
Pack 2, V Cell13: 3496 mV
Pack 2, V Cell14: 3486 mV
Pack 2, V Cell15: 3497 mV
Pack 2, V Cell16: 3498 mV
Pack 2, Cell Max Diff Volt Calc: 22130 mV
Pack 2, Total temperature sensors: 13
Pack 2, Temp1: 3977.9 ℃
Pack 2, Temp2: 3977.9 ℃
Pack 2, Temp3: 3977.9 ℃
Pack 2, Temp4: 3900.4 ℃
Pack 2, Temp5: 18.1 ℃
Pack 2, Temp6: 19.2 ℃
Pack 2, Temp7: 19.1 ℃
Pack 2, Temp8: 19.2 ℃
Pack 2, Temp9: 20.9 ℃
Pack 2, Temp10: 19.6 ℃
Pack 2, Temp11: -273.0 ℃
Pack 2, Temp12: 5319.3 ℃
Pack 2, Temp13: 725.3 ℃
Pack 2, I Pack: 5.51 A
Pack 2, V Pack: 4.096 V
Pack 2, I Remaining Capacity: 18310 mAh
Pack 2, I Full Capacity: 256390 mAh
Pack 2, SOC: 7.14 %
Pack 2, Cycles: 4135
Pack 2, Design Capacity: 41350 mAh
Pack 2, SOH: 620.05 %
Script running....
-> Outgoing Data: b'~250146A60000FD97\r'
<- Incoming data: b'~25014600400C26FF27102710FB0F\r'
SOI: 0x7e
VER: b'25'
ADR: b'01'
CID1 (Type): b'46'
RTN: b'00'
LENGTH: b'400C'

  • LCHKSUM: 52
  • LENID: b'00C'
  • LENID (int): 12
    INFO: b'26FF27102710'
    CHKSUM: b'FB0F'
    Calc CHKSUM: FB0F
    Pack Remaining Capacity: 99830 mAh
    Pack Full Capacity: 100000 mAh
    Pack Design Capacity: 100000 mAh
    Pack SOC: 99.83 %
    Pack SOH: 100.0 %

division by zero in BMS analog data

Hello.
I do have 10 Gobel Batteries, ID 2 is actually not connected.

The 2.2.3 dev Version is installed, 2.2.2 did not work even with the first Battery ID.

It is recognized:
BMS serial connected
BMS Version: P16S200A-21606-2.02

Then, the Pack 1 is read. Pack 2 is not existent, so 0 ist o.k.
But after this and the division by 0 no further packs are read.

Do you have a clue what I can do to get all existing 9 into HA?

Thanks.

....
Pack 1, V Cell3: 3285 mV
Pack 1, V Cell4: 3286 mV
Pack 1, V Cell5: 3288 mV
Pack 1, V Cell6: 3287 mV
Pack 1, V Cell7: 3286 mV
Pack 1, V Cell8: 3287 mV
Pack 1, V Cell9: 3286 mV
Pack 1, V Cell10: 3286 mV
Pack 1, V Cell11: 3287 mV
Pack 1, V Cell12: 3283 mV
Pack 1, V Cell13: 3285 mV
Pack 1, V Cell14: 3286 mV
Pack 1, V Cell15: 3287 mV
Pack 1, V Cell16: 3287 mV
Pack 1, Cell Max Diff Volt Calc: 5 mV
Pack 1, Total temperature sensors: 6
Pack 1, Temp1: 9.9 ℃
Pack 1, Temp2: 9.9 ℃
Pack 1, Temp3: 9.7 ℃
Pack 1, Temp4: 9.8 ℃
Pack 1, Temp5: 11.0 ℃
Pack 1, Temp6: 12.1 ℃
Pack 1, I Pack: -4.08 A
Pack 1, V Pack: 52.578 V
Pack 1, I Remaining Capacity: 174680 mAh
Pack 1, I Full Capacity: 279460 mAh
Pack 1, SOC: 62.51 %
Pack 1, Cycles: 19
Pack 1, Design Capacity: 280000 mAh
Pack 1, SOH: 99.81 %
Pack 2, Total cells: 16
Pack 2, V Cell1: 0 mV
Pack 2, V Cell2: 0 mV
Pack 2, V Cell3: 0 mV
Pack 2, V Cell4: 0 mV
Pack 2, V Cell5: 0 mV
Pack 2, V Cell6: 0 mV
Pack 2, V Cell7: 0 mV
Pack 2, V Cell8: 0 mV
Pack 2, V Cell9: 0 mV
Pack 2, V Cell10: 0 mV
Pack 2, V Cell11: 0 mV
Pack 2, V Cell12: 0 mV
Pack 2, V Cell13: 0 mV
Pack 2, V Cell14: 0 mV
Pack 2, V Cell15: 0 mV
Pack 2, V Cell16: 0 mV
Pack 2, Cell Max Diff Volt Calc: 0 mV
Pack 2, Total temperature sensors: 6
Pack 2, Temp1: 0.0 ℃
Pack 2, Temp2: 0.0 ℃
Pack 2, Temp3: 0.0 ℃
Pack 2, Temp4: 0.0 ℃
Pack 2, Temp5: 0.0 ℃
Pack 2, Temp6: 0.0 ℃
Pack 2, I Pack: 0.0 A
Pack 2, V Pack: 0.0 V
Pack 2, I Remaining Capacity: 0 mAh
Pack 2, I Full Capacity: 0 mAh
Error parsing BMS analog data: division by zero
Error retrieving BMS analog data: Error parsing BMS analog data: division by zero
Pack Remaining Capacity: 174670 mAh
Pack Full Capacity: 279460 mAh
Pack Design Capacity: 280000 mAh
Pack SOC: 62.5 %
Pack SOH: 99.81 %
Packs for warnings: 10
Pack 1, warnings:
Pack 1, balancing1: 00000000
Pack 1, balancing2: 00000000
Pack 2, warnings: cell 1 < low limit, cell 2 < low limit, cell 3 < low limit, cell 4 < low limit, cell 5 < low limit, cell 6 < low limit, cell 7 < low limit, cell 8 < low limit, cell 9 < low limit, cell 10 < low limit, cell 11 < low limit, cell 12 < low limit, cell 13 < low limit, cell 14 < low limit, cell 15 < low limit, cell 16 < low limit, total voltage < low limit
Pack 2, balancing1: 00000000
Pack 2, balancing2: 00000000
Pack 3, warnings:
Pack 3, balancing1: 00000000
Pack 3, balancing2: 00000000
Pack 4, warnings:
Pack 4, balancing1: 00000000
Pack 4, balancing2: 00000000
Pack 5, warnings:
Pack 5, balancing1: 00000000
Pack 5, balancing2: 00000000
Pack 6, warnings:
Pack 6, balancing1: 00000000
Pack 6, balancing2: 00000000
Pack 7, warnings:
Pack 7, balancing1: 00000000
Pack 7, balancing2: 00000000
Pack 8, warnings:
Pack 8, balancing1: 00000000
Pack 8, balancing2: 00000000
Pack 9, warnings:
Pack 9, balancing1: 00000000
Pack 9, balancing2: 00000000
Pack 10, warnings: Warning State 2: Low power warn
Pack 10, balancing1: 00000000
Pack 10, balancing2: 00000000
Publishing HA Discovery topic...
Error parsing BMS analog data: division by zero
Error retrieving BMS analog data: Error parsing BMS analog data: division by zero

Received message on illegal discovery topic

Hi I am battling to get mqtt auto discovery, in a fresh install of home assistant, to discover my hubble batteries.
Getting the following type of errors:
2023-05-19 13:13:39.415 WARNING (MainThread) [homeassistant.components.mqtt.discovery] Received message on illegal discovery topic 'homeassistant/sensor/BMS-0153131140211S /Pack_1_Cell_1_Voltage/config'. The topic contains not allowed characters. For more information see https://www.home-assistant.io/docs/mqtt/discovery/#discovery-topic
This in mqtt explorer.
{
"availability_topic": "bmspace/availability",
"device": {
"manufacturer": "BMS Pace",
"model": "AM-x",
"identifiers": "bmspace_0153131140211S ",
"name": "Generic Lithium",
"sw_version": "P13S120A-12290-1.46T"
},
"name": "Pack 1 Cell 1 Voltage",
"unique_id": "bmspace_0153131140211S _pack_1_v_cell_1",
"state_topic": "bmspace/pack_1/v_cells/cell_1",
"unit_of_measurement": "mV"
}
Any suggestions?

USB to Serial connection error

Hi Tertiush

I am running home assistant OS installed in an Intel NUC with the latest versions
Core
2024.3.1
Supervisor
2024.03.0
Operating System
12.1
Frontend
20240307.0

I excitedly installed your Home assistant addon. I've checked my usb-serial adaptor is connected in the hardware to /dev/ttyUSB0. When I start the addon and look at the logs I get this message. Is something missing in the addon install?

Hello BMS Pace
Starting up...
Loading options.json
Config: {"mqtt_host": "10.0.0.132", "mqtt_port": 1883, "mqtt_user": "mqtt-users", "mqtt_password": "mqtt-users", "mqtt_ha_discovery": true, "mqtt_ha_discovery_topic": "homeassistant", "mqtt_base_topic": "bmspace", "connection_type": "Serial", "bms_ip": "10.0.0.161", "bms_port": 5000, "bms_serial": "/dev/ttyUSB0", "scan_interval": 5, "debug_output": 3}
Connection Type: Serial
Traceback (most recent call last):
File "/workdir/./bms.py", line 75, in
client.connect(config['mqtt_host'], config['mqtt_port'], 60)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 914, in connect
return self.reconnect()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1044, in reconnect
sock = self._create_socket_connection()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
File "/usr/local/lib/python3.9/socket.py", line 844, in create_connection
raise err
File "/usr/local/lib/python3.9/socket.py", line 832, in create_connection
sock.connect(sa)
OSError: [Errno 113] Host is unreachable

Hubble AM5

Just thought I'll drop by and confirm that the Hubble AM5 battery works with the Volta 2.1 dev. Could not get it to work with the regular Pace-bms-dev. Thanks for the awesome plugin mate!

The command '/bin/sh -c pip3 install -r requirements.txt' returned a non-zero code: 1

I have been using this addon for more than 12 months and since 30 April it stopped running on it's own and would not start. I am running Home Assistant OS 2024.4.4 running on HassOS 12.2

I uninstalled BMS Pace addon 2.2.0 and then attempted to install it again whereupon I received the following output in the supervisor log:

Collecting paho_mqtt==1.6.1
Downloading paho-mqtt-1.6.1.tar.gz (99 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.4/99.4 kB 2.0 MB/s eta 0:00:00
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting PyYAML==6.0
Downloading PyYAML-6.0.tar.gz (124 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 125.0/125.0 kB 5.7 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [48 lines of output]
running egg_info
writing lib/PyYAML.egg-info/PKG-INFO
writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
writing top-level names to lib/PyYAML.egg-info/top_level.txt
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "", line 288, in
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/init.py", line 104, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 184, in setup
return run_commands(dist)
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 967, in run_command
super().run_command(command)
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 321, in run
self.find_sources()
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 329, in find_sources
mm.run()
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 550, in run
self.add_defaults()
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 588, in add_defaults
sdist.add_defaults(self)
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/command/sdist.py", line 102, in add_defaults
super().add_defaults()
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/sdist.py", line 250, in add_defaults
self._add_defaults_ext()
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/sdist.py", line 335, in _add_defaults_ext
self.filelist.extend(build_ext.get_source_files())
File "", line 204, in get_source_files
File "/tmp/pip-build-env-4tk9q44q/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 107, in getattr
raise AttributeError(attr)
AttributeError: cython_sources
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 23.0.1 -> 24.0
[notice] To update, run: pip install --upgrade pip

---> Removed intermediate container 3868d2cd0e88

Setting Up In Home Assistant

When trying to add this module as per adding via new repository mechanism, current version of home assistant
does not allow the addon. Some parameter configuration is not correct.

Config.yaml error

I use a computer A run ubuntu and I connect usb ch340 from my computer to bms (rj11). I connect computer A to my network. I have another computer run home assistant with mqtt broker. How can I config config.yaml on my computer A for send infomation of my batterie to my home assistant?
My batterie use bms pace (I can read with bpms tools)
Thank you

Wiring

Hello,

can you please leave some details of wiring the PACE bms and which kind of adapter you used to connect from PC to BMS?

Second:
i'd to uncomment the first path und comment out the second one to get the script working

with open(r'config.yaml') as file:
config = yaml.load(file, Loader=yaml.FullLoader)['options']

#with open(r'/data/options.json') as file:

config = json.load(file)

print("Config: " + json.dumps(config))

Regards

Checksum error

Hi, I am seeing checksum errors trying to monitor my two Greenrich U-P5000 5kWh battery packs.

python3 ./bms.py
Starting up...
Loading config.yaml
Connection Type: IP
MQTT connected with result code 0
Connecting to BMS...
trying to connect 192.168.201.1:5000
BMS socket connected
BMS Version: P16S150A-17900-2.01
BMS Serial Number: 17900112250937D
Pack Serial Number: Jan102022,13
Error retrieving BMS analog data: Checksum error
Pack Remaining Capacity: 101380 mAh
Pack Full Capacity: 106270 mAh
Pack Design Capacity: 99000 mAh
Pack SOC: 95.4 %
Pack SOH: 107.34 %
Packs for warnings: 2
Pack 1, warnings:
Pack 1, balancing1: 00000000
Pack 1, balancing2: 00000000
Pack 2, warnings:
Pack 2, balancing1: 00000000
Pack 2, balancing2: 00000000
Publishing HA Discovery topic...
Error retrieving BMS analog data: Checksum error
Error retrieving BMS analog data: Checksum error
Error retrieving BMS analog data: Checksum error
Error retrieving BMS analog data: Checksum error
Error retrieving BMS analog data: Checksum error
Error retrieving BMS analog data: Checksum error
Error retrieving BMS analog data: Checksum error
Error retrieving BMS warning info: Checksum error
Error retrieving BMS analog data: Checksum error
Error retrieving BMS analog data: Checksum error

I am connected via RS232 to the pack, but running bms.py on my M1 Mac through ser2net on Linux to reach the actual ttyUSB5 device. The two packs are connected together via RS485, and to the inverter via CAN.

A snippet of the log run with debug level 3:

Received and calculated CHKSUM does not match: Received: , Calculated: D727
...for incoming data: b'~25014600D0F40002100D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0A0D0B0D0B060B810B7F0B7E0B850B760B8BFF0BD0AF2781022983010526AC5F100D0A0D0B0D0A0D0A0D0A0D0A0D0B0D0B0D0A0D0A0D0A0D0A0D0\r' |Hex: 7e 32 35 30 31 34 36 30 30 44 30 46 34 30 30 30 32 31 30 30 44 30 42 30 44 30 42 30 44 30 42 30 44 30 42 30 44 30 42 30 44 30 42 30 44 30 42 30 44 30 42 30 44 30 42 30 44 30 42 30 44 30 42 30 44 30 42 30 44 30 42 30 44 30 41 30 44 30 42 30 44 30 42 30 36 30 42 38 31 30 42 37 46 30 42 37 45 30 42 38 35 30 42 37 36 30 42 38 42 46 46 30 42 44 30 41 46 32 37 38 31 30 32 32 39 38 33 30 31 30 35 32 36 41 43 35 46 31 30 30 44 30 41 30 44 30 42 30 44 30 41 30 44 30 41 30 44 30 41 30 44 30 41 30 44 30 42 30 44 30 42 30 44 30 41 30 44 30 41 30 44 30 41 30 44 30 41 30 44 30 0d
Length of incoming data as measured: 191
SOI:  0x7e
VER:  b'25'
ADR:  b'01'
CID1 (Type):  b'46'
RTN (decode!):  b'00'
LENGTH:  b'D0F4'
 - LCHKSUM:  68
 - LENID:  b'0F4'
 - LENID (int):  244

Please let me know if there is any more information I can provide?

Edit: To be clear, I manually edited bms.py and set packs = 2.

no client id

i'm running iobroker with bmspace but the mqtt server always reports - no client connected even tough bmspace connects fine. The issue is that bmspace sends no client id.

Log:

Client [] connected with secret 1689627831142_9164

Normally in [] is the mqtt client id written.

Greets,
Stefan

Not reading multiple packs , only the first one

Hi, So I have a 3 pack from SUNPRO that I try to read with this library over RS-232. It only works for the first battery module out of 3.
The data is available as their PC software does read all 3 packs data from the single connection.
image
So I guess it must be something simple to fix.

Debug output is following. (A minior thing I notice here is that SN is truncated on the hypen but that I fix with extending the readout of SN to position 82)

MQTT connected with result code 0
Connecting to BMS...
trying to connect /dev/ttyUSB0
BMS serial connected
-> Outgoing Data:  b'~250146C10000FD9A\r'
<- Incoming data:  b'~25004600602850313653313030412D31313537302D322E303000F58B\r'
SOI:  0x7e
VER:  b'25'
ADR:  b'00'
CID1 (Type):  b'46'
RTN:  b'00'
LENGTH:  b'6028'
 - LCHKSUM:  54
 - LENID:  b'028'
 - LENID (int):  40
INFO:  b'50313653313030412D31313537302D322E303000'
CHKSUM:  b'F58B'
Calc CHKSUM:  F58B
BMS Version: P16S100A-11570-2.00
-> Outgoing Data:  b'~250146C20000FD99\r'
<- Incoming data:  b'~25004600B0503033202020202020202020202020202020202020393930323031363136313030332D323330363136EDE4\r'
SOI:  0x7e
VER:  b'25'
ADR:  b'00'
CID1 (Type):  b'46'
RTN:  b'00'
LENGTH:  b'B050'
 - LCHKSUM:  66
 - LENID:  b'050'
 - LENID (int):  80
INFO:  b'3033202020202020202020202020202020202020393930323031363136313030332D323330363136'
CHKSUM:  b'EDE4'
Calc CHKSUM:  EDE4
BMS Serial Number: 03
Pack Serial Number: 9902016161003-
-> Outgoing Data:  b'~25014642E002FFFD05\r'
<- Incoming data:  b'~25004600D07C0001100CCB0CCD0CCE0CCD0CCC0CCC0CCD0CCD0CCD0CCC0CCC0CCD0CCC0CCC0CCD0CCC060B6D0B5E0B600B540BC80BB90000CCFC10ED02417200033EE419E0F5\r'
SOI:  0x7e
VER:  b'25'
ADR:  b'00'
CID1 (Type):  b'46'
RTN:  b'00'
LENGTH:  b'D07C'
 - LCHKSUM:  68
 - LENID:  b'07C'
 - LENID (int):  124
INFO:  b'0001100CCB0CCD0CCE0CCD0CCC0CCC0CCD0CCD0CCD0CCC0CCC0CCD0CCC0CCC0CCD0CCC060B6D0B5E0B600B540BC80BB90000CCFC10ED02417200033EE419'
CHKSUM:  b'E0F5'
Calc CHKSUM:  E0F5
Packs: 1
Pack 1, Total cells: 16
Pack 1, V Cell1: 3275 mV
Pack 1, V Cell2: 3277 mV
Pack 1, V Cell3: 3278 mV
Pack 1, V Cell4: 3277 mV
Pack 1, V Cell5: 3276 mV
Pack 1, V Cell6: 3276 mV
Pack 1, V Cell7: 3277 mV
Pack 1, V Cell8: 3277 mV
Pack 1, V Cell9: 3277 mV
Pack 1, V Cell10: 3276 mV
Pack 1, V Cell11: 3276 mV
Pack 1, V Cell12: 3277 mV
Pack 1, V Cell13: 3276 mV
Pack 1, V Cell14: 3276 mV
Pack 1, V Cell15: 3277 mV
Pack 1, V Cell16: 3276 mV
Pack 1, Cell Max Diff Volt Calc: 3 mV
Pack 1, Total temperature sensors: 6
Pack 1, Temp1: 19.5 ℃
Pack 1, Temp2: 18.0 ℃
Pack 1, Temp3: 18.2 ℃
Pack 1, Temp4: 17.0 ℃
Pack 1, Temp5: 28.6 ℃
Pack 1, Temp6: 27.1 ℃
Pack 1, I Pack: 0.0 A
Pack 1, V Pack: 52.476 V
Pack 1, I Remaining Capacity: 43330 mAh
Pack 1, I Full Capacity: 167540 mAh
Pack 1, SOC: 25.86 %
Pack 1, Cycles: 3
Pack 1, Design Capacity: 161000 mAh
Pack 1, SOH: 104.06 %
Script running....
-> Outgoing Data:  b'~250146A60000FD97\r'
<- Incoming data:  b'~25004600400C10ED41723EE4FAEF\r'
SOI:  0x7e
VER:  b'25'
ADR:  b'00'
CID1 (Type):  b'46'
RTN:  b'00'
LENGTH:  b'400C'
 - LCHKSUM:  52
 - LENID:  b'00C'
 - LENID (int):  12
INFO:  b'10ED41723EE4'
CHKSUM:  b'FAEF'
Calc CHKSUM:  FAEF
Pack Remaining Capacity: 43330 mAh
Pack Full Capacity: 167540 mAh
Pack Design Capacity: 161000 mAh
Pack SOC: 25.86 %
Pack SOH: 104.06 %

`

Broken Pipe In Serial Connection

Have a fully established connection using an Elfin EE10 Serial to TCP adapter running into a Jakiper Battery. On Initial connection, full data retrieval from the BMS, on the second and subsequent attempts, I obtain a broken connection.... see log
Any suggestions would be appreciated ...
Thanks

------------------------->

Hello BMS Pace
Starting up...
Loading options.json
Config: {"mqtt_host": "192.168.100.86", "mqtt_port": 1883, "mqtt_user": "mqtt", "mqtt_password": "mqtt", "mqtt_ha_discovery": true, "mqtt_ha_discovery_topic": "homeassistant", "mqtt_base_topic": "bmspace", "connection_type": "IP", "bms_ip": "192.168.100.120", "bms_port": 8899, "bms_serial": "/dev/ttyUSB0", "scan_interval": 5, "debug_output": 3}
Connection Type: IP
MQTT connected with result code 0
Connecting to BMS...
trying to connect 192.168.100.120:8899
BMS socket connected
-> Outgoing Data: b'~250146C10000FD9A\r'
<- Incoming data: b'~25014600602850313653313030412D32313531392D312E303000F587\r'
SOI: 0x7e
VER: b'25'
ADR: b'01'
CID1 (Type): b'46'
RTN: b'00'
LENGTH: b'6028'

  • LCHKSUM: 54
  • LENID: b'028'
  • LENID (int): 40
    INFO: b'50313653313030412D32313531392D312E303000'
    CHKSUM: b'F587'
    Calc CHKSUM: F587
    BMS Version: P16S100A-21519-1.00
    Pack 1, Temp1: 20.8 ℃
    Pack 1, Temp2: 21.1 ℃
    Pack 1, Temp3: 20.7 ℃
    Pack 1, Temp4: 20.9 ℃
    Pack 1, Temp5: 22.6 ℃
    Pack 1, Temp6: 21.9 ℃
    Pack 1, I Pack: 0.0 A
    Pack 1, V Pack: 52.66 V
    Pack 1, I Remaining Capacity: 44290 mAh
    Pack 1, I Full Capacity: 102060 mAh
    Pack 1, SOC: 43.4 %
    Pack 1, Cycles: 1
    Pack 1, Design Capacity: 100000 mAh
    Pack 1, SOH: 102.06 %
    Pack 2, Total cells: 16
    Pack 2, V Cell1: 3298 mV
    Pack 2, V Cell2: 3298 mV
    Pack 2, V Cell3: 3298 mV
    Pack 2, V Cell4: 3298 mV
    Pack 2, V Cell5: 3299 mV
    Pack 2, V Cell6: 3299 mV
    Pack 2, V Cell7: 3298 mV
    Pack 2, V Cell8: 3299 mV
    Pack 2, V Cell9: 3299 mV
    Pack 2, V Cell10: 3298 mV
    Pack 2, V Cell11: 3299 mV
    Pack 2, V Cell12: 3299 mV
    Pack 2, V Cell13: 3298 mV
    Pack 2, V Cell14: 3298 mV
    Pack 2, V Cell15: 3298 mV
    Pack 2, V Cell16: 3297 mV
    Pack 2, Cell Max Diff Volt Calc: 2 mV
    Pack 2, Total temperature sensors: 6
    Pack 2, Temp1: 19.8 ℃
    Pack 2, Temp2: 19.6 ℃
    Pack 2, Temp3: 19.4 ℃
    Pack 2, Temp4: 19.5 ℃
    Pack 2, Temp5: 21.1 ℃
    Pack 2, Temp6: 20.7 ℃
    Pack 2, I Pack: 0.0 A
    Pack 2, V Pack: 52.773 V
    Pack 2, I Remaining Capacity: 53460 mAh
    Pack 2, I Full Capacity: 104210 mAh
    Pack 2, SOC: 51.3 %
    Pack 2, Cycles: 0
    Pack 2, Design Capacity: 100000 mAh
    Pack 2, SOH: 104.21 %
    Script running....

-> Outgoing Data: b'~250146A60000FD97\r'
BMS socket receive error: ord() expected a character, but string of length 0 found
Error retrieving data from BMS
Error retrieving BMS pack capacity: Error retrieving data from BMS
-> Outgoing Data: b'~25014644E002FFFD03\r'
BMS socket error: [Errno 32] Broken pipe
Error, connection to BMS lost
Error retrieving BMS warning info: Error, connection to BMS lost
Publishing HA Discovery topic...
BMS disconnected, trying to reconnect...
trying to connect 192.168.100.120:8899
BMS socket connected
-> Outgoing Data: b'~25014642E002FFFD05\r'
BMS socket receive error: ord() expected a character, but string of length 0 found
Error retrieving data from BMS
Error retrieving BMS analog data: Error retrieving data from BMS
-> Outgoing Data: b'~250146A60000FD97\r'
BMS socket error: [Errno 32] Broken pipe
Error, connection to BMS lost
Error retrieving BMS pack capacity: Error, connection to BMS lost
-> Outgoing Data: b'~25014644E002FFFD03\r'
BMS socket error: [Errno 32] Broken pipe
Error, connection to BMS lost
Error retrieving BMS warning info: Error, connection to BMS lost
Publishing HA Discovery topic...
BMS disconnected, trying to reconnect...
trying to connect 192.168.100.120:8899
BMS socket connected

------> etc

UFO Battery - hex string in balance state

Hi,
thanks a lot for your work!

Could you please check the docs with regards to these two lines? Are they really supposed to be base-8?

I'm getting exceptions because it's trying to parse strings such as 0A or 0E. When I change it to base-16, it works OK with my battery pack (UFO Battery 10 kWh).

paho.mqtt

Please update mqtt section to accomodate paho.mqtt new requirement - CallbackAPIVersion.VERSION2

Hardware Info and more documentation

I do have a System from Tewaycell Tewaycell 48V 200Ah 10Kwh All-in-one Mobile ESS Built-in Hybrid Invert and they provided a RS232 to USB Cable with it.

They also sent the PACEexTool but its completely in Chinese.

Now i found your Home Assistant integration. 😀

Can you explain a bit more how i do get the basic connection?
I think i need to install the USB driver for Linux first on the Homeassistant Raspberry. Is that possible?
Then i have questions for the requirements:
paho_mqtt==1.6.1
PyYAML==6.0.1
pyserial==3.5

I dont know how to get the reuirements.

I have Mosquito MQTT and use it already for my OpenDTU and ESP32

I posted in Power Forum but did not get any answer. So i try directly here.

Request CAN/RS485 communicate with inverter

Hello
First, I would like to thank for this project, I have successfully read the information from the battery.
Currently, I am using an inverter that supports CAN/RS485 which can communicate with pylontech standard. I also found another project that simulates battery information according to the pylontech standard.
link
I don't know much about coding so I hope you can update the current version to add the function of connecting to the inverter.
Hope you can consider it.
Thank you

A bit description on the returned values

Hi, I managed to use your FAB script to connect to my new ESS battery, saved me hours of work!

I use Openhab so I just parse the MQTT stream. While most of values are very self explaining some are quite cryptic, can we make some list of topics with basic description, especially those:

battery_bms/pack_1/prot_short_circuit 0
battery_bms/pack_1/prot_discharge_current 0
battery_bms/pack_1/prot_charge_current 0
battery_bms/pack_1/fully 0
battery_bms/pack_1/current_limit 0
battery_bms/pack_1/charge_fet 1
battery_bms/pack_1/discharge_fet 1
battery_bms/pack_1/pack_indicate 0
battery_bms/pack_1/reverse 0
battery_bms/pack_1/ac_in 0
battery_bms/pack_1/heart 0
battery_bms/pack_1/warnings (null)
battery_bms/pack_1/balancing1 00000000
battery_bms/pack_1/balancing2 00000000

ac_in? heart?

TIA

Works with SOK 48V Battery too!

Sorry if this is the wrong place, but I dont know where else I can comment on github.
I just got this running with the SOK 48V 100Ah battery and Home Assistant and it works first try.
Thanks a lot!

The command '/bin/sh -c apk add --no-cache python3' returned a non-zero code: 1

I am unable to add the app-on to home assistant. Get the following Error:

"The command '/bin/sh -c apk add --no-cache python3' returned a non-zero code: 1"

I want to test it with my Rentech 48v Lithium.

Currently I am running PBMS Tools and getting the data from the SQLite DB on a 2nd PI running Windows 10 for ARM.

Error parsing BMS warning data

First off, I'd like to thank you for creating and sharing this addon.

I've got a USB to RS232 cable hooked up to one of my two Greenrich U-P5000 batteries and as far as I can tell, the addon is pretty much correctly parsing everything correctly except for the warnings.

I've attached the complete (and verbose) log output leading up to the parsing error. Hope this helps :)

bmspace.log

Error parsing BMS analog data: Cannot read multiple packs

Hello,

Thnk you for this great software. It works out of the box with my Gobel Power GP-SR1-PC200 packs.
Only thing that does not work is reading multiple packs. I connected an USB-Serial adapter to the master pack and can read information for the master battery but not for the 3 slave packs:

trying to connect /dev/ttyUSB0
BMS serial connected
BMS Version: P16S200A-21606-1.01
BMS Serial Number: xxxx
Pack Serial Number: xxxx
Packs: 4
Pack 1, Total cells: 16
Pack 1, V Cell1: 3328 mV
Pack 1, V Cell2: 3328 mV
Pack 1, V Cell3: 3327 mV
Pack 1, V Cell4: 3328 mV
Pack 1, V Cell5: 3328 mV
Pack 1, V Cell6: 3328 mV
Pack 1, V Cell7: 3328 mV
Pack 1, V Cell8: 3328 mV
Pack 1, V Cell9: 3328 mV
Pack 1, V Cell10: 3328 mV
Pack 1, V Cell11: 3328 mV
Pack 1, V Cell12: 3328 mV
Pack 1, V Cell13: 3328 mV
Pack 1, V Cell14: 3328 mV
Pack 1, V Cell15: 3330 mV
Pack 1, V Cell16: 3328 mV
Pack 1, Cell Max Diff Volt Calc: 3 mV
Pack 1, Total temperature sensors: 6
Pack 1, Temp1: 15.0 ℃
Pack 1, Temp2: 14.8 ℃
Pack 1, Temp3: 14.6 ℃
Pack 1, Temp4: 15.1 ℃
Pack 1, Temp5: 16.4 ℃
Pack 1, Temp6: 23.6 ℃
Pack 1, I Pack: 0.0 A
Pack 1, V Pack: 53.249 V
Pack 1, I Remaining Capacity: 308000 mAh
Pack 1, I Full Capacity: 308000 mAh
Pack 1, SOC: 100.0 %
Pack 1, Cycles: 5
Pack 1, Design Capacity: 280000 mAh
Pack 1, SOH: 110.0 %
Error parsing BMS analog data: Cannot read multiple packs
Error retrieving BMS analog data: Error parsing BMS analog data: Cannot read multiple packs

Am I doing something wrong, is this possibly a limitation of the BMS or a problem in bms.py?

Thank you for your help
Andre

Cannot get data out of BMS most of the time

While the original Pace BMS Tool works fine to read all data under windows. I don't get data with bmspace or most of the time. Sometimes it works for a single command.

To speed up testing i removed the mqtt part and added just two debug prints after outgoing data (binary data and length)

Example:

tarting up...
Loading config.yaml
Connection Type: Serial
Connecting to BMS...
trying to connect /dev/ttyUSB1
BMS serial connected
-> Outgoing Data:  b'~250146C10000FD9A\r'
0
b''

Working example for a single command - after trying 10-20 times:

Starting up...
Loading config.yaml
Connection Type: Serial
Connecting to BMS...
trying to connect /dev/ttyUSB1
BMS serial connected
-> Outgoing Data:  b'~250146C10000FD9A\r'
58
b'~25014600602850313653323030412D32313338322D322E303200F585\r'
<- Incoming data:  b'~25014600602850313653323030412D32313338322D322E303200F585\r'
SOI:  0x7e
VER:  b'25'
ADR:  b'01'
CID1 (Type):  b'46'
RTN:  b'00'
LENGTH:  b'6028'
 - LCHKSUM:  54
 - LENID:  b'028'
 - LENID (int):  40
INFO:  b'50313653323030412D32313338322D322E303200'
CHKSUM:  b'F585'
Calc CHKSUM:  F585
BMS Version: P16S200A-21382-2.02
-> Outgoing Data:  b'~250146C20000FD99\r'
0
b''

Compatible with Youthpower pack

Hello, this message is to inform you that your code works with batteries:
YouthPower Rack Module 48V 100AH 4U-5U Lifepo4 Solar Storage Battery

Do you think it is possible to interrogate a 2nd battery connected to the 1st via your code?

No config file found (docker container)

hello and thank you for your work. I have successfully setup bmspace under HomeAssistant but i prefer to build a Docker container.
I have edited the config.yaml but the created container do not find any config file: 'No config file found'
What can i do?
Thanks in advance

Connection to Pace BMS via Elfin Tcp-rs232

I own a Jakiper Model Jk48V100 Pro Battery Pack that is running a Pace BMS. Can access the BMS via the RS232 Port using PBMStools displaying all data, without issue. This uses a serial rs232 to usb cable connection. Have installed the Home assistant BMSpace software without issue. Trying to connect to the BMS via tcp through an Elfin-EE10A TCP-RS232 convertor. Checked all wiring very carefully, so do not believe this is an issue. Have used these elfin devices previously without issue and seem to work very well.
Also, somewhat confused as to what bms_port number, bms_serial interface should be used (if at all) given that it a tcp connection.

Output error from Home Assistant ...

(Level 2 Debug)

Hello BMS Pace
Starting up...
Loading options.json
Config: {"mqtt_host": "192.168.100.86", "mqtt_port": 1883, "mqtt_user": "mqtt", "mqtt_password": "mqtt", "mqtt_ha_discovery": true, "mqtt_ha_discovery_topic": "homeassistant", "mqtt_base_topic": "bmspace", "connection_type": "IP", "bms_ip": "192.168.100.120", "bms_port": 5000, "bms_serial": "/dev/ttyUSB0", "scan_interval": 5, "debug_output": 2}
Connection Type: IP
MQTT connected with result code 0
Connecting to BMS...
trying to connect 192.168.100.120:5000
BMS socket error connecting: [Errno 111] Connection refused
BMS socket error: 'bool' object has no attribute 'send'
Error, connection to BMS lost
Error retrieving BMS version number
BMS socket error: 'bool' object has no attribute 'send'
Error, connection to BMS lost
Error: Error, connection to BMS lost
Traceback (most recent call last):
File "/workdir/./bms.py", line 1097, in
pack_sn.replace(" ", "")
AttributeError: 'bool' object has no attribute 'replace'
Script exiting

(Level 3 Debug)

Hello BMS Pace
Starting up...
Loading options.json
Config: {"mqtt_host": "192.168.100.86", "mqtt_port": 1883, "mqtt_user": "mqtt", "mqtt_password": "mqtt", "mqtt_ha_discovery": true, "mqtt_ha_discovery_topic": "homeassistant", "mqtt_base_topic": "bmspace", "connection_type": "IP", "bms_ip": "192.168.100.120", "bms_port": 5000, "bms_serial": "/dev/ttyUSB0", "scan_interval": 5, "debug_output": 3}
Connection Type: IP
MQTT connected with result code 0
Connecting to BMS...
trying to connect 192.168.100.120:5000
BMS socket error connecting: [Errno 111] Connection refused
-> Outgoing Data: b'~250146C10000FD9A\r'
BMS socket error: 'bool' object has no attribute 'send'
Error, connection to BMS lost
Error retrieving BMS version number
Traceback (most recent call last):
File "/workdir/./bms.py", line 1097, in
-> Outgoing Data: b'~250146C20000FD99\r'
BMS socket error: 'bool' object has no attribute 'send'
Error, connection to BMS lost
Error: Error, connection to BMS lost
pack_sn.replace(" ", "")
AttributeError: 'bool' object has no attribute 'replace'
Script exiting
Any suggestions would be greatly appreciated ...

Every few days script stops with errors

Hi,

Today with fully charged battery I got the following script error.
@Tertiush maybe you can check what this could be?

Pack 10, balancing1: 00000000
Pack 10, balancing2: 00000000
Publishing HA Discovery topic...
Error parsing BMS analog data: invalid literal for int() with base 16: b''
Error retrieving BMS analog data: Error parsing BMS analog data: invalid literal for int() with base 16: b''
Error parsing BMS analog data: invalid literal for int() with base 16: b''
Error retrieving BMS analog data: Error parsing BMS analog data: invalid literal for int() with base 16: b''
Error parsing BMS analog data: invalid literal for int() with base 16: b''
Error retrieving BMS analog data: Error parsing BMS analog data: invalid literal for int() with base 16: b''

and so on. After restarting it works again (every few days this problem occurs).

After restart:

Pack Remaining Capacity: 279430 mAh
Pack Full Capacity: 279430 mAh
Pack Design Capacity: 280000 mAh
Pack SOC: 100.0 %
Pack SOH: 99.8 %
Packs for warnings: 10
Pack 1, warnings: Protection State 2: Fully
Pack 1, balancing1: 00000000
Pack 1, balancing2: 00000000
Pack 2, warnings: Protection State 2: Fully
Pack 2, balancing1: 11111011
Pack 2, balancing2: 11111110
Pack 3, warnings: Protection State 2: Fully
Pack 3, balancing1: 00000000
Pack 3, balancing2: 00000000
Pack 4, warnings: Protection State 2: Fully
Pack 4, balancing1: 00000000
Pack 4, balancing2: 00000000
Pack 5, warnings: Protection State 2: Fully
Pack 5, balancing1: 00000000
Pack 5, balancing2: 00000000
Pack 6, warnings: Protection State 2: Fully
Pack 6, balancing1: 00000000
Pack 6, balancing2: 00000000
Pack 7, warnings: Protection State 2: Fully
Pack 7, balancing1: 00000000
Pack 7, balancing2: 00000000
Pack 8, warnings: Protection State 2: Fully
Pack 8, balancing1: 00000000
Pack 8, balancing2: 00000000
Pack 9, warnings: Protection State 2: Fully
Pack 9, balancing1: 00000000
Pack 9, balancing2: 00000000
Pack 10, warnings: Protection State 2: Fully
Pack 10, balancing1: 00000000
Pack 10, balancing2: 00000000
Publishing HA Discovery topic...

Thank you.

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.