Fix output limit not accounting for the solar pass-through - #1555
Open
Rolf-Smit wants to merge 1 commit into
Open
Fix output limit not accounting for the solar pass-through#1555Rolf-Smit wants to merge 1 commit into
Rolf-Smit wants to merge 1 commit into
Conversation
The output limit sent to a device passing solar through to the home was too low by exactly that pass-through power. The pass-through was subtracted from the setpoint before the setpoint was distributed, but the device reads the limit it receives as its complete output to the home, not as an addition on top of the solar pass through. A quick example: With 1400 W of solar going through and a 1750 W household load, the manager worked out the 1750 W correctly, yet it set the device to an output limit of 350 W, and the device simply held at 1400 W (it does not limit the solar bypass), so the battery never started and 350 W kept coming off the grid. The expected instruction is an output limit of 1750 W, so the battery starts discharging the remaining required power. With the same pass-through and a 4000 W load it was asked for 2600 W instead of 4000 W, so it did start, but the battery discharged just 1200 W where 2600 W was needed to get zero on the grid. The subtraction still applies to the choice between charging and discharging: pass-through power cannot be dialled back, so it must not be read as room to charge. The value reaching the charge side is unchanged, leaving the Zendure#1151 fix intact. Smart discharging and smart charging fell short by the same amount and are fixed along with it.
igosoft
added a commit
to igosoft/Zendure-HA
that referenced
this pull request
Aug 22, 2026
…discharge from SoC-weighted battery budget (needs Zendure#1555,Zendure#1559,Zendure#1565)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I run a SolarFlow 4000 Mix AC+ on its own circuit with the panels feeding its AC PV input. Once the battery reaches its target state of charge the device passes that solar straight through to the home (and any leftovers on to the grid). In that state, with no leftovers going to the grid, I kept seeing the grid supply power the battery should have been covering with ease.
One evening: 1400 W of solar going through, 350 W coming off the grid, the battery at 0 W. The manager had worked out the 1750 W household load correctly, yet sent the device an output limit of 350 W, well below the 1400 W it was already passing through. A device in bypass does not limit its solar pass-through, so it simply held at 1400 W and the battery never started discharging.
The pass-through is subtracted from the setpoint before the setpoint is distributed, but the device reads the limit it receives as its total output to the home, not as an addition on top of the bypass. Every commanded limit is therefore short by exactly the pass-through power. Once the grid is supplying more than the device is passing through, the battery does start, yet still under-delivers by that same amount: at a 4000 W load the device was asked for 2600 W and the battery discharged 1200 W where 2600 W was needed.
Detailed Changes
manager.py:powerChanged()no longer subtractsdischarge_bypassfrom the setpoint it distributes. The subtraction moved into a separatedispatchablevalue, which now drives the charge/discharge decision and is whatpower_charge()receives;power_discharge()gets the full home output target thatoutputLimitexpects. Both figures are logged, since they differ only during bypass.Smart discharging and smart charging had the same issue and are fixed by the same change. The value reaching the charge side is unchanged, so the fixes made in #1151 are unaffected: the subtraction does belong there, because pass-through power cannot be dialled back and must not be read as room to charge.
Tests
Observed and tested on my own SolarFlow 4000 Mix AC+, which is usable in this integration thanks to my earlier PRs #1528 and #1529. This PR depends on neither and can be merged independently, though I would love some eyes on those two as well.