Commit 82040ae
fix(solax): control idle and freeze modes without the VPP self consume modes
Some SolaX inverters reject the two /inverter_vpp_mode/self_consume/* modes with
status 5 (device execution failed) whatever timeOfDuration or nextMotion is sent,
while accepting soc_target_control_mode and exit_vpp_mode on the same account.
That left the battery stuck in a non-discharging state for the whole of an idle
window, and because the command never succeeded the mode hash was never cached so
the pair was retried roughly every 65 seconds indefinitely.
Idle is not a command, it is the absence of one, so hand control back to the
inverter instead: write the self use work mode and exit VPP mode, mirroring what
freeze export already did. Freeze charge becomes the same pair with minSoc held at
the SOC the window opened at, so the battery can still charge from PV but will not
discharge. Charge and export are unchanged and still use soc_target_control_mode.
Now that the work mode governs idle behaviour, minSoc has to be the configured
reserve rather than the hard coded 10 it has always written, otherwise anyone with
a higher reserve would silently lose it.
Also add a failure backoff, growing from 5 minutes to an hour, so a mode an
inverter always rejects cannot hammer the cloud API. A different mode is still
tried immediately since the inverter may well accept it.
The standalone CLI gains --test-command to issue raw control commands (with
--duration, --next-motion, --target-soc, --power and --command-delay) which is how
the failing endpoints were isolated, and the request result logging now reports the
actual device status and the rejected payload rather than a stale description.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent d2bf0d1 commit 82040ae
2 files changed
Lines changed: 527 additions & 46 deletions
0 commit comments