JK-BMS RS485 Home Assistant Addon

Hello, thank you very much for such a great addon. Would it be possible to add the update interval into global settings?
I’d like to plot the graphs for Cell voltages. But values are updated every 1-2 sec. In case they are included into the recorder, HA database becomes large in short term.

1 Like

Just to be sure about the question.
Are you talking about the two-way synchronization module with the cloud?
If so, I will look into implementing this possibility.

How much could the interval vary? actually the setup is 5 second.
I will add a field in the module configuration.

Not a cloud. It impacts HA database size and CPU load (as it needs to frequently write a lot of data to SD card).
See some examples attached. I added few entities to recorder


updates are approximately every 2-4s. Sometimes it’s helpful. But not when I want to store all this data. Also system becomes very unresponsive if all Cell values are included into Recorder. I had CPU load up to 50% on RPI5.

I will add a field in the module configuration.
This will be super helpfull.
Timeout of 60s (even up to 5min) between readouts should be completely fine to create precise graphs for Cell Voltages.

After restart HA didn’t work what I expect 6 BMS in parallel.
Master ADDR is 00000, the rest slaves 1…5.
On PC with Jk-monitor work perfectly.
Connection is via RS485 - USB.
Last JK-BMS not have same entities like others.
configuration is:
jkbms_path: /dev/ttyUSB0
jkbms_count: 5
use_gateway: false
gateway_ip_port: 192.168.1.52:5000
communication_debug: true
bms_broadcasting: true
CAN_bus_usage: false
mqttadresse_port: core-mosquitto.local.hass.io:1883
mqttuser: serghei
mqttpass: xxxxxxx.

I tried also with jkbms_count: 6 7 and 8.

Can someone help with indentify problem? thx


1 Dec 13:20:31 - [info] [function:traitement des variables] Variable globale ‘use_gateway’ = false
1 Dec 13:20:31 - [info] [function:traitement des variables] Variable globale ‘gateway_ip’ = 192.168.1.52
1 Dec 13:20:31 - [info] [function:traitement des variables] Variable globale ‘gateway_port’ = 5000
1 Dec 13:20:31 - [info] [function:traitement des variables] Variable globale ‘communication_debug’ = true
1 Dec 13:20:31 - [info] [function:traitement des variables] Variable globale ‘bms_broadcasting’ = true
1 Dec 13:20:31 - [info] [function:traitement des variables] Variable globale ‘CAN_bus_usage’ = false
1 Dec 13:20:31 - [info] [function:traitement des variables] Variable globale ‘mqttadresse’ = core-mosquitto.local.hass.io
1 Dec 13:20:31 - [info] [function:traitement des variables] Variable globale ‘mqttport’ = 1883
1 Dec 13:20:31 - [info] [function:traitement des variables] Variable globale ‘mqttuser’ = serghei
1 Dec 13:20:31 - [info] [function:traitement des variables] Variable globale ‘mqttpass’ = •••••••••
1 Dec 13:20:31 - [info] serial port /dev/JKBMS-Fake closed
1 Dec 13:20:31 - [info] [serialconfig:6e1abcbcc6ebb714] serial port /dev/ttyUSB0 opened at 115800 baud 8N1
1 Dec 13:20:31 - [info] [debug:port used] /dev/ttyUSB0
1 Dec 13:20:31 - [info] [debug:host used] undefined
1 Dec 13:20:31 - [info] [debug:JK-BMS response: ]
<Buffer 55 aa eb 90 02 00 a3 0c a3 0c a5 0c a5 0c a5 0c a6 0c a5 0c a3 0c a5 0c a5 0c a5 0c a5 0c a5 0c a6 0c a5 0c a5 0c 00 00 00 00 00 00 00 00 00 00 00 00 … 14 more bytes>
1 Dec 13:20:31 - [error] [buffer-parser:Trame 3] RangeError [ERR_OUT_OF_RANGE]: The value of “offset” is out of range. It must be >= 0 and <= 62. Received 80

Do i need to change parameter in JK bms?
It looks like everything is installed but i don’t get any entities. It’s online in mqtt explorer.

3 Dec 12:27:13 - [info] Starting flows
3 Dec 12:27:13 - [info] Started flows
3 Dec 12:27:13 - [error] [serialconfig:6e1abcbcc6ebb714] serial port /dev/JKBMS-Fake error: Error: Error: No such file or directory, cannot open /dev/JKBMS-Fake
3 Dec 12:27:13 - [info] [mqtt-broker:56f7b2737cce493b] Connection failed to broker: mqtt://core-mosquitto.local.hass.io:1883
3 Dec 12:27:13 - [warn] [function:Init flags for discovery] Discovery reset done for Master + 1 BMS (incl. alarms).
3 Dec 12:27:14 - [info] [function:traitement des variables] Champ 'gateway_ip_port' traité: 192.168.1.100:5000
3 Dec 12:27:14 - [info] [function:traitement des variables] Champ 'mqttadresse_port' traité: 192.168.178.50:1883
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'path' = /dev/ttyUSB0
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'nb_jkbms' = 1
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'use_gateway' = false
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'gateway_ip' = 192.168.1.100
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'gateway_port' = 5000
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'communication_debug' = true
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'bms_broadcasting' = true
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'CAN_bus_usage' = false
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'mqttadresse' = 192.168.178.50
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'mqttport' = 1883
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'mqttuser' = Mqtt
3 Dec 12:27:14 - [info] [function:traitement des variables] Variable globale 'mqttpass' = •••••••••
3 Dec 12:27:15 - [info] serial port /dev/JKBMS-Fake closed
3 Dec 12:27:15 - [info] [serialconfig:6e1abcbcc6ebb714] serial port /dev/ttyUSB0 opened at 115800 baud 8N1
3 Dec 12:27:18 - [info] [mqtt-broker:56f7b2737cce493b] Connected to broker: mqtt://192.168.178.50:1883

I’m using a raspberry pi to connect to a 2 JK-BMS’es on 1 bus. My HA runs on my server. How can I only run this script and publish this to MQTT? So not run it as home assistant addon.