Skip to content

Fix output limit not accounting for the solar pass-through - #1555

Open
Rolf-Smit wants to merge 1 commit into
Zendure:masterfrom
Rolf-Smit:bugfix/bypass-full-output-target
Open

Fix output limit not accounting for the solar pass-through#1555
Rolf-Smit wants to merge 1 commit into
Zendure:masterfrom
Rolf-Smit:bugfix/bypass-full-output-target

Conversation

@Rolf-Smit

Copy link
Copy Markdown
Contributor

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 subtracts discharge_bypass from the setpoint it distributes. The subtraction moved into a separate dispatchable value, which now drives the charge/discharge decision and is what power_charge() receives; power_discharge() gets the full home output target that outputLimit expects. 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant