Skip to content

[Bug] Discharge power is wrong when SOCFULL #954

@PyrO70

Description

@PyrO70

Home Assistant Version

2025.12.4

Zendure Integration Version

v1.1.4-pre10

Describe the bug

Hello!

I have a single SF2400AC inverter with two batteries. A solar installation not connected to the battery.

I have noticed that on occasion, in smart mode, the power would change from what I expect to 0, many times. My battery wasn't fully charge in a while, it looks like the battery had decided, in the morning, to fully charge it to 100% (that wasn't the doing of the integration).

After this happened, and the integration requested discharge from the battery, it behaved like mentioned, going from expected grid matching to 0, and back, many times.

I have investigated the integration code, and found that the pwr_setpoint calculated in powerChanged() takes p1 and adds the already outputted power (pwr_home), and then, on condition subtracts pwr_bypass . In my case, because the battery was fully charged in the morning, but my maxSOC is set to 75% pwr_bypass is set equal to pwr_home. This results in the pwr_setpoint to be offsetted back to what p1 was. Resulting in, p1 being negative, the integration request to charge the battery by p1 amount (usually too low for it to happens, but it goes to 0)

I have attached some log, that includes some more logs that I have added to the integration to show the pwr_bypass. "Device ======>" is in the devices iteration in powerChanged.

I seems like it only works for a while until resetting to 0, and starting again. No sure yet why it works at all. Seems to happens when the P1 goes negative.

To Reproduce

  1. Set the macSOC to something lower than the current SOC level
  2. Set to SMART mode
  3. Request power from the battery

Expected Behaviour

  1. The integration tracks the P1 without going to be to 0

What device are you using?

SF2400 AC

Log Extracts

2025-12-21 17:15:25.541 INFO (MainThread) [custom_components.zendure_ha.manager] P1 ======> p1:465 isFast:False, setpoint:465W avg_setpoint:465 stored:0W
2025-12-21 17:15:25.541 INFO (MainThread) [custom_components.zendure_ha.manager] powerDischarge => setpoint 465 solarOnly False
2025-12-21 17:15:25.541 INFO (MainThread) [custom_components.zendure_ha.device] Power discharge SolarFlow 2400 AC => 50
2025-12-21 17:15:25.637 INFO (MainThread) [custom_components.zendure_ha.manager] powerDistribution => left 464W
2025-12-21 17:15:27.248 INFO (MainThread) [homeassistant.components.mqtt.client] MQTT client initialized, birth message sent
2025-12-21 17:15:30.514 INFO (MainThread) [custom_components.zendure_ha.number] Update number: SolarFlow 2400 AC-outputLimit => 50.0
2025-12-21 17:15:30.523 INFO (MainThread) [custom_components.zendure_ha.manager] Device ======> pwr_home:0W pwr_bypass:0W, pwr_battery:0W
2025-12-21 17:15:30.523 INFO (MainThread) [custom_components.zendure_ha.manager] P1 ======> p1:458 isFast:False, setpoint:458W avg_setpoint:461 stored:0W
2025-12-21 17:15:30.523 INFO (MainThread) [custom_components.zendure_ha.manager] powerDischarge => setpoint 458 solarOnly False
2025-12-21 17:15:30.524 INFO (MainThread) [custom_components.zendure_ha.device] Power discharge SolarFlow 2400 AC => 50
2025-12-21 17:15:30.613 INFO (MainThread) [custom_components.zendure_ha.manager] powerDistribution => left 457W
2025-12-21 17:15:34.517 INFO (MainThread) [custom_components.zendure_ha.manager] Device ======> pwr_home:49W pwr_bypass:49W, pwr_battery:0W
2025-12-21 17:15:34.517 INFO (MainThread) [custom_components.zendure_ha.manager] avg:461 stddev:250.0
2025-12-21 17:15:34.517 INFO (MainThread) [custom_components.zendure_ha.manager] P1 ======> p1:416 isFast:False, setpoint:465W avg_setpoint:462 stored:0W
2025-12-21 17:15:34.517 INFO (MainThread) [custom_components.zendure_ha.manager] powerDischarge => setpoint 465 solarOnly False
2025-12-21 17:15:34.517 INFO (MainThread) [custom_components.zendure_ha.device] Power discharge SolarFlow 2400 AC => 465
2025-12-21 17:15:38.518 INFO (MainThread) [custom_components.zendure_ha.number] Update number: SolarFlow 2400 AC-outputLimit => 465.0
2025-12-21 17:15:38.521 INFO (MainThread) [custom_components.zendure_ha.manager] Device ======> pwr_home:464W pwr_bypass:464W, pwr_battery:0W
2025-12-21 17:15:38.521 INFO (MainThread) [custom_components.zendure_ha.manager] avg:462 stddev:250.0
2025-12-21 17:15:38.522 INFO (MainThread) [custom_components.zendure_ha.manager] P1 ======> p1:45 isFast:False, setpoint:509W avg_setpoint:474 stored:0W
2025-12-21 17:15:38.522 INFO (MainThread) [custom_components.zendure_ha.manager] powerDischarge => setpoint 509 solarOnly False
2025-12-21 17:15:38.522 INFO (MainThread) [custom_components.zendure_ha.device] Power discharge SolarFlow 2400 AC => 509
2025-12-21 17:15:42.544 INFO (MainThread) [custom_components.zendure_ha.number] Update number: SolarFlow 2400 AC-outputLimit => 509.0
2025-12-21 17:15:42.545 INFO (MainThread) [custom_components.zendure_ha.manager] Device ======> pwr_home:508W pwr_bypass:508W, pwr_battery:0W
2025-12-21 17:15:42.545 INFO (MainThread) [custom_components.zendure_ha.manager] avg:474 stddev:250.0
2025-12-21 17:15:42.545 INFO (MainThread) [custom_components.zendure_ha.manager] P1 ======> p1:7 isFast:False, setpoint:515W avg_setpoint:482 stored:0W
2025-12-21 17:15:42.545 INFO (MainThread) [custom_components.zendure_ha.manager] powerDischarge => setpoint 515 solarOnly False
2025-12-21 17:15:42.545 INFO (MainThread) [custom_components.zendure_ha.device] Power discharge SolarFlow 2400 AC => 515
2025-12-21 17:15:47.517 INFO (MainThread) [custom_components.zendure_ha.number] Update number: SolarFlow 2400 AC-outputLimit => 515.0
2025-12-21 17:15:47.519 INFO (MainThread) [custom_components.zendure_ha.manager] Device ======> pwr_home:514W pwr_bypass:514W, pwr_battery:0W
2025-12-21 17:15:47.519 INFO (MainThread) [custom_components.zendure_ha.manager] avg:482 stddev:250.0
2025-12-21 17:15:47.519 INFO (MainThread) [custom_components.zendure_ha.manager] P1 ======> p1:-70 isFast:False, setpoint:-70W avg_setpoint:-38 stored:0W
2025-12-21 17:15:47.519 INFO (MainThread) [custom_components.zendure_ha.manager] powerDischarge => setpoint 0 solarOnly True
2025-12-21 17:15:47.519 INFO (MainThread) [custom_components.zendure_ha.device] Power discharge SolarFlow 2400 AC => 0
2025-12-21 17:15:51.519 INFO (MainThread) [custom_components.zendure_ha.number] Update number: SolarFlow 2400 AC-outputLimit => 0.0
2025-12-21 17:15:51.521 INFO (MainThread) [custom_components.zendure_ha.manager] Device ======> pwr_home:514W pwr_bypass:514W, pwr_battery:0W
2025-12-21 17:15:51.521 INFO (MainThread) [custom_components.zendure_ha.manager] avg:476 stddev:250.0
2025-12-21 17:15:51.521 INFO (MainThread) [custom_components.zendure_ha.manager] reset history
2025-12-21 17:15:51.521 INFO (MainThread) [custom_components.zendure_ha.manager] P1 ======> p1:462 isFast:False, setpoint:976W avg_setpoint:976 stored:0W
2025-12-21 17:15:51.521 INFO (MainThread) [custom_components.zendure_ha.manager] powerDischarge => setpoint 976 solarOnly False
2025-12-21 17:15:51.522 INFO (MainThread) [custom_components.zendure_ha.device] Power discharge SolarFlow 2400 AC => 976

Other Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions