diy solar

diy solar

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

Deye SUN-6K-SG03-LP1-EU
MAIN : 4384-1515
HMI : 0000-C362

First day with the JK-BMS-CAN module (1.13.3), I don't understand what's going on.

The battery remained below 50% all day.
The Time Of Use config is 40% SoC min from 8:00 to 12:00 and 50% SoC min from 12:00 to 16:00.

The inverter is configured to charge the battery first so all solar energy must recharge the battery up to the minimum SoC (40% SoC from 8:00 to 12:00 and 50% SoC from 12:00 to 16:00.)

The inverter never exports if the battery is not 100% charged, today the export started at 11:23 with a battery charged at 41% and a voltage of 53.2V far from the charging voltage of 55.2V.

I authorized a charge current of 100A and we stayed below 40A with 3320WV of PV which is normal.

This behavior is very strange and totally different from the behavior without the connection to the BMS.

In Deye I have enabled the 'Disable Float Charge' setting I will disable it and see how it goes tomorrow.

1694890727872.png

1694890823907.png

1694890853876.png

1694891359502.png
 
The battery remained below 50% all day.
The Time Of Use config is 40% SoC min from 8:00 to 12:00 and 50% SoC min from 12:00 to 16:00.

The inverter is configured to charge the battery first so all solar energy must recharge the battery up to the minimum SoC (40% SoC from 8:00 to 12:00 and 50% SoC from 12:00 to 16:00.)
Deye Time of use is a bit confusing, It looks to me like it is doing what you have configured in the TOU setting.

It is only charging to ~40% before 12:00 and 50% to 16:00
Do you need to use TOU, maybe try turning it off and see what it does?

You should monitor the ESP32 logs or in Home Assistant the "Charging status", tells you what it is requesting from the inverter:
Bulk means it is requesting charge.
Wait means no charging as the battery is full.

Maybe the first part of the video helps, they have TOU not ticked or disabled?


Regards.
 
Last edited:
Deye Time of use is a bit confusing, It looks to me like it is doing what you have configured in the TOU setting.

It is only charging to ~40% before 12:00 and 50% to 16:00
Do you need to use TOU, maybe try turning it off and see what it does?

1694936061416.png
1694942096642.png



I know Deye and TOU well and what is happening today is a completely different behavior from what is happening in 'Use Batt %' mode.

With the 'Use Batt %' mode it happens like this:
  1. If at 12:00 Batt = 50% in TOU
  2. If the battery is at 43% it will be charged as a priority by the PV up to 50% ('Batt First' checked)
  3. Then the PV can power the load and the battery at the same time, the battery continues to charge.
  4. When the battery reaches 100%, the surplus can be exported

You should monitor the ESP32 logs or in Home Assistant the "Charging status", tells you what it is requesting from the inverter:

Good idea, I'll see what's going on there.

Thanks.

Edit:

This morning it's on Bulk, we'll see how it goes the rest of the day.

1694937199281.png
 
Last edited:
@uksa007

Yesterday I had no problems.

Today the problem started at 11:58 when the SoC was at 33%.

When the problem occurs the charging status is "Wait", the inverter stops charging the battery and exports energy to the grid.

1695031646039.png
 
@uksa007

Yesterday I had no problems.

Today the problem started at 11:58 when the SoC was at 33%.

When the problem occurs the charging status is "Wait", the inverter stops charging the battery and exports energy to the grid.
It goes into Wait state when the battery voltage = absorption voltage, what was the battery voltage when it when into wait state?

The SOC is generated from the BMS, have you calibrated it for SOC and have you configured the battery chemistry and setting correctly in the BMS?

What is your battery setup, and what setting are you using?

These are the default setting, which should be good for 16s LiFePO4, LF280K cells:
  • charge_a: "50" (Max charge current)
  • absorption_v: "55.2" (Charge V, 3.45V/cell)
  • absorption_time: "30" (Time to absorb)
  • rebulk_offset: "2.5" (absorption_v - rebulk_offset = charge request)
  • discharge_a: "100" (Max discharge current)
  • min_dischange_v: "48" (Min discharge V, 3V/cell)
 
Last edited:
The SOC is generated from the BMS, have you calibrated it for SOC and have you configured the battery chemistry and setting correctly in the BMS?

The voltage and amps have been perfectly calibrated, the SoC is realistic.

This morning at 06:00

SoC: 29%
Voltage: 51.7V
Current: -3.9A (no big voltage drop)

My settings
  • charge_a: "100" (Max charge current)
  • absorption_v: "55.2" (Charge V, 3.45V/cell)
  • absorption_time: "30" (Time to absorb)
  • rebulk_offset: "2.5" (absorption_v - rebulk_offset = charge request)
  • discharge_a: "150" (Max discharge current)
  • min_dischange_v: "48" (Min discharge V, 3V/cell)

It goes into Wait state when the battery voltage = absorption voltage, what was the battery voltage when it when into wait state?

53.7V

1695036287470.png

1695036375922.png
 
How much current was there at 53.7v?

53.7 /16 = 3.356 per cell with no load would be about 90% SOC

53.7V is the Deye charge voltage, this does not correspond to the BMS voltage.

Solar Assistant does not record the BMS voltage which is a little lower during charging.

12:18 = ESP32 reset, charging status remains on Wait

1695040500102.png

1695040797833.png

1695040694958.png

1695041116591.png

1695040954298.png
 
53.7V is the Deye charge voltage, this does not correspond to the BMS voltage.
The charging voltage should be set by the ESP32 set absorption voltage when in bulk.

Have you configured the Deye inverter correctly:
Battery mode lithium
Lithium mode 00

After a reboot It will stay in Wait until the battery voltage is below: absorption_v - rebullk_offset = 52.7v (this stops micro cycling the battery)
 
The charging voltage should be set by the ESP32 set absorption voltage when in bulk.

Have you configured the Deye inverter correctly:
Battery mode lithium
Lithium mode 00

After a reboot It will stay in Wait until the battery voltage is below: absorption_v - rebullk_offset = 52.7v (this stops micro cycling the battery)

Yes Lithium mode 00.

The 55.2V charging voltage is clearly displayed on the Li-BMS page.
 
After a reboot It will stay in Wait until the battery voltage is below: absorption_v - rebullk_offset = 52.7v (this stops micro cycling the battery)

The BMS currently displays a voltage of 53.5V with a charging current of 30A. (I disconnected the ESP32 for the battery to charge).

This explains why after a reboot I stay on Wait.

But that doesn't explain why it stayed on Wait from 12:00 ?
Maybe a reboot of the ESP32 which will be unstable because of my DC 48V to DC 5V power supply?

I can set the offset to 0 to test again.

Battery mode lithium?
You can't use % or Voltage it has to be lithium!

Yes it's "Lithium" with mode "00".
 
Maybe a reboot of the ESP32 which will be unstable because of my DC 48V to DC 5V power supply?
Yes that would explain it if it's rebooting.
The ESP32 logs will write a long entry for uptime every 1minute.
This will tell you if it is rebooting.

I'm currently testing a new interface board of mine that has a Built-in DC-DC power supply, and will run directly from the Jk-BMS as it supply V-BAT on the GPS/RS485 port.
 
Ok I will check the ESP32 uptime.

I just reduced the offset to 0.8V (to test).

I also added messages in the logs to analyze the behavior.

Here we go again on Bulk.

Thanks for your help.

Wait and see.

1695044933134.png

1695044724459.png
 
I'm currently testing a new interface board of mine that has a Built-in DC-DC power supply, and will run directly from the Jk-BMS as it supply V-BAT on the GPS/RS485 port.
Would you happen to know how many amps the Jk-BMS V-BAT port is rated to support? I was considering using this at first, but since I did not have specs, decided to connect my DC-DC directly to the battery instead. I'm pretty sure it would have been fine to power from the port, but my main consideration was if there happened to be a short on the line, would my fuse blow first, or the BMS? Tapping into the 'main' V+ guarantees isolation of this specific failure mode, if it were to ever happen.

Side note - my isolated VRB4805S DC-DC has been running perfectly, no reboots or loss of communication yet!
 
Would you happen to know how many amps the Jk-BMS V-BAT port is rated to support? I was considering using this at first, but since I did not have specs, decided to connect my DC-DC directly to the battery instead. I'm pretty sure it would have been fine to power from the port, but my main consideration was if there happened to be a short on the line, would my fuse blow first, or the BMS? Tapping into the 'main' V+ guarantees isolation of this specific failure mode, if it were to ever happen.

Side note - my isolated VRB4805S DC-DC has been running perfectly, no reboots or loss of communication yet!

The specification says that the JST 1.25 port can support 1A max.

It scares me too, especially in the case of a short circuit, and during assembly in my final box I will also connect after the BMS to + and - of the battery, behind my MCCB breaker.

Otherwise I measured 0.02A and 52.69V for consumption.
 
@uksa007

absorption_v: "55.2"
rebulk_offset: "2.5"

Normally with the above parameters and a 53.5V battery, when starting I have to execute the procedure framed in pink but it does not work for several reasons.

It's late and it's a bit long to explain so I'll give more details tomorrow.

I modified this part of the script to correct this problem, we will see how it goes tomorrow.

1695073116004.png

1695073780451.png
 
Last edited:
I did some testing with the Voltronic inverter a while ago, I think the only issue we had was there no way to control the discharge current in the inverter, it simply didn't support max discharge current even though we were sending it. The inverter itself doesn't have any register or ability to set it even manually.
So you have to size the battery and BMS big enough to handle the max discharge current the inverter will pull from the battery.
Other than that it seemed to work well.
Hello,
this is not completly corret: Voltronic Max 7.2 inverter doesn't accept "Max Discharge Current" from BMS, but you can set it on inverter (on remote panel or via software)
 
Hello,
this is not completly corret: Voltronic Max 7.2 inverter doesn't accept "Max Discharge Current" from BMS, but you can set it on inverter (on remote panel or via software)
Not on the model we were testing.
It didn’t exist.
No mention of it in the user manual.
No option on the front panel or via software.
 
Not on the model we were testing.
It didn’t exist.
No mention of it in the user manual.
No option on the front panel or via software.

On my Voltronic Axpert Max 7.2 (we already tested your RS485 version) manual for remote panel says:
SumatraPDF_2023-09-19_18-40-03.png

and this is from software protocol:
SumatraPDF_2023-09-19_18-43-33.png
And I confirm, I was able to set "Max Discharge Current" via remote panel or EspHome while battery mode set in "PYLON" testing you RS485 version.
 
But in original question (https://diysolarforum.com/threads/j...dwe-and-pylontech-batteries.48963/post-863878) OP is talking of Voltronic Max 7200, as mine.

See https://github.com/Uksa007/esphome-jk-bms-can/discussions/27#discussioncomment-6274479, this is me when we tested Max 7.2.

If you are talking about another inverter, then sorry. Could you remember which one?
Ciao Pongo, scusami..Anche io ho un Max 7200 (di SP24)...spiegami un attimo per favore, ma questo accessorio creato da uksa007 funziona? Il JK comunica con il Voltronic come qualsiasi altro BMS tipo Seplos e compare la percentuale? Io ho un JK con uscita RS485 per adesso collegato ad un Raspbarry e con Solar Assistant.
 
@uksa007

absorption_v: "55.2"
rebulk_offset: "3.0"

I did the tests below with a battery at +/- 53.1V
I set the offset to 3V to match the condition of the box marked "A".

Under these conditions when booting the ESP32 the charging status should be on Bulk but we remain stuck on Wait.

Why ?

First, during boot, JK-BMS information is not immediately available.

Even if the BMS allows charging, the condition !id(charging_switch).state) is true and the code framed with the number 1 is executed.
The 'charge_status' variable is changed to 'Disabled'.

Then the code framed with the number 2 is executed and 'charge_status' is changed to 'Wait'.

Then we will remain stuck in this 'Wait' state until the battery voltage is below 55.2 - 2.5 (offset) = 52.7V (3.29V / cell which can last a long time).

A battery charging with 30A or more can be well above 52.7V with an SoC less than 50%.

V1.13.3 original script

1695273346706.png

1695273274803.png



Modified script

To correct this problem I tried not to modify the original script too much.

1) I changed the initial value of 'charge_status' to 'Init' for the procedure added in point 2.
2) I added the code framed in pink (1), it just allows you to wait a little in order to receive the information coming from the JK-BMS sensors which are not available directly just after boot.
3) Modified the value of the variable in box (2)

In the original script, in HA if we force the charge with the 'Charging manually (top bal)' switch then deactivate it we stay on 'Wait', for me it's OK if the goal is to wait and not to resume normal operation immediately.

But then it was impossible to return to normal 'bulk' mode.

To correct this problem I modified the 'Wait' value in box (2) to 'Startup' which allows normal charging to be activated via an OFF/ON of the 'Charging enabled' switch.



1695280307225.png

1695287642535.png




Below you can see two videos of the behavior before and after.

A reset of the ESP32 is done before the start of each video.

1) First video with the original code, we get stuck on Wait


2) Second video with the modified code, it works ;-)


That said, I think this part of the code could probably be improved further.

Here is the new code.

C++:
            uint8_t can_mesg[7];
            if (id(charge_status) == "Init") {
                id(charge_status) = "Startup";
                ESP_LOGI("main", "Wait for JK-BMS data...");
            } else if ((!id(charging_switch).state) | (!id(inverter_charging).state)) {
               id(charge_status) = "Disabled";
            } else if (id(inverter_chg_on).state) {
                id(charge_status) = "Bulk Manually";
            } else if ((id(charging_switch).state) & (id(inverter_charging).state) & (id(charge_status) == "Disabled")) {
               id(charge_status) = "Startup";
            } else if ((!id(inverter_chg_on).state) & (id(charge_status) == "Bulk Manually")) {
               id(charge_status) = "Wait";
            } else if (id(total_voltage).state <= (id(charging_voltage).state - ${rebulk_offset})) { // Bulk Charge eg 53.6v 10%
                if (id(absorption_script).is_running()) id(absorption_script).stop();
                id(charge_status) = "Bulk";
            } else if ((id(total_voltage).state > (id(charging_voltage).state - ${rebulk_offset})) & (id(total_voltage).state < (id(charging_voltage).state - 0.05))) { // If in startup rebulk
                     if (id(charge_status) == "Startup") {
                        id(charge_status) = "Bulk"; // If in startup, 10% low rebulk
                     }
            } else if (id(total_voltage).state >= (id(charging_voltage).state  - 0.05)) { // 10 % from top start absorption timer
                     if (id(charge_status) == "Bulk") {
                        id(charge_status) = "Absorption";
                        if (!id(absorption_script).is_running()) id(absorption_script).execute();
                     }
            } else {
                id(charge_status) = "Wait";
            }
 
Last edited:

diy solar

diy solar
Back
Top