diy solar

diy solar

JK BMS CAN bus comms now possible for inverters that support Goodwe and Pylontech batteries

I noticed my deye displays the lower of the temperature T1 or T2 instead of the highest one.
Edit: ok
 
Last edited:
After much searching I found the JK BMS, with it's 2A built-in active balancer it was just what I was looking for.
I wanted to connect my JK-BMS to my inverter like a commercial battery to ensure the inverter knows what the battery is up to in terms of Charging, Discharging, Alarms etc.
If you buy the CAN model, it does not support any standard battery protocol that energy storage inverters support.

All that changes now, as I have enabled CAN bus support for standard JK BMS RS485 models.
This will allow your JK BMS to communicate with any inverters that support Goodwe and Pylontech Low voltage batteries via CAN bus (Protocol compatible with Pylontech V1.3 and Goodwe V1.5)

New: Hardware interface kit(plug and play) info here
Thought this may help some others who would like inverter comms with their JK BMS.
My work can be found here: jk-bms-can

Sends over CAN bus to inverter:
  • Battery Voltage
  • Battery Current (+charge, -discharge)
  • State of Charge (SOC)
  • State of health (SOH)
  • BMS Temperature
  • Charging Voltage
  • Charging Amps
  • Discharge min Voltage
  • Battery name
  • Alarms: Cell over/under voltage, Charge/discharge over current, High/low Temp, BMS fault
  • Charging logic: Charging logic, now charges with constant current(CC) to the absorption voltage, then has an absorption timer (Constant Voltage, user configurable time), with rebulk feature (user configurable offset from absorption voltage). The charging logic is designed to stop charging once absorption phase has completed (no keeping the battery on float) and reduce micro cycling.
Note:- Support for only one BMS CAN connection per inverter, see here more info on creating larger capacity packs
Early stages are under way to support multiple BMS, but need funding to purchase additional hardware, please consider supporting me if you would like to see this functionally, early access code with be made available in the Alpha testers membership once funding goals are reached:
see here for more info: Multi BMS info

NOTE: ESP32 has a bug that causes WDT reboot if no other devices on CAN bus to ACK the packets.
If you try to run without inverter it will not work as it will constantly WDT reboot!
There is an early access beta version available that works around no inverter(CAN bus requires 2 devices to work).

Home Assistant native integration via ESPHome:
  • Battery control switches to manage battery remotely
    • Charging request status
    • Absorption voltage (slider)
    • Charging current max (slider)
    • Charging enabled/disabled
    • Discharging enabled/disabled
    • Charging manually (top balancing)
  • All BMS sensor values
View attachment 123038

I'm using it in my production environment which consists of:
  • Goodwe GW5000S-BP 5kW inverter
  • Goodwe GM3000 3 phase Smart meter cabled back to inverter (you can also use the GM1000 if you have single phase)
  • 16 * EVE LF280K batteries in series for nominal 51.2v
  • JK-BMS 150A model JK-B2A24S15P
  • JK RS485 module (you don't need this if your ESP32 is near the JK-BMS)
  • ESP32 model esp32doit-devkit-v1
  • TJA1050 CAN bus to TTL module 4.7K resistor for 5V to 3.3v level shift.
  • RS485 to TTL module (you don't need this if your ESP32 is near the JK-BMS)
  • Various safety devices: Fuse and ZJ Beny125A DC circuit breaker etc.
I have set up Pateron to help fund future development.
Additional info will be published to "Be in the know" Pateron membership levels and above like:

What development is coming soon
Development that has been completed and is in Alpha/Beta testing
Get early access to Alpha/Beta code for testing (in those tiers)
Polls to determine future features etc.
Help fund goals to purchase additional hardware like multiple BMS support
Hi, for a very new newbie, could you explain in non technical terms, what your post actually means.

I thought that the BMS did not need to communicate with the inverter, as it's purpose is to monitor and control the battery charging only.

I am currently researching building my own set of batteries and trying to decide what sort of 200a BMS to buy. I came across this thread by accident and it has greatly confused me.

Appreciate any clarifications you could give me. Thank you.
 
Hi, for a very new newbie, could you explain in non technical terms, what your post actually means.

I thought that the BMS did not need to communicate with the inverter, as it's purpose is to monitor and control the battery charging only.

I am currently researching building my own set of batteries and trying to decide what sort of 200a BMS to buy. I came across this thread by accident and it has greatly confused me.

Appreciate any clarifications you could give me. Thank you.

The advantage of communication with the inverter/charge controller is that you can have the BMS control the parameters on the fly based on conditions such as temperature, state of charge, etc. You can for example slow down charging if the (ambient) temperature is getting too high, or slow down charging when the state of charge is high to give the balancer time.

Do you need it? Not really. I run my system without any communication at all. If you set your parameters, and they work for you, you don't need it and it just adds a layer of complexity. I consider the (JK in my case) BMS only as the last line of defense to protect my cells, nothing else.
 
@upnorthandpersonal

Even if it is not absolutely necessary, some inverters like Deye have an operating principle based on the SoC of the battery.
In this case, using the CAN bus to send information to the inverter is useful.

This was actually the main reason why I wanted to have my JK-BMS communicate with my Deye inverter.
The Deye inverter is capable of estimating the SoC itself but it will end up being different from that of JK-BMS.

@bds70

If you have not yet purchased your BMS.
The new JK-BMS PB2A16S20P (16S 200A + active balancer 2A) is capable of communicating with inverters natively via CAN bus.
And if it's not useful for you today, maybe it will be in the future. Connecting the BMS with the inverter is not obligatory but it will be possible.
 
The advantage of communication with the inverter/charge controller is that you can have the BMS control the parameters on the fly based on conditions such as temperature, state of charge, etc. You can for example slow down charging if the (ambient) temperature is getting too high, or slow down charging when the state of charge is high to give the balancer time.

Do you need it? Not really. I run my system without any communication at all. If you set your parameters, and they work for you, you don't need it and it just adds a layer of complexity. I consider the (JK in my case) BMS only as the last line of defense to protect my cells, nothing else.
I think I see where my confusion lies. When you say "inverter/charger" your talking about a AIO inverter with inbuilt MPPT. Rather than a stand alone mppt and a stand alone inverter. Like in my case the MPPT is a Victron solar smart, connected to the batteries via smart shunt to a Lynxx Distributor which then connects to my Victron Multiplus inverter. So the smart shunt carries the communications between batteries and MPPT to control charging etc. Is that what I am mixing up perhaps.?
 
I think I see where my confusion lies. When you say "inverter/charger" your talking about a AIO inverter with inbuilt MPPT. Rather than a stand alone mppt and a stand alone inverter. Like in my case the MPPT is a Victron solar smart, connected to the batteries via smart shunt to a Lynxx Distributor which then connects to my Victron Multiplus inverter. So the smart shunt carries the communications between batteries and MPPT to control charging etc. Is that what I am mixing up perhaps.?

Even in your case, a smart BMS can be connected to the Victron system to a Cerbo GX or Venus OS and in this case it is the BMS which will communicate to the Victron system the charging voltage and current and many other parameters for information purposes but also warnings and alarms to stop charging or discharging.

With this way of working it is the BMS which gives instructions to the Victron system which adapts to the request of the BMS.
 
When you say "inverter/charger" your talking about a AIO inverter with inbuilt MPPT. Rather than a stand alone mppt and a stand alone inverter. Like in my case the MPPT is a Victron solar smart, connected to the batteries via smart shunt to a Lynxx Distributor which then connects to my Victron Multiplus inverter. So the smart shunt carries the communications between batteries and MPPT to control charging etc. Is that what I am mixing up perhaps.?

No, it integrates with the Victron ecosystem and can for example set the charge parameters on the MPPT.
 
Here is the latest end of year news.

# V1.15.3 Sleeper85 : Add 'CAN Protocol Settings' and new CAN ID based on the SMA and Victron protocol (alpha)
# V1.15.2 Sleeper85 : Improved Alarm handling, all alarms will set charge/discharge current to 0A and set 'Charging Status' to Alarm

The alarm system has been improved.

And then I started analyzing CAN IDs initially used by SMA and Victron but probably by others today.
It is not an easy task to find this information often protected by NDAs.

So here is an overview of what will be possible to use in the latest version 1.15.3 (alpha). I think I have programmed this correctly but unfortunately I cannot test it with my Deye inverter (which only supports PYLON 1.2) but only by checking the correct format and values of the CAN ID sent.

These CAN IDs will cover a large part of the inverters on the market.

CAN_Protocol_Table.png

I'll post all of this on GitHub next week.

I wish you a wonderful end of year celebration.
 
Last edited:
@Sleeper85 i have Growatt inverter SPF5000ES and JK-B2A20S20P, your .yaml run with ?

When I saw your message I was going to answer you no but after some research it seems that your inverter is capable of communicating via the CAN bus with a SEPLOS BMS and therefore this should work.

Go read the following topic

In addition, the table below shows that your inverter would be compatible with Pylontech batteries and choosing the CAN L52 protocol.

Growatt_battery_compatibility.png

So to test.
 
@Sleeper85
It works perfectly.
The blue LED flashes, what does that mean?

IMG_6337.jpeg

Inverter shows message 04 "Low battery level" since I connected ESP32. What value in your program is used for comparison?

IMG_6336.jpeg
 
The blue LED flashes, what does that mean?

The blue LED flashes each time the ESP32 receives the ACK CAN ID 0x305 message from the inverter. This means that the CAN bus connection is OK.

Inverter shows message 04 "Low battery level" since I connected ESP32. What value in your program is used for comparison?

I don't know what this message means on your inverter.

The CAN ID dedicated to alarms is 0x359, they send alarms coming from the BMS to the inverter.

But other information regarding the battery is sent with ID 0x355 SOC / SOH or ID 0x70 Cell info. See the table I posted above.

Messages in the logs can help, here is the example of id 0x359 when no alarm is sent.

1704140815691.png

Attached is the latest YAML file that I haven't yet taken the time to publish on GitHub. This YAML is capable of sending many more CAN IDs than the previous version. It is configured by default to send the PYLON 1.2 protocol IDs which is the same as now without the IDs 0x70 and 0x371.

If you want to test the behavior of your inverter with other IDs you can choose what to send in this part of the script.

At your place L52 corresponds to Pylontech so it should be OK as below without the IDs 0x70 and 0x371.

CAN_Protocol_Settings_Deye.png


FYI : 0x70 and 0x371 are used with SEPLOS, GoodWe and maybe PYLON 1.3 (no doc to confirm) but not with PYLON 1.2.
 
Last edited:
Another important thing about connecting with Home Assistant.

If your ESP32 is not connected with Home Assistant it will reboot every 15 minutes. This is the normal behavior of ESPHome if HA is not connected to the ESP32 API. This is not a bug to be resolved but a mechanism put in place by the ESPHome team to correct a possible problem with the connection to the API.

So I prefer to explain to you how to disable the API if you don't use Home Assistant.

Just comment out the "api:" line in the configuration file before flashing the ESP32.

1704143468934.png

The same goes for the WiFi connection, if the ESP32 is not connected it will reboot every 15 minutes. If you do not want to connect the ESP32 to the WiFi network you can comment on all the lines below.

1704143441485.png
 
Last edited:
Or you can use reboot_timeout to increase it from the 15min.
Another important thing about connecting with Home Assistant.

If your ESP32 is not connected with Home Assistant it will reboot every 15 minutes. This is the normal behavior of ESPHome if HA is not connected to the ESP32 API. This is not a bug to be resolved but a mechanism put in place by the ESPHome team to correct a possible problem with the connection to the API.

So I prefer to explain to you how to disable the API if you don't use Home Assistant.

Just comment out the "api:" line in the configuration file before flashing the ESP32.

View attachment 186286

The same goes for the WiFi connection, if the ESP32 is not connected it will reboot every 15 minutes. If you do not want to connect the ESP32 to the WiFi network you can comment on all the lines below.

View attachment 186285
 
Or you can use reboot_timeout to increase it from the 15min.

Yes it's another solution but if the API is not used you might as well deactivate it completely and this is also possible with the reboot_timeout parameter set to 0s.
 
V1.15.4 added to GitHub

I think this was the last big change to this YAML.
I hope this will be able to support a larger number of inverters which I unfortunately was not able to test.
If you encounter any bugs please let me know.

I adapted the README regarding the documentation for API, Web Server and WiFi settings.
This is to inform of the possibilities of not using Home Assistant.
 
Last edited:
Back
Top