Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell/custom-dictionary-workspace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ fontweight
Forestfire
formaction
formmethod
foxcloud
foxess
foxesscloud
freephase
Expand Down
5 changes: 4 additions & 1 deletion apps/predbat/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,10 @@
"write_and_poll_sleep": 2,
"has_time_window": False,
"support_charge_freeze": True,
"support_discharge_freeze": True,
# "Feed-in first"/freeze export mode does not hold SoC flat on FoxESS - PV above the
# export limit still charges the battery instead of being clipped (#4207) - matching
# FoxCloud's entry below, which was already correctly set False for the same hardware.
"support_discharge_freeze": False,
"has_idle_time": False,
"can_span_midnight": True,
"charge_discharge_with_rate": False,
Expand Down
21 changes: 21 additions & 0 deletions apps/predbat/tests/test_inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@
from predbat import PredBat
from const import MINUTE_WATT, INVERTER_MAX_RETRY_REST
from inverter import Inverter, DISCHARGE_TARGET_UNSUPPORTED_MODELS
from config import INVERTER_DEF


def test_foxess_support_discharge_freeze_matches_foxcloud():
"""
FoxESS (modbus) and FoxCloud are the same hardware via two different connection methods - "feed-in
first"/freeze export does not hold SoC flat on either, PV above the export limit still charges the
battery instead of being clipped (#4207). FoxCloud's entry was already correctly False; FoxESS's was
left True, so execute.py's fetch_inverter_data() never disabled set_export_freeze/set_export_freeze_only
for modbus users, letting the planner offer a freeze option that couldn't actually do anything on the
real inverter.
"""
failed = False
if INVERTER_DEF["FoxESS"]["support_discharge_freeze"] is not False:
print("ERROR: FoxESS support_discharge_freeze should be False, got {}".format(INVERTER_DEF["FoxESS"]["support_discharge_freeze"]))
failed = True
if INVERTER_DEF["FoxESS"]["support_discharge_freeze"] != INVERTER_DEF["FoxCloud"]["support_discharge_freeze"]:
print("ERROR: FoxESS support_discharge_freeze ({}) should match FoxCloud ({}) - same hardware, different connection method".format(INVERTER_DEF["FoxESS"]["support_discharge_freeze"], INVERTER_DEF["FoxCloud"]["support_discharge_freeze"]))
failed = True
return failed


def dummy_sleep(seconds):
Expand Down Expand Up @@ -2539,6 +2559,7 @@ def run_inverter_tests(my_predbat_dummy):

failed = False
print("**** Running Inverter tests ****")
failed |= test_foxess_support_discharge_freeze_matches_foxcloud()
ha = my_predbat.ha_interface

time_now = my_predbat.now_utc.strftime("%Y-%m-%dT%H:%M:%S%z")
Expand Down
Loading