syssi / esphome-jk-bms

ESPHome component to monitor and control a Jikong Battery Management System (JK-BMS) via UART-TTL or BLE
Apache License 2.0
405 stars 134 forks source link

Add Modbus support of the new range of JK BMS called JK-PB #409

Closed syssi closed 2 months ago

syssi commented 5 months ago

See #390

txubelaxu commented 4 months ago

See https://github.com/syssi/esphome-jk-bms/pull/464

brycelarge commented 4 months ago

Is there a wiring diagram I could use to test with?

txubelaxu commented 4 months ago

Is there a wiring diagram I could use to test with?

https://github.com/syssi/esphome-jk-bms/issues/463#issuecomment-1973320806

andersonray commented 2 months ago

Thanks for the hard work adding this support! :) I have the JK-PB2A16S20P

Is this the config I should use if I only have one JK-PB BMS? I see #464 for multiple

I don't see a talk pin defined in this config. This is still meant to use RS485 and connect to one of the battery comm ports? Can I use this style of RS485 to UART converter that doesn't need direction control? image

txubelaxu commented 2 months ago

Well, I have not tested that kind of UART to RS485 converters. Anyway,

The "talk_pin" is used to ask for "board info" (frame type 3rd) to slaves acting as pseudo master. It has been impossible for me get that information from master (because it has 0x00 address and you cannot ask to that address in RS485 network from "another" master)

If you set the BMS with another address and you connect TX pin as well, in theory, the ESP should act as MASTER because in listening mode (the first mode that uses) it does not detect any master in the network. This way, ESP gets all the info (frame types: 1, 2 and 3) from that slave. Of course, I do not know what happens in the communication upstream (using CAN bus towards inverter...) You can test it

Good Luck!!!

meccip commented 2 months ago

I just test it esp-jk-bms.yaml (for BxAXXSXXP bms) and is working on JKPB serries, connected on RS485port for inverter and select UART1 for 4G-GPS protocol (000)

@andersonray i use that board.

andersonray commented 2 months ago

I just test it esp-jk-bms.yaml (for BxAXXSXXP bms) and is working on JKPB serries, connected on RS485port for inverter and select UART1 for 4G-GPS protocol (000)

@andersonray i use that board.

@meccip Thanks for that info! I will definitely try that out. I did get the new battery bus listener config to work, but it does miss a few minor values. My inverter uses CAN, so the 485 inverter port is a good option.

meccip commented 2 months ago

i have 2 JKPB, master and slave. On master(all dipswitch to 0) is working jk-bms.yaml (UART1protocol GPS 000) and jk-modbus (UART1protocol jkmodbus 001), but on slave is working only jk-bms.yaml (UART1protocol GPS 000). If i use jkmodbus protocol is having conflicts with RS485-1 network and bms loose connection as slave. On CAN i use comm with Deye inverter.