Is your feature request related to a problem? Please describe.
Solis inverters (solax_modbus, GS/GS_fb00) support a "Feed-in priority" storage mode - solar is sent to the grid first, and the battery only receives the excess once generation exceeds the export limit. Predbat's mode-switching logic never selects it.
alt_charge_discharge_enable() in inverter.py only ever computes mode 35 (Self-Use) or 33 (Self-Use - No Timed Charge/Discharge) for the energy_control_switch entity. The other modes in SOLAX_SOLIS_MODES/SOLAX_SOLIS_MODES_NEW (config.py) - including "Feed-in priority" (64/96/98) - are defined in the lookup table but nothing in Predbat's control flow ever selects them, so they're currently unreachable regardless of configuration.
Raised out of the discussion on #2328.
Describe the solution you'd like
Add a mode Predbat can select for "hold at target SoC while preferring solar-to-grid over solar-to-battery" - i.e. Feed-in priority - alongside the existing charge/discharge/eco modes alt_charge_discharge_enable() already handles.
This looks like the same underlying inverter behaviour as the PV-recapture-during-Freeze-Export modelling recently added for FoxESS/FoxCloud (#4207) - solar routes to the grid/export first, with the battery only catching the surplus beyond a limit - just exposed as a distinct named mode on Solis rather than a variant of Freeze Export. Worth checking whether the existing Freeze Export plan state is the right trigger to map onto Feed-in priority for Solis, or whether it needs its own condition.
Describe alternatives you've considered
Today, holding at a target SoC on Solis falls back to either:
- writing a real target-SoC register directly (
charge_limit, only on GS_fb00 with it configured - the inverter then holds it natively), or
mimic_target_soc() - Predbat repeatedly toggling charge/discharge current in software to approximate holding a level (used when target-SoC isn't available)
Neither of these is Feed-in priority - they're both approximations of "stop moving energy," not "prefer routing solar to the grid." Feed-in priority is a genuinely different mode with no current equivalent in Predbat's control model.
Additional context
Also worth a look while touching this code: the mode selection in alt_charge_discharge_enable() currently hardcodes the numeric mode values (35/33) in the decision logic rather than referencing them by the named constants already defined in SOLAX_SOLIS_MODES/SOLAX_SOLIS_MODES_NEW - the string names are only looked up afterwards, for the write and the log message. Not a functional bug, but worth cleaning up alongside adding the new mode(s), for readability and to avoid the same disconnect happening again for whichever mode gets added next.
Is your feature request related to a problem? Please describe.
Solis inverters (solax_modbus,
GS/GS_fb00) support a "Feed-in priority" storage mode - solar is sent to the grid first, and the battery only receives the excess once generation exceeds the export limit. Predbat's mode-switching logic never selects it.alt_charge_discharge_enable()ininverter.pyonly ever computes mode35(Self-Use) or33(Self-Use - No Timed Charge/Discharge) for theenergy_control_switchentity. The other modes inSOLAX_SOLIS_MODES/SOLAX_SOLIS_MODES_NEW(config.py) - including"Feed-in priority"(64/96/98) - are defined in the lookup table but nothing in Predbat's control flow ever selects them, so they're currently unreachable regardless of configuration.Raised out of the discussion on #2328.
Describe the solution you'd like
Add a mode Predbat can select for "hold at target SoC while preferring solar-to-grid over solar-to-battery" - i.e. Feed-in priority - alongside the existing charge/discharge/eco modes
alt_charge_discharge_enable()already handles.This looks like the same underlying inverter behaviour as the PV-recapture-during-Freeze-Export modelling recently added for FoxESS/FoxCloud (#4207) - solar routes to the grid/export first, with the battery only catching the surplus beyond a limit - just exposed as a distinct named mode on Solis rather than a variant of Freeze Export. Worth checking whether the existing Freeze Export plan state is the right trigger to map onto Feed-in priority for Solis, or whether it needs its own condition.
Describe alternatives you've considered
Today, holding at a target SoC on Solis falls back to either:
charge_limit, only onGS_fb00with it configured - the inverter then holds it natively), ormimic_target_soc()- Predbat repeatedly toggling charge/discharge current in software to approximate holding a level (used when target-SoC isn't available)Neither of these is Feed-in priority - they're both approximations of "stop moving energy," not "prefer routing solar to the grid." Feed-in priority is a genuinely different mode with no current equivalent in Predbat's control model.
Additional context
Also worth a look while touching this code: the mode selection in
alt_charge_discharge_enable()currently hardcodes the numeric mode values (35/33) in the decision logic rather than referencing them by the named constants already defined inSOLAX_SOLIS_MODES/SOLAX_SOLIS_MODES_NEW- the string names are only looked up afterwards, for the write and the log message. Not a functional bug, but worth cleaning up alongside adding the new mode(s), for readability and to avoid the same disconnect happening again for whichever mode gets added next.