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
482 stars 161 forks source link

UART Discharging switch not working ( B2A20S20P HW: V11.XW - SW: V11.285H ) #559

Closed Sleeper85 closed 3 months ago

Sleeper85 commented 3 months ago

Hi @syssi

First of all, thank you very much for all the development you have done to integrate the different brands of BMS into HA.

I'm testing the UART switches and I realize that the discharging switch does not work from HA. I can modify it in the JK application and its status will be updated in HA but I cannot modify it from HA.

The charging switch works fine.

Is this a known issue with the V11.285H version?

switch:
  - platform: jk_bms
    charging:
      name: "${name} charging"
    discharging:
      name: "${name} discharging"

Many thanks

syssi commented 3 months ago

I'm not aware of any issues here. Which BMS model do you use exactly?

Sleeper85 commented 3 months ago

JK-B2A20S20P 200A Heat + CAN. HW: V11.XW SW: V11.285H

syssi commented 3 months ago

I've tested the discharging switch on a 11.XW_S11.27___ device without trouble.

Sleeper85 commented 3 months ago

Ok I will do a new test only with your code.

For the moment I test it from my git and a minimal version of the JK-B UART YAML.

Did I remove sensors necessary for proper operation ?

What is strange is that the charge switch works.

syssi commented 3 months ago

There are no dependencies. A tiny YAML with two switch entities only should work already.

Sleeper85 commented 3 months ago

It seems that the problem is only there when I do a dual UART + BLE supervision of the same BMS. I did this as part of my multi-bms to CAN bus testing (YamBMS).

I now work only with UART and I have no more problem.

syssi commented 3 months ago

I don't think this is the root cause. I did the same yesterday using the Android app for verification. An active BLE connection indicates the changes switch state immediately.

Sleeper85 commented 3 months ago

You are right. I just did some other tests. Disabling the discharge switch while the battery is charging is not always immediate. This may be related to the fact that with the mosfet blocking the discharge, the charge current must exceed a certain threshold for the charge to be effective.

syssi commented 3 months ago

Be careful. :-) The Mosfets can die on high currents.