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
403 stars 134 forks source link

Add JK-PB bms compatibility. Target: 1 ESP in a "listening mode" connected to RS485 network. #464

Open txubelaxu opened 4 months ago

txubelaxu commented 4 months ago

JK-PB2A16S-20P model jk-bms. Two bms connected to that RS485 internal network. ubuntu connected in a "listening mode" using a USB<->RS485 adaptor.

txubelaxu commented 4 months ago

I have created a new component: "jk_rs485". It is for JK-PB HW v14. This is a sniffing way to gather information across the RS485 network. The goal to achieve is to gathering information about every jk-bms using only one ESP. This way, Bluetooth remains free.

To compile: esphome compile esp32-example-rs485.yaml

Pending:

syssi commented 4 months ago

I will have a look as soon as possible. Please give me some time! :-)

txubelaxu commented 4 months ago

Sorry!! I am very newbie at github. 👏👏😉

syssi commented 4 months ago

No problem. Feel free to ask any questions.

txubelaxu commented 4 months ago

No problem. Feel free to ask any questions.

Many thanks, Sebastian. Certainly, I do not know how to manage/arrange the "code + configuration.yaml" to demultiplex the info arraiving from RS485. So, I have got the info about every BMS connected to the RS485 network (it does not matter how many are: max 16). I know how to pass the UART information to the jk_rs485 component (but only one). But I have achieve the goal of sharing the same UART with two jk_rs485 components. I would like to: 1) remake the configuration.yaml structure in order to place inside that file each jk_rs485 node: each one with a identifyer and an address. 2) "publish_state" info and settings, but signaling the identifyer (not address) of the jk_rs485 node.

I do not know if this is possible.

Many thanks!!

brycelarge commented 3 months ago

any chance you could put a wiring diagram together so I can test with my 3 new JK BMS?

txubelaxu commented 3 months ago

any chance you could put a wiring diagram together so I can test with my 3 new JK BMS?

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

brycelarge commented 3 months ago

any chance you could put a wiring diagram together so I can test with my 3 new JK BMS?

#463 (comment)

Which Ethernet wires go to tx and rx on the ESP board?

txubelaxu commented 3 months ago

any chance you could put a wiring diagram together so I can test with my 3 new JK BMS?

#463 (comment)

Which Ethernet wires go to tx and rx on the ESP board?

image

txubelaxu commented 3 months ago

it is not ethernet. It is RS485, ok? You need a USB to RS485 adaptor.

brycelarge commented 3 months ago

it is not ethernet. It is RS485, ok? You need a USB to RS485 adaptor.

USB plugs into the ESP32 dev board and RJ45 into the RS485 port in the inverter?

txubelaxu commented 3 months ago

Sorry my mistake. Forget my previous answer.

ESP TXRX to a serial2RS485 converter. From this converter to the right (any of the two) existing RJ45 connectors.

denveronly commented 3 months ago

Can you point to a code that should be loaded to ESPHome please? Is it working already? Master and Slave Sniff? I have 1 Master and 6 Slaves right now lol.

txubelaxu commented 3 months ago

I am trying to develope a solution. At this moment, half working code is at my github

denveronly commented 3 months ago

I am trying to develope a solution. At this moment, half working code is at my github

What is working at this moment and what is not

txubelaxu commented 3 months ago

Updated. @denveronly, could you test this? https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md

denveronly commented 3 months ago

Updated. @denveronly, could you test this? https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md

With pleasure. I will start preparing the ESP for that and write back in 24-48hrs Need the converter

brycelarge commented 3 months ago

Updated. @denveronly, could you test this? https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md

Thanks for the hard work here. Quick question, is there a reason why you have all the grounds connected together in your wiring diagrams?

brycelarge commented 3 months ago

If we have 1 master and 2 slaves what would the rs485_address be on the second slave? esp32-example-jkpb-rs485.yaml shows master at rs485_address: 0x00 and first slave at rs485_address: 0x07

txubelaxu commented 3 months ago

Master always must be 0x00. 1 master is mandatory. If no master, no data.

Slaves: any address from 0x01 to 0x0f Each slave one different address.

El El mar, 12 mar 2024 a las 9:34, Bryce Large @.***> escribió:

If we have 1 master and 2 slaves what would the rs485_address be on the second slave? esp32-example-jkpb-rs485.yaml shows master at rs485_address: 0x00 and first slave at rs485_address: 0x07

— Reply to this email directly, view it on GitHub https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-1991038248, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMDAWOAJDKSN7IZMXDLYX242JAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJRGAZTQMRUHA . You are receiving this because you modified the open/close state.Message ID: @.***>

txubelaxu commented 3 months ago

Updated. @denveronly, could you test this? https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md

Thanks for the hard work here. Quick question, is there a reason why you have all the grounds connected together in your wiring diagrams?

In the converter I have used, 1) the converter needs +5Vcc and GND 2) the RS485 bus needs: A, B and GND "GND" point in this device is the same for 1) and for 2)

Maybe there is in the market a device to "isolate" two circuits (optocoupled). I do not know.

brycelarge commented 3 months ago

Updated. @denveronly, could you test this? https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md

Thanks for the hard work here. Quick question, is there a reason why you have all the grounds connected together in your wiring diagrams?

In the converter I have used,

1. the converter needs +5Vcc and GND

2. the RS485 bus needs: A, B and GND
   "GND" point in this device is the same for 1) and for 2)

Maybe there is in the market a device to "isolate" two circuits (optocoupled). I do not know.

Thanks just wanted to try understand.

I got everything working just the temp sensors not working

txubelaxu commented 3 months ago

Updated. @denveronly, could you test this? https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md

Thanks for the hard work here. Quick question, is there a reason why you have all the grounds connected together in your wiring diagrams?

In the converter I have used,

1. the converter needs +5Vcc and GND

2. the RS485 bus needs: A, B and GND
   "GND" point in this device is the same for 1) and for 2)

Maybe there is in the market a device to "isolate" two circuits (optocoupled). I do not know.

Thanks just wanted to try understand.

I got everything working just the temp sensors not working

None of temp sensors? temp0 and temp1 are not working?

brycelarge commented 3 months ago

Updated. @denveronly, could you test this? https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md

Thanks for the hard work here. Quick question, is there a reason why you have all the grounds connected together in your wiring diagrams?

In the converter I have used,

1. the converter needs +5Vcc and GND

2. the RS485 bus needs: A, B and GND
   "GND" point in this device is the same for 1) and for 2)

Maybe there is in the market a device to "isolate" two circuits (optocoupled). I do not know.

Thanks just wanted to try understand. I got everything working just the temp sensors not working

None of temp sensors? temp0 and temp1 are not working?

Yes temp 1 and 2 are not working.

txubelaxu commented 3 months ago

I have to review that. I have not changed that code but I see it was there before.

How many BMS have you connected using RS485 network? 3 (1 master and 2 slaves?

El mar, 12 mar 2024 a las 12:34, Bryce Large @.***>) escribió:

Updated. @denveronly https://github.com/denveronly, could you test this? https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md

Thanks for the hard work here. Quick question, is there a reason why you have all the grounds connected together in your wiring diagrams?

In the converter I have used,

  1. the converter needs +5Vcc and GND

  2. the RS485 bus needs: A, B and GND "GND" point in this device is the same for 1) and for 2)

Maybe there is in the market a device to "isolate" two circuits (optocoupled). I do not know.

Thanks just wanted to try understand. I got everything working just the temp sensors not working

None of temp sensors? temp0 and temp1 are not working?

Yes temp 1 and 2 are not working.

— Reply to this email directly, view it on GitHub https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-1991446647, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMDHCFFP25NCJVOW4W3YX3R3LAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJRGQ2DMNRUG4 . You are receiving this because you modified the open/close state.Message ID: @.***>

brycelarge commented 3 months ago

I have to review that. I have not changed that code but I see it was there before. How many BMS have you connected using RS485 network? 3 (1 master and 2 slaves? El mar, 12 mar 2024 a las 12:34, Bryce Large @.>) escribió: Updated. @denveronly https://github.com/denveronly, could you test this? https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md Thanks for the hard work here. Quick question, is there a reason why you have all the grounds connected together in your wiring diagrams? In the converter I have used, 1. the converter needs +5Vcc and GND 2. the RS485 bus needs: A, B and GND "GND" point in this device is the same for 1) and for 2) Maybe there is in the market a device to "isolate" two circuits (optocoupled). I do not know. Thanks just wanted to try understand. I got everything working just the temp sensors not working None of temp sensors? temp0 and temp1 are not working? Yes temp 1 and 2 are not working. — Reply to this email directly, view it on GitHub <#464 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMDHCFFP25NCJVOW4W3YX3R3LAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJRGQ2DMNRUG4 . You are receiving this because you modified the open/close state.Message ID: @.>

Yes 1 master and 2 slaves. MOS temp is working just not temp 1 and 2

txubelaxu commented 3 months ago

Maybe it is because is an array of temperatures, and MOS temp is a parameter independent. I will review that.

El mar, 12 mar 2024 a las 12:40, Bryce Large @.***>) escribió:

I have to review that. I have not changed that code but I see it was there before. How many BMS have you connected using RS485 network? 3 (1 master and 2 slaves? El mar, 12 mar 2024 a las 12:34, Bryce Large @.

>) escribió: … <#m323099578995665119> Updated. @denveronly https://github.com/denveronly https://github.com/denveronly https://github.com/denveronly, could you test this? https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md Thanks for the hard work here. Quick question, is there a reason why you have all the grounds connected together in your wiring diagrams? In the converter I have used, 1. the converter needs +5Vcc and GND 2. the RS485 bus needs: A, B and GND "GND" point in this device is the same for 1) and for 2) Maybe there is in the market a device to "isolate" two circuits (optocoupled). I do not know. Thanks just wanted to try understand. I got everything working just the temp sensors not working None of temp sensors? temp0 and temp1 are not working? Yes temp 1 and 2 are not working. — Reply to this email directly, view it on GitHub <#464 (comment) https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-1991446647>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMDHCFFP25NCJVOW4W3YX3R3LAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJRGQ2DMNRUG4 https://github.com/notifications/unsubscribe-auth/BFHIJMDHCFFP25NCJVOW4W3YX3R3LAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJRGQ2DMNRUG4 . You are receiving this because you modified the open/close state.Message ID: @.>

Yes 1 master and 2 slaves. MOS temp is working just not temp 1 and 2

— Reply to this email directly, view it on GitHub https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-1991456539, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMAAUNGG4O5YBTTZUX3YX3SSVAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJRGQ2TMNJTHE . You are receiving this because you modified the open/close state.Message ID: @.***>

txubelaxu commented 3 months ago

I have to review that. I have not changed that code but I see it was there before. How many BMS have you connected using RS485 network? 3 (1 master and 2 slaves? El mar, 12 mar 2024 a las 12:34, Bryce Large @._>) escribió: Updated. @denveronly https://github.com/denveronly, could you test this? https://github.com/txubelaxu/esphome-jk-bms/blob/main/components/jk_rs485_bms/README.md Thanks for the hard work here. Quick question, is there a reason why you have all the grounds connected together in your wiring diagrams? In the converter I have used, 1. the converter needs +5Vcc and GND 2. the RS485 bus needs: A, B and GND "GND" point in this device is the same for 1) and for 2) Maybe there is in the market a device to "isolate" two circuits (optocoupled). I do not know. Thanks just wanted to try understand. I got everything working just the temp sensors not working None of temp sensors? temp0 and temp1 are not working? Yes temp 1 and 2 are not working. — Reply to this email directly, view it on GitHub <#464 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMDHCFFP25NCJVOW4W3YX3R3LAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJRGQ2DMNRUG4 . You are receiving this because you modified the open/close state.Message ID: _@_._>

Yes 1 master and 2 slaves. MOS temp is working just not temp 1 and 2

added: jk-rs485-bms/sensor/bms0_temperature_sensor_1/state 19.4 jk-rs485-bms/sensor/bms0_temperature_sensor_2/state 20.1 jk-rs485-bms/sensor/bms0_temperature_sensor_4/state 19.4 jk-rs485-bms/sensor/bms0_temperature_sensor_3/state 20.2

jk-rs485-bms/sensor/bms1_temperature_sensor_1/state 18.7 jk-rs485-bms/sensor/bms1_temperature_sensor_2/state 19.4 jk-rs485-bms/sensor/bms1_temperature_sensor_4/state 18.7 jk-rs485-bms/sensor/bms1_temperature_sensor_3/state 18.8

denveronly commented 3 months ago

Ive made a test board as soon as the converter arrived. All went smooth, but one thing. All that my ESP is giving is BMS0 info. (i have 1 Master and 6 Slaves) The code has bms0 and bms1, i didnt implement those 5 more it is not important i guess.

Dip switches are correct (BMS's Bluetooth name changes to DIP switch number set)

Do you have an idea why i am not receiving other BMS's?

_[19:39:22][W][component:214]: Component jk_rs485sniffer took a long time for an operation (1.16 s). [19:39:22][W][component:215]: Components should block for at most 20-30ms.

Maybe my RS485 bus info is very large due to number of devices, and it doesnt complete the handshake crashing the sniffer component idk.

Logs with UART and LOGGER in DEBUG MODE here: https://pastebin.com/NS376nhZ

txubelaxu commented 3 months ago

yaml code needs all bms references.

Send me your yaml and I could modify if you want. Tell me each bms address as well.

El El mié, 13 mar 2024 a las 18:42, denveronly @.***> escribió:

Ive made a test board as soon as the converter arrived. All went smooth, but one thing. All that my ESP is giving is BMS0 info. (i have 1 Master and 6 Slaves) The code has bms0 and bms1, i didnt implement those 5 more it is not important i guess.

Dip switches are correct (BMS's Bluetooth name changes to DIP switch number set)

Do you have an idea why i am not receiving other BMS's?

— Reply to this email directly, view it on GitHub https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-1995140980, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMDIT6LD5K3QBHFLXVLYYCF2DAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJVGE2DAOJYGA . You are receiving this because you modified the open/close state.Message ID: @.***>

denveronly commented 3 months ago

yaml code needs all bms references. Send me your yaml and I could modify if you want. Tell me each bms address as well. El El mié, 13 mar 2024 a las 18:42, denveronly @.> escribió: Ive made a test board as soon as the converter arrived. All went smooth, but one thing. All that my ESP is giving is BMS0 info. (i have 1 Master and 6 Slaves) The code has bms0 and bms1, i didnt implement those 5 more it is not important i guess. Dip switches are correct (BMS's Bluetooth name changes to DIP switch number set) Do you have an idea why i am not receiving other BMS's? — Reply to this email directly, view it on GitHub <#464 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMDIT6LD5K3QBHFLXVLYYCF2DAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJVGE2DAOJYGA . You are receiving this because you modified the open/close state.Message ID: @.>

Here is is Friend, https://pastebin.com/cP5TRgUL

Thank you for helping, i didn't find this action in documentation to work the issue out.

Master is 0. 1,2,3,4,5,6 are SLAVES

txubelaxu commented 3 months ago

yaml code needs all bms references. Send me your yaml and I could modify if you want. Tell me each bms address as well. El El mié, 13 mar 2024 a las 18:42, denveronly @.**> escribió: Ive made a test board as soon as the converter arrived. All went smooth, but one thing. All that my ESP is giving is BMS0 info. (i have 1 Master and 6 Slaves) The code has bms0 and bms1, i didnt implement those 5 more it is not important i guess. Dip switches are correct (BMS's Bluetooth name changes to DIP switch number set) Do you have an idea why i am not receiving other BMS's? — Reply to this email directly, view it on GitHub <#464 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMDIT6LD5K3QBHFLXVLYYCF2DAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJVGE2DAOJYGA . You are receiving this because you modified the open/close state.Message ID: @.**>

Here is is Friend, https://pastebin.com/cP5TRgUL

Thank you for helping, i didn't find this action in documentation to work the issue out.

Master is 0. 1,2,3,4,5,6 are SLAVES

Added example with your config. Edit that file with your private info.

;-)

denveronly commented 3 months ago

yaml code needs all bms references. Send me your yaml and I could modify if you want. Tell me each bms address as well. El El mié, 13 mar 2024 a las 18:42, denveronly @.**> escribió: Ive made a test board as soon as the converter arrived. All went smooth, but one thing. All that my ESP is giving is BMS0 info. (i have 1 Master and 6 Slaves) The code has bms0 and bms1, i didnt implement those 5 more it is not important i guess. Dip switches are correct (BMS's Bluetooth name changes to DIP switch number set) Do you have an idea why i am not receiving other BMS's? — Reply to this email directly, view it on GitHub <#464 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMDIT6LD5K3QBHFLXVLYYCF2DAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJVGE2DAOJYGA . You are receiving this because you modified the open/close state.Message ID: @.**>

Here is is Friend, https://pastebin.com/cP5TRgUL Thank you for helping, i didn't find this action in documentation to work the issue out. Master is 0. 1,2,3,4,5,6 are SLAVES

Added example with your config. Edit that file with your private info.

;-)

Im super happy, thanks.

I see now BMS0, BMS1, BMS2 and thats all. I have a feeling about sniffer component. because in LOGS

Trying to change sniffer timeout from 500ms, to 1500ms and to 7000ms ,and tried rx buffer change, seem to make no effect. I could receive readings from BMS3 (4th one) for a short period of time but its data is updating way to slow (like 3-5min)

Maybe i should wire another UART converter and make a sniffer2 component in code?

UPD:! I powered the converter by using 3.3V, as shown in readme picture. Changed that to 5Volts, the LED shines brighter now and i see BMS0 1,2,3 -5-6. but for a few readings of time and then nothing Maybe that is a big buffer from such number of BMS's idk.

Here are my testings Friend

denveronly commented 3 months ago

BTW, what do you think of this board for your project? https://github.com/Xinyuan-LilyGO/T-CAN485

I have it laying around from previous project that i was unable to comply due to CAN issues here and not the best specifications of the board (and obviously my knowledge) For RS-485 it can be pretty clean install without soldering i think.

txubelaxu commented 3 months ago

logs seems OK. I suppose that slaves address (dip switches) are ok. Sure? I suppose all JK-PB have same firmware version. Last one? I cannot test here with 7 BMS. lol You have more BMS than Andy and more power than a nuclear plant. :-D Are correctly connected between 2 and 3? You can test without slave1 and slave2 in the network. Tell me your results!!

The device looks good. But I have many converters bought for another failed project. :-))

Many many thanks!!!

El El mié, 13 mar 2024 a las 22:37, denveronly @.***> escribió:

BTW, what do you think of this board for your project? https://github.com/Xinyuan-LilyGO/T-CAN485

I have it laying around from previous project that i was unable to comply due to CAN issues here and not the best specifications of the board (and obviously my knowledge) For RS-485 it can be pretty clean install without wiring i think.

— Reply to this email directly, view it on GitHub https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-1995907771, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMDK6T4BARLSC6UGKCDYYDBI3AVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJVHEYDONZXGE . You are receiving this because you modified the open/close state.Message ID: @.***>

denveronly commented 3 months ago

I had a good deal on salvaged Tesla battery with LFP Catl modules. It took me like 70$ a kwt, so that was how it was born a 63kwt bank lol. The only downside was cutting it to series needed (pretty close cutting not to hurt cells). Previously i used VW ID4 cells with LG NMC but dumped it due to fear of any safety concern. The install is fresh and has excess wiring on photo it is in debug mode. image

Dip switches should be fine. My BMS its bluetooth changed names from 0 to 6 and i can reach them using JK Windows App by adress.

Wanted to ask. We are specifying Uart tx and rx in the code, but connecting only RX as in diagram. Is this okay?

image image

One thing i saw is when i connect the esp board converter to the JK internal comm bus it ruins JK comm between BMS. In invertet values charge discharge amps drop down to single BMS, when unplugged it recovers. Damn, i will try another esp and another converter. Maybe a fault decoder or esp.

denveronly commented 3 months ago

Btw i have 4 BMS version 14 hardware and (software latest version) And 2 BMS hardware version 15 (latest version soft) Thats what market had for me to sell.

FIXED.

The solution was faulty RS-TTL converter. When connected to RS port and just powered with no ESP comm, it shut down the JK Comm bus, so the inverter only saw 1 BMS, well the ESP also saw 1 BMS and some torn data from others to appear for half a second.

I used another RS-TTL, wired the same way and BANG! - all BMS's Working great, all data is present, refresh rate 5sec So absurd reason lol. And if i had not another converter i would stick to the coding and wiring for who knows what time. Thanks for help.

txubelaxu commented 3 months ago

El jue, 14 mar 2024 a las 7:52, denveronly @.***>) escribió:

I had a good deal on salvaged Tesla battery with LFP Catl modules. It took me like 70$ a kwt, so that was how it was born a 63kwt bank lol. The only downside was cutting it to series needed. Previously used VW ID4 cells with Ternary lithium but dumped it due to fear of any safety concern. The install is fresh and has excess witing in debug mode. BF797991-447A-469E-844E-5601F806FB21.jpeg (view on web) https://github.com/syssi/esphome-jk-bms/assets/66441516/c3cb142d-aed2-4f7c-8ffc-d23e115e09b6

awesome instalation!

Dip switches should be fine. My BMS its bluetooth changed names from 0 to 6 and i can reach them using JK Windows App by adress.

Wanted to ask. We are specifying Uart tx and rx in the code, but connecting only RX as in diagram. Is this okay?

007E639A-34CE-41A1-A2FC-C4F41E4F8366.jpeg (view on web) https://github.com/syssi/esphome-jk-bms/assets/66441516/dd8f6812-02bd-4902-bc39-7a5fc79614ac

Our device is listening only. Nobody is going to ask to it, and it is not going to ask to the rs485 network. It is only sniffing traffic. So, TX is not needed. You can plug to esp if you want. But, I see in your picture that DE pin is not connected to GND. So this could be the problem. Maybe it is sending noise to the network. Other cause could be converter network impedance.

One thing i saw is when i connect the esp board converter to the JK

internal comm bus it ruins JK comm between BMS. In invertet values charge discharge amps drop down to single BMS, when unplugged it recovers.

Let's try to put DE to GND first, as in the scheme. It is clear that there is a network problem when you plug it in.

Damn, i will try another esp and another converter. Maybe a fault decoder or esp.

