Skip to content

Commit

Permalink
Added the initial needed changes to make PV optional
Browse files Browse the repository at this point in the history
  • Loading branch information
davidusb-geek committed Dec 28, 2024
1 parent 9b3e10c commit 7d50e4b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/emhass/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,15 @@ def set_input_data_dict(
P_PV_forecast, P_load_forecast, df_input_data_dayahead = None, None, None
elif set_type == "dayahead-optim":
# Get PV and load forecasts
df_weather = fcst.get_weather_forecast(
method=optim_conf["weather_forecast_method"]
)
if isinstance(df_weather, bool) and not df_weather:
return False
P_PV_forecast = fcst.get_power_from_weather(df_weather)
if optim_conf['set_use_pv']:
df_weather = fcst.get_weather_forecast(
method=optim_conf["weather_forecast_method"]
)
if isinstance(df_weather, bool) and not df_weather:
return False
P_PV_forecast = fcst.get_power_from_weather(df_weather)
else:
P_PV_forecast = pd.Series(0, index=fcst.forecast_dates)
P_load_forecast = fcst.get_load_forecast(
method=optim_conf["load_forecast_method"]
)
Expand Down Expand Up @@ -241,14 +244,17 @@ def set_input_data_dict(
return False
df_input_data = rh.df_final.copy()
# Get PV and load forecasts
df_weather = fcst.get_weather_forecast(
method=optim_conf["weather_forecast_method"]
)
if isinstance(df_weather, bool) and not df_weather:
return False
P_PV_forecast = fcst.get_power_from_weather(
df_weather, set_mix_forecast=True, df_now=df_input_data
)
if optim_conf['set_use_pv']:
df_weather = fcst.get_weather_forecast(
method=optim_conf["weather_forecast_method"]
)
if isinstance(df_weather, bool) and not df_weather:
return False
P_PV_forecast = fcst.get_power_from_weather(
df_weather, set_mix_forecast=True, df_now=df_input_data
)
else:
P_PV_forecast = pd.Series(0, index=fcst.forecast_dates)
P_load_forecast = fcst.get_load_forecast(
method=optim_conf["load_forecast_method"],
set_mix_forecast=True,
Expand Down
1 change: 1 addition & 0 deletions src/emhass/data/associations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ params_secrets,lon,Longitude
params_secrets,alt,Altitude
optim_conf,costfun,costfun
optim_conf,logging_level,logging_level
optim_conf,set_use_pv,set_use_pv
optim_conf,set_use_battery,set_use_battery
optim_conf,num_def_loads,number_of_deferrable_loads
optim_conf,P_deferrable_nom,nominal_power_of_deferrable_loads,list_nominal_power_of_deferrable_loads
Expand Down
1 change: 1 addition & 0 deletions src/emhass/data/config_defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"photovoltaic_production_sell_price": 0.1419,
"maximum_power_from_grid": 9000,
"maximum_power_to_grid": 9000,
"set_use_pv": false,
"pv_module_model": [
"CSUN_Eurasia_Energy_Systems_Industry_and_Trade_CSUN295_60M"
],
Expand Down
6 changes: 6 additions & 0 deletions src/emhass/static/data/param_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@
}
},
"Solar System (PV)": {
"set_use_pv": {
"friendly_name": "Enable PV system",
"Description": "Set to True if we should consider an solar PV system. Defaults to False",
"input": "boolean",
"default_value": false
},
"pv_module_model": {
"friendly_name": "PV module model name",
"Description": "The PV module model. This parameter can be a list of items to enable the simulation of mixed orientation systems.",
Expand Down

0 comments on commit 7d50e4b

Please sign in to comment.