Repository navigation
fix(fox): cap the plan at the inverter Max SoC - #5499
Open
theluckystrike wants to merge 1 commit into
Open
theluckystrike wants to merge 1 commit into
theluckystrike wants to merge 1 commit into
Conversation
Add a per-inverter battery_max_soc arg (percent, default 100) and bind the Fox Max SoC setting to it. After the inverters refresh, cap best_soc_max at the summed usable energy so charge targets and the prediction stop at the device limit. soc_max stays the capacity.
This branch has not been deployed
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.
Fixes #5395
This follows approach 1 from the issue. There's a new per-inverter
battery_max_socarg in percent, default 100, and Fox'sautomatic_config()binds it tonumber.<prefix>_fox_<sn>_setting_maxsoc. Other integrations with a device-side cap can bind the same arg.The cap goes into the planner ceiling, not into
soc_max.soc_maxstays the capacity becausesoc_kwcomes fromsoc_percent * soc_maxand the reserve is a percent of it, so scaling it would understate the stored energy.After
fetch_inverter_data()publishes the totals,apply_battery_max_soc_ceiling()adds upsoc_max * battery_max_soc / 100over the inverters. If any of them is below 100 it setsbest_soc_maxto that ceiling, or to the smaller of the two when the user already set one. It runs there and not infetch_config_options()because the config read happens before this cycle's inverters exist. With every inverter at 100,best_soc_maxis left exactly as it was.The tests cover the Fox binding in
test_fox_api.py, and the ceiling for one and two inverters plus the default of 100 intest_find_battery_size.py. The fullunit_test.pyrun passes in about 200 seconds and black is clean on the changed files.docs/apps-yaml.mddocuments the new arg next tobattery_min_soc.I didn't look into the related point about
maxSoc: 100in the SelfUse groups, so that's still open.Michael