Skip to content

Commit 6e293fd

Browse files
committed
add config options
1 parent 72f2751 commit 6e293fd

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

config/batcontrol_config_dummy.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ consumption_forecast:
9494
type: csv
9595
csv:
9696
annual_consumption: 4500 # total consumption in kWh p.a. the load profile
97-
load_profile: load_profile.csv #name of the load profile file within the config folder
97+
load_profile: load_profile.csv # name of the load profile file within the config folder
98+
solar_web_export: SolarWeb.xlsx # Excel export from Solar Web, if file exists & load_profile doesn't, then a new one is generated from the export
9899

99100
#--------------------------
100101
# evcc connection

src/batcontrol/core.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,17 @@ def __init__(self, configdict: dict):
118118
self.timezone,
119119
config['consumption_forecast']
120120
)
121+
# TODO
122+
# self.load_profile = config['consumption_forecast']['load_profile']
123+
# self.solar_web_export = config['consumption_forecast']['solar_web_export']
124+
# try:
125+
# annual_consumption = config['consumption_forecast']['annual_consumption']
126+
# except KeyError:
127+
# # default setting
128+
# annual_consumption = 0
129+
#
130+
# self.fc_consumption = forecastconsumption.ForecastConsumption(
131+
# self.load_profile, timezone, annual_consumption )
121132

122133
self.batconfig = config['battery_control']
123134
self.time_at_forecast_error = -1
@@ -224,6 +235,46 @@ def shutdown(self):
224235
except:
225236
pass
226237

238+
# TODO
239+
# Check if solar_web_export is provided and if the load_profile file does not exist
240+
# if 'solar_web_export' in config['consumption_forecast']:
241+
# solar_web_export_path = 'config/' + config['consumption_forecast'][
242+
# 'solar_web_export']
243+
#
244+
# load_profile_path = config['consumption_forecast']['load_profile']
245+
#
246+
# if os.path.isfile(solar_web_export_path) and not os.path.isfile(load_profile_path):
247+
# forecastconsumption.SolarWebExportProcessor(solar_web_export_path,load_profile_path)
248+
#
249+
# if not os.path.isfile(config['consumption_forecast']['load_profile']):
250+
# raise RuntimeError(
251+
# "[Config] Specified Load Profile file " +
252+
# f"'{config['consumption_forecast']['load_profile']}' not found"
253+
# )
254+
#
255+
# try:
256+
# config['consumption_forecast']['solar_web_export'] = 'config/' + \
257+
# config['consumption_forecast']['solar_web_export']
258+
# except:
259+
# logger.info(
260+
# "[Config] No Solar Web Export provided.")
261+
#
262+
# # # Check if the load profile exists
263+
# # if not os.path.isfile(config['consumption_forecast']['solar_web_export']):
264+
# # logger.info(f"[Config] Load profile '{self.load_profile}' not found.")
265+
# # solar_web_export = config['consumption_forecast'].get('solar_web_export')
266+
# # if solar_web_export and os.path.isfile(solar_web_export):
267+
# # # Generate the load profile from Solar Web export
268+
# # logger.info(
269+
# # f"[Config] Generating load profile from Solar Web export: {solar_web_export}")
270+
# # self.generate_load_profile_from_solar_web(solar_web_export, load_profile)
271+
# # else:
272+
# # raise RuntimeError(
273+
# # f"[Config] No load profile found and no valid SolarWeb export file provided. "
274+
# # f"Could not create '{load_profile}'"
275+
# # )
276+
# #
277+
227278
def reset_forecast_error(self):
228279
""" Reset the forecast error timer """
229280
self.time_at_forecast_error = -1

0 commit comments

Comments
 (0)