From ace643a246251a618d05f86f4746b7fa45a525f9 Mon Sep 17 00:00:00 2001 From: john whately <18461782+GeoDerp@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:49:04 +1030 Subject: [PATCH] Runtime add no(dis)charge parameters --- src/emhass/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/emhass/utils.py b/src/emhass/utils.py index d7e3367b..01042452 100644 --- a/src/emhass/utils.py +++ b/src/emhass/utils.py @@ -517,12 +517,17 @@ def treat_runtimeparams(runtimeparams: str, params: str, retrieve_hass_conf: dic ] if 'def_load_config' in runtimeparams: optim_conf["def_load_config"] = runtimeparams['def_load_config'] + # Battery if 'weight_battery_discharge' in runtimeparams.keys(): optim_conf['weight_battery_discharge'] = runtimeparams[ 'weight_battery_discharge' ] if 'weight_battery_charge' in runtimeparams.keys(): optim_conf['weight_battery_charge'] = runtimeparams['weight_battery_charge'] + if 'set_nocharge_from_grid' in runtimeparams.keys(): + optim_conf['set_nocharge_from_grid'] = bool(runtimeparams['set_nocharge_from_grid']) + if 'set_nodischarge_to_grid' in runtimeparams.keys(): + optim_conf['set_nodischarge_to_grid'] = bool(runtimeparams['set_nodischarge_to_grid']) # Treat retrieve data from Home Assistant (retrieve_hass_conf) configuration parameters passed at runtime if 'optimization_time_step' in runtimeparams.keys() or 'freq' in runtimeparams.keys():