Updated HHR storage recommendation for dual storage

This commit is contained in:
Khalim Conn-Kowlessar 2024-10-08 18:20:44 +01:00
parent 08b8124d0c
commit 83d56d9bc6
2 changed files with 23 additions and 1 deletions

View file

@ -86,6 +86,9 @@ class PlanTriggerRequest(BaseModel):
# exists in the portfolio, it will be ignored
multi_plan: Optional[bool] = False
# if False, allows optimisation to be switched off
optimise: Optional[bool] = False
_allowed_goals = {"Increasing EPC"}
_allowed_housing_types = {"Social", "Private"}

View file

@ -812,20 +812,37 @@ class HeatingRecommender:
new_heating_description = self.DUAL_HEATING_DESCRIPTIONS[
self.property.main_heating["clean_description"]
]["hhr"]["mainheating_description"]
new_hot_water_description = self.property.hotwater["clean_description"] # We keep the hot water system
else:
new_heating_description = "Electric storage heaters"
new_hot_water_description = "Electric immersion, off-peak"
# Set up artefacts, suitable for the simulation and regardless of controls
heating_ending_config = MainHeatAttributes(new_heating_description).process()
heating_simulation_config = check_simulation_difference(
new_config=heating_ending_config, old_config=self.property.main_heating
)
hot_water_end_config = HotWaterAttributes(new_hot_water_description).process()
hot_water_simulation_config = check_simulation_difference(
new_config=hot_water_end_config, old_config=self.property.hotwater
)
heating_simulation_config = {
**heating_simulation_config,
**hot_water_simulation_config
}
# This upgrade will only take the heating system to average energy efficiency
if self.property.data["mainheat-energy-eff"] in ["Very Poor", "Poor"]:
if self.property.data["mainheat-energy-eff"] in ["Very Poor", "Poor"] and not self.dual_heating:
heating_simulation_config["mainheat_energy_eff_ending"] = "Average"
else:
heating_simulation_config["mainheat_energy_eff_ending"] = self.property.data["mainheat-energy-eff"]
if self.property.data["hot-water-energy-eff"] in ["Very Poor", "Poor"]:
heating_simulation_config["hot_water_energy_eff_ending"] = "Average"
else:
heating_simulation_config["hot_water_energy_eff_ending"] = self.property.data["hot-water-energy-eff"]
# If the property is off-gas and has no heating system in place, the number of heated rooms will actually
# be 0, so we use the number of rooms as the figure
number_heated_rooms = (
@ -863,6 +880,8 @@ class HeatingRecommender:
heating_description_simulation = {
"mainheat-description": new_heating_description,
"mainheat-energy-eff": heating_simulation_config["mainheat_energy_eff_ending"],
"hotwater-description": new_hot_water_description,
"hot-water-energy-eff": heating_simulation_config["hot_water_energy_eff_ending"]
}
recommendations = self.combine_heating_and_controls(