diff --git a/apps/predbat/prediction.py b/apps/predbat/prediction.py index 2eaeb607..edfbae67 100644 --- a/apps/predbat/prediction.py +++ b/apps/predbat/prediction.py @@ -695,7 +695,7 @@ def run_prediction(self, charge_limit, charge_window, export_window, export_limi pv_dc = 0 diff = get_diff(0, pv_dc, pv_ac, load_yesterday, inverter_loss) - required_for_load = load_yesterday / inverter_loss_ac + required_for_load = load_yesterday / inverter_loss if inverter_hybrid: potential_to_charge = pv_now else: diff --git a/apps/predbat/unit_test.py b/apps/predbat/unit_test.py index 4b1e3357..b1fdbf45 100644 --- a/apps/predbat/unit_test.py +++ b/apps/predbat/unit_test.py @@ -2906,6 +2906,9 @@ def run_model_tests(my_predbat): failed |= simple_scenario("load_only", my_predbat, 1, 0, assert_final_metric=import_rate * 24, assert_final_soc=0, with_battery=False) failed |= simple_scenario("load_bat_ac", my_predbat, 4, 0, assert_final_metric=import_rate * 24 * 3.2, assert_final_soc=100 - 24, with_battery=True, battery_soc=100.0, inverter_loss=0.8) failed |= simple_scenario("load_bat_dc", my_predbat, 4, 0, assert_final_metric=import_rate * 24 * 3.2, assert_final_soc=100 - 24, with_battery=True, battery_soc=100.0, inverter_loss=0.8, hybrid=True) + failed |= simple_scenario("load_bat_ac2", my_predbat, 0.5, 0, assert_final_metric=0, assert_final_soc=100 - 12 / 0.8, with_battery=True, battery_soc=100.0, inverter_loss=0.8) + failed |= simple_scenario("load_bat_dc2", my_predbat, 0.5, 0, assert_final_metric=0, assert_final_soc=100 - 12 / 0.8, with_battery=True, battery_soc=100.0, inverter_loss=0.8, hybrid=True) + failed |= simple_scenario( "load_bat_dc_pv", my_predbat,