Skip to content

fix(fox): cap the plan at the inverter Max SoC - #5499

Open
theluckystrike wants to merge 1 commit into
springfall2008:mainfrom
theluckystrike:fix/5395-fox-max-soc
Open

theluckystrike wants to merge 1 commit into
springfall2008:mainfrom
theluckystrike:fix/5395-fox-max-soc

Conversation

@theluckystrike

Copy link
Copy Markdown

Fixes #5395

This follows approach 1 from the issue. There's a new per-inverter battery_max_soc arg in percent, default 100, and Fox's automatic_config() binds it to number.<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_max stays the capacity because soc_kw comes from soc_percent * soc_max and 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 up soc_max * battery_max_soc / 100 over the inverters. If any of them is below 100 it sets best_soc_max to that ceiling, or to the smaller of the two when the user already set one. It runs there and not in fetch_config_options() because the config read happens before this cycle's inverters exist. With every inverter at 100, best_soc_max is 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 in test_find_battery_size.py. The full unit_test.py run passes in about 200 seconds and black is clean on the changed files. docs/apps-yaml.md documents the new arg next to battery_min_soc.

I didn't look into the related point about maxSoc: 100 in the SelfUse groups, so that's still open.

Michael

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

No deployments
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.

Fox Cloud: the inverter's Max SoC setting is not passed to the planner, so the plan models charge the battery never takes

1 participant