I decided to try again the update.
This is the configuration following the update:
costfun: self-consumption
logging_level: DEBUG
set_total_pv_sell: false
set_nocharge_from_grid: false
set_nodischarge_to_grid: true
sensor_power_photovoltaics: sensor.production_pv_w
sensor_power_load_no_var_loads: sensor.consumption_filtered_w
number_of_deferrable_loads: 1
list_nominal_power_of_deferrable_loads:
- nominal_power_of_deferrable_loads: 0
list_operating_hours_of_each_deferrable_load:
- operating_hours_of_each_deferrable_load: 2
list_start_timesteps_of_each_deferrable_load:
- start_timesteps_of_each_deferrable_load: 0
list_end_timesteps_of_each_deferrable_load:
- end_timesteps_of_each_deferrable_load: 0
list_peak_hours_periods_start_hours:
- peak_hours_periods_start_hours: "07:00"
list_peak_hours_periods_end_hours:
- peak_hours_periods_end_hours: "23:00"
list_treat_deferrable_load_as_semi_cont:
- treat_deferrable_load_as_semi_cont: true
list_set_deferrable_load_single_constant:
- set_deferrable_load_single_constant: false
load_peak_hours_cost: 0.1907
load_offpeak_hours_cost: 0.1419
photovoltaic_production_sell_price: 0.065
maximum_power_from_grid: 5000
list_pv_module_model:
- pv_module_model: SunPower_SPR_E20_327
- pv_module_model: SunPower_SPR_P19_395_COM
list_pv_inverter_model:
- pv_inverter_model: SMA_America__SB3000TL_US_22__240V_
- pv_inverter_model: SMA_America__STP50_US_40__480V_
list_surface_tilt:
- surface_tilt: 17
- surface_tilt: 17
list_surface_azimuth:
- surface_azimuth: 225
- surface_azimuth: 225
list_modules_per_string:
- modules_per_string: 9
- modules_per_string: 14
list_strings_per_inverter:
- strings_per_inverter: 1
- strings_per_inverter: 1
set_use_battery: true
battery_nominal_energy_capacity: 27000
hass_url: empty
long_lived_token: empty
optimization_time_step: 30
historic_days_to_retrieve: 2
method_ts_round: first
lp_solver: COIN_CMD
lp_solver_path: /usr/bin/cbc
set_battery_dynamic: false
battery_dynamic_max: 0.9
battery_dynamic_min: -0.9
weight_battery_discharge: 0
weight_battery_charge: 0
load_forecast_method: naive
battery_discharge_power_max: 7100
battery_charge_power_max: 7100
battery_discharge_efficiency: 0.95
battery_charge_efficiency: 0.95
battery_minimum_state_of_charge: 0
battery_maximum_state_of_charge: 1
battery_target_state_of_charge: 0.3
Something I noticed right after the update is that the configuration was showing 2 start/end deferrable window items I had to manually re-align (see picture)
The command and automation are the same I posted above.
Still same error:
2024-01-30 10:01:05,561 - web_server - INFO - Setting up needed data
2024-01-30 10:01:05,563 - web_server - INFO - Retrieve hass get data method initiated...
2024-01-30 10:01:07,150 - web_server - ERROR - Exception on /action/naive-mpc-optim [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 1463, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 872, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 870, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 855, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/emhass/web_server.py", line 50, in action_call
input_data_dict = set_input_data_dict(config_path, str(data_path), costfun,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/emhass/command_line.py", line 112, in set_input_data_dict
rh.prepare_data(retrieve_hass_conf['var_load'], load_negative = retrieve_hass_conf['load_negative'],
File "/usr/local/lib/python3.11/dist-packages/emhass/retrieve_hass.py", line 208, in prepare_data
self.df_final[new_var_replace_zero] = self.df_final[new_var_replace_zero].fillna(0.0)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pandas/core/frame.py", line 3767, in __getitem__
indexer = self.columns._get_indexer_strict(key, "columns")[1]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pandas/core/indexes/base.py", line 5877, in _get_indexer_strict
self._raise_if_missing(keyarr, indexer, axis_name)
File "/usr/local/lib/python3.11/dist-packages/pandas/core/indexes/base.py", line 5938, in _raise_if_missing
raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Index(['s', 'e', 'n', 's', 'o', 'r', '.', 'p', 'r', 'o', 'd', 'u', 'c', 't',\n 'i', 'o', 'n', '_', 'p', 'v', '_', 'w'],\n dtype='object')] are in the [columns]"
Rolling back again for the moment.