Btw i have 4 BMS version 14 hardware and (software latest version) And 2 BMS hardware version 15 (latest version soft) That what the marked had for me yo buy.

0,1,2 are 14 and 3,4,5,6 are 15? Have you tried to unplug 1 and 2? So: 0>3>4>5>6>converter We need to confirm that the code is working with hw.v15. I cannot test in my small battery. lol

Many thanks!!

— Reply to this email directly, view it on GitHub https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-1996655173, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMCBDY72J7NLW6Q7O5LYYFCJLAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJWGY2TKMJXGM . You are receiving this because you modified the open/close state.Message ID: @.***>

denveronly commented 3 months ago

El jue, 14 mar 2024 a las 7:52, denveronly @.***>)

escribió:

I had a good deal on salvaged Tesla battery with LFP Catl modules. It took

me like 70$ a kwt, so that was how it was born a 63kwt bank lol.

The only downside was cutting it to series needed.

Previously used VW ID4 cells with Ternary lithium but dumped it due to

fear of any safety concern. The install is fresh and has excess witing in

debug mode.

BF797991-447A-469E-844E-5601F806FB21.jpeg (view on web)

https://github.com/syssi/esphome-jk-bms/assets/66441516/c3cb142d-aed2-4f7c-8ffc-d23e115e09b6

awesome instalation!

Dip switches should be fine. My BMS its bluetooth changed names from 0 to

6 and i can reach them using JK Windows App by adress.

Wanted to ask. We are specifying Uart tx and rx in the code, but

connecting only RX as in diagram. Is this okay?

007E639A-34CE-41A1-A2FC-C4F41E4F8366.jpeg (view on web)

https://github.com/syssi/esphome-jk-bms/assets/66441516/dd8f6812-02bd-4902-bc39-7a5fc79614ac

Our device is listening only. Nobody is going to ask to it, and it is not

going to ask to the rs485 network. It is only sniffing traffic. So, TX is

not needed. You can plug to esp if you want. But, I see in your picture

that DE pin is not connected to GND. So this could be the problem. Maybe it

is sending noise to the network.

Other cause could be converter network impedance.

One thing i saw is when i connect the esp board converter to the JK

internal comm bus it ruins JK comm between BMS. In invertet values charge

discharge amps drop down to single BMS, when unplugged it recovers.

Let's try to put DE to GND first, as in the scheme. It is clear that there

is a network problem when you plug it in.

Damn, i will try another esp and another converter. Maybe a fault decoder

or esp.

Btw i have 4 BMS version 14 hardware and (software latest version)

And 2 BMS hardware version 15 (latest version soft)

That what the marked had for me yo buy.

0,1,2 are 14 and 3,4,5,6 are 15?

Have you tried to unplug 1 and 2? So: 0>3>4>5>6>converter

We need to confirm that the code is working with hw.v15. I cannot test in

my small battery. lol

Many thanks!!

Reply to this email directly, view it on GitHub

https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-1996655173,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/BFHIJMCBDY72J7NLW6Q7O5LYYFCJLAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJWGY2TKMJXGM

.

You are receiving this because you modified the open/close state.Message

ID: @.***>

It is working on hw15 with no issues I didnt need to connect DE to GND Wiring is as on my photo and works aboslutely fine Also RS cable is not connected to the ground of BMS port I will make a better scheme for others a bit later

txubelaxu commented 3 months ago

My advice is:

  1. Connect DE to GND. In other way the converter could be to start sending noise to the RS485 network. This is avoided 100% if DE is connected to GND.
  2. An RS485 bus needs 2 wires (A, B) + GND. So 3 wires in total as in this figure: One twisted wire pair (for long distances) plus Ground

[image: image.png] image source https://www.advantech.com/en/resources/white-papers/02cb2f4e-4fb2-4a87-be3b-508325bd61d6

El jue, 14 mar 2024 a las 9:58, denveronly @.***>) escribió:

El jue, 14 mar 2024 a las 7:52, denveronly @.***>)

escribió:

I had a good deal on salvaged Tesla battery with LFP Catl modules. It took

me like 70$ a kwt, so that was how it was born a 63kwt bank lol.

The only downside was cutting it to series needed.

Previously used VW ID4 cells with Ternary lithium but dumped it due to

fear of any safety concern. The install is fresh and has excess witing in

debug mode.

BF797991-447A-469E-844E-5601F806FB21.jpeg (view on web)

https://github.com/syssi/esphome-jk-bms/assets/66441516/c3cb142d-aed2-4f7c-8ffc-d23e115e09b6

awesome instalation!

Dip switches should be fine. My BMS its bluetooth changed names from 0 to

6 and i can reach them using JK Windows App by adress.

Wanted to ask. We are specifying Uart tx and rx in the code, but

connecting only RX as in diagram. Is this okay?

007E639A-34CE-41A1-A2FC-C4F41E4F8366.jpeg (view on web)

https://github.com/syssi/esphome-jk-bms/assets/66441516/dd8f6812-02bd-4902-bc39-7a5fc79614ac

Our device is listening only. Nobody is going to ask to it, and it is not

going to ask to the rs485 network. It is only sniffing traffic. So, TX is

not needed. You can plug to esp if you want. But, I see in your picture

that DE pin is not connected to GND. So this could be the problem. Maybe it

is sending noise to the network.

Other cause could be converter network impedance.

One thing i saw is when i connect the esp board converter to the JK

internal comm bus it ruins JK comm between BMS. In invertet values charge

discharge amps drop down to single BMS, when unplugged it recovers.

Let's try to put DE to GND first, as in the scheme. It is clear that there

is a network problem when you plug it in.

Damn, i will try another esp and another converter. Maybe a fault decoder

or esp.

Btw i have 4 BMS version 14 hardware and (software latest version)

And 2 BMS hardware version 15 (latest version soft)

That what the marked had for me yo buy.

0,1,2 are 14 and 3,4,5,6 are 15?

Have you tried to unplug 1 and 2? So: 0>3>4>5>6>converter

We need to confirm that the code is working with hw.v15. I cannot test in

my small battery. lol

Many thanks!!

Reply to this email directly, view it on GitHub

464 (comment)

https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-1996655173 ,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/BFHIJMCBDY72J7NLW6Q7O5LYYFCJLAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJWGY2TKMJXGM

.

You are receiving this because you modified the open/close state.Message

ID: @.***>

It is working on hw15 with no issues I didnt need to connect DE to GND Wiring is as on my photo and works aboslutely fine Also RS cable is not connected to the ground of BMS port I will make a better scheme for others a bit later

— Reply to this email directly, view it on GitHub https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-1996909486, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMCPWFAZBZ6UN5ZFG63YYFRERAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJWHEYDSNBYGY . You are receiving this because you modified the open/close state.Message ID: @.***>

denveronly commented 3 months ago

Here is a good noob illustration of connecting the components. Hope it will help lower communication questions. As i promised. MS Paint rocks! Wanted to say great thank you for your work. Everything is working flawless. image

P.S. As a long therm solution i 3d printed an ESPcase that i thought would suit me. https://www.thingiverse.com/thing:5041235/files I had an RJ-45 socket and soldered all together because the Dupont pins is an unhealthy setup. The Case is used for laying a relay board inside, so the RS converter and RJ socket went completely fine. It took a few minutes to drill a few holes but im very pleasant of my working setup for now. Thanks again.

image image

txubelaxu commented 3 months ago

Here is a good noob illustration of connecting the components. Hope it will help lower communication questions. As i promised. MS Paint rocks! Wanted to say great thank you for your work. Everything is working flawless. image

P.S. As a long therm solution i 3d printed an ESPcase that i thought would suit me. https://www.thingiverse.com/thing:5041235/files I had an RJ-45 socket and soldered all together because the Dupont pins is an unhealthy setup. The Case is used for laying a relay board inside, so the RS converter and RJ socket went completely fine. It took a few minutes to drill a few holes but im very pleasant of my working setup for now. Thanks again.

image image

Many thanks for your picture. I have just added it to the Readme.

I have just changed the code as well.

denveronly commented 3 months ago

I noticed that one of the BMS's is not reporting its Charge, Discharge and balance state (BMS #1), it sometimes falls off for a day and then replenishes as nothing happened. The issue is with one BMS only. Clicking Charge discharge switch doesnt help. Just some time.

The ESP code i used was provided by you, and i checked it also, no mistakes that could influence that.

image

image

txubelaxu commented 3 months ago

What a beautiful dashboard!!

Have you the last version of the code? Are you monitoring the binary_sensors (charging, discharging, balancing) and not the switch status?

I found in the frame info that there is a difference between : switch state and real state. For example: BALANCE switch state is different to real balance working status. The switch can be ON but the real status of the balancing is OFF(<>"not working") because of config conditions...

Remember that this code is "read only" so changing the status of the switch in the dashboard does not apply to the real status of that setting of the BMS. So, when new info arrives from the bms, the switch status changes to the previous one.

El El lun, 18 mar 2024 a las 10:44, denveronly @.***> escribió:

I noticed that one of the BMS's is not reporting its Charge, Discharge and balance state (BMS #1 https://github.com/syssi/esphome-jk-bms/issues/1), it sometimes falls off for a day and then replenishes as nothing happened. The issue is with one BMS only. Clicking Charge discharge switch doesnt help. Just some time.

The ESP code i used was provided by you, and i checked it also, no mistakes that could influence that.

image.png (view on web) https://github.com/syssi/esphome-jk-bms/assets/66441516/fdff2052-0066-43ed-a1df-5c7f6fa4f5cd

— Reply to this email directly, view it on GitHub https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-2003355503, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMCW7C43ACH6LVCODOLYY2ZPNAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBTGM2TKNJQGM . You are receiving this because you modified the open/close state.Message ID: @.***>

txubelaxu commented 3 months ago

Changed: added new params:

[image: image.png]

El lun, 18 mar 2024 a las 11:11, Txu Belaxu @.***>) escribió:

What a beautiful dashboard!!

Have you the last version of the code? Are you monitoring the binary_sensors (charging, discharging, balancing) and not the switch status?

I found in the frame info that there is a difference between : switch state and real state. For example: BALANCE switch state is different to real balance working status. The switch can be ON but the real status of the balancing is OFF(<>"not working") because of config conditions...

Remember that this code is "read only" so changing the status of the switch in the dashboard does not apply to the real status of that setting of the BMS. So, when new info arrives from the bms, the switch status changes to the previous one.

El El lun, 18 mar 2024 a las 10:44, denveronly @.***> escribió:

I noticed that one of the BMS's is not reporting its Charge, Discharge and balance state (BMS #1 https://github.com/syssi/esphome-jk-bms/issues/1), it sometimes falls off for a day and then replenishes as nothing happened. The issue is with one BMS only. Clicking Charge discharge switch doesnt help. Just some time.

The ESP code i used was provided by you, and i checked it also, no mistakes that could influence that.

image.png (view on web) https://github.com/syssi/esphome-jk-bms/assets/66441516/fdff2052-0066-43ed-a1df-5c7f6fa4f5cd

— Reply to this email directly, view it on GitHub https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-2003355503, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMCW7C43ACH6LVCODOLYY2ZPNAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBTGM2TKNJQGM . You are receiving this because you modified the open/close state.Message ID: @.***>

syssi commented 3 months ago

I'm unhappy about the amount of breaking changes. Could you try to avoid renaming sensor names?

txubelaxu commented 3 months ago

Sorry for the unhappyness, Sebastian. I am very newbie at github.

The changes I made were because: 1) there were redundant information in the names (for example: voltage and undervoltage) 2) there was missing important information "cell" or "whole bank" (for example: cell_overvoltage_protection) 3) there was missing information about name itself (for example: OVPR: OverVoltage Protection Recovery, and not OverVoltage Recovery)

About numbers, it was a suggestion from an user, because if you sort alphabetically the Cell's voltages & resistances they do not continue a numerical sequence.

Regards!!

Txubelaxu

El mié, 20 mar 2024 a las 20:12, Sebastian Muszynski (< @.***>) escribió:

I'm unhappy about the amount of breaking changes. Could you try to avoid renaming sensor names?

— Reply to this email directly, view it on GitHub https://github.com/syssi/esphome-jk-bms/pull/464#issuecomment-2010414850, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFHIJMHWGLOFJVN7KLAD7FLYZHNTJAVCNFSM6AAAAABDYZKHACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJQGQYTIOBVGA . You are receiving this because you modified the open/close state.Message ID: @.***>

syssi commented 3 months ago

You are doing a great job! Nevertheless we should try to avoid breaking changes because updating YAMLs because of rapidly changing custom components can be very frustrating for the community.

txubelaxu commented 3 months ago

Hi @denveronly, I have changed the rs485 code. Could you test it, please? I have adapted the example for 1 MASTER and 6 SLAVES, as well:

esp32-example-jkpb-rs485_1master_6slaves.yaml

dgbiuro commented 3 months ago

Hi, I'm trying to install the 1 master 6 slaves yaml file and it always fails. This is what I get from logs:

`INFO ESPHome 2024.3.1 INFO Reading configuration /config/esphome/jk-bms.yaml... INFO Updating https://github.com/txubelaxu/esphome-jk-bms.git@main INFO Generating C++ source... INFO Compiling app... Processing esp-rs485-gw (board: esp32dev; framework: espidf; platform: platformio/espressif32@5.4.0)

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash



I'm installing the yaml file via esphome addon in home assistant. What am I doing wrong here? Help will be much appreciated, thanks!