I don’t really understand what’s going on, it’s been going on for a long time, but I’m seeing this now. It could be that I missed this now at this time as the new electricity prices for tomorrow do not arrive until after 13:00
2024-06-11 11:39:30,889 - web_server - ERROR - ERROR: The passed data is either not a list or the length is not correct, length should be 13
2024-06-11 11:39:30,889 - web_server - ERROR - Passed type is <class 'list'> and length is 1
2024-06-11 11:39:30,890 - web_server - INFO - Retrieve hass get data method initiated...
2024-06-11 11:39:31,450 - web_server - INFO - Retrieving weather forecast data using method = scrapper
2024-06-11 11:39:32,298 - web_server - ERROR - Exception on /action/naive-mpc-optim [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/pandas/core/indexes/base.py", line 3653, in get_loc
return self._engine.get_loc(casted_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pandas/_libs/index.pyx", line 147, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 176, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 7080, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'LONGI_Green_Energy_Technology_Co_Ltd_LR4_72HPH_72HPH_425M'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 865, 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 111, in action_call
input_data_dict = set_input_data_dict(emhass_conf, costfun,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/emhass/command_line.py", line 145, in set_input_data_dict
P_PV_forecast = fcst.get_power_from_weather(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/emhass/forecast.py", line 434, in get_power_from_weather
module = cec_modules[self.plant_conf['module_model'][i]]
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pandas/core/frame.py", line 3761, in __getitem__
indexer = self.columns.get_loc(key)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pandas/core/indexes/base.py", line 3655, in get_loc
raise KeyError(key) from err
KeyError: 'LONGI_Green_Energy_Technology_Co_Ltd_LR4_72HPH_72HPH_425M'
2024-06-11 11:39:34,318 - web_server - INFO - Passed runtime parameters: {}
2024-06-11 11:39:34,318 - web_server - INFO - >> Setting input data dict
2024-06-11 11:39:34,318 - web_server - INFO - Setting up needed data
2024-06-11 11:39:34,320 - web_server - INFO - >> Publishing data...
2024-06-11 11:39:34,320 - web_server - INFO - Publishing data to HASS instance
2024-06-11 11:39:34,343 - web_server - INFO - Successfully posted to sensor.p_pv_forecast = 5253.0
2024-06-11 11:39:34,350 - web_server - INFO - Successfully posted to sensor.p_load_forecast = 600.0
2024-06-11 11:39:34,357 - web_server - INFO - Successfully posted to sensor.p_pv_curtailment = 0.0
2024-06-11 11:39:34,364 - web_server - INFO - Successfully posted to sensor.p_deferrable0 = 0.0
2024-06-11 11:39:34,371 - web_server - INFO - Successfully posted to sensor.p_deferrable1 = 0.0
2024-06-11 11:39:34,378 - web_server - INFO - Successfully posted to sensor.p_deferrable2 = 0.0
2024-06-11 11:39:34,385 - web_server - INFO - Successfully posted to sensor.p_batt_forecast = 0.0
2024-06-11 11:39:34,392 - web_server - INFO - Successfully posted to sensor.soc_batt_forecast = 2.0
2024-06-11 11:39:34,399 - web_server - INFO - Successfully posted to sensor.p_grid_forecast = -4653.0
2024-06-11 11:39:34,406 - web_server - INFO - Successfully posted to sensor.total_cost_fun_value = 27.26
2024-06-11 11:39:34,411 - web_server - INFO - Successfully posted to sensor.optim_status = Optimal
2024-06-11 11:39:34,418 - web_server - INFO - Successfully posted to sensor.unit_load_cost = 0.58
2024-06-11 11:39:34,425 - web_server - INFO - Successfully posted to sensor.unit_prod_price = 0.58
2024-06-11 11:39:40,774 - web_server - INFO - EMHASS server online, serving index.html...
post_naive_mpc_shell_v3: >
curl -i -H "Content-Type: application/json" -X POST -d '{
"load_cost_forecast":{{((state_attr("sensor.nordpool_tibber", "raw_today") | map(attribute="value") | list + state_attr("sensor.nordpool_tibber", "raw_tomorrow") | map(attribute="value") | list))[now().hour:][:24] }},
"prod_price_forecast":{{((state_attr("sensor.nordpool_tibber", "raw_today") | map(attribute="value") | list + state_attr("sensor.nordpool_tibber", "raw_tomorrow") | map(attribute="value") | list))[now().hour:][:24] }},
"prediction_horizon":{{min(24, (((state_attr("sensor.nordpool_tibber", "raw_today")|map(attribute="value")|list + state_attr("sensor.nordpool_tibber", "raw_tomorrow") | map(attribute="value")| list)[now().hour:][:48]|list|length)))}},
"pv_power_forecast":{{([states("sensor.inverter_input_power")|int(0)] + state_attr("sensor.solcast_pv_forecast_forecast_today", "detailedHourly")|selectattr("period_start","gt",utcnow()) | map(attribute="pv_estimate")|map("multiply",1000)|map("int")|list + state_attr("sensor.solcast_pv_forecast_forecast_tomorrow", "detailedHourly")|selectattr("period_start","gt",utcnow()) | map(attribute="pv_estimate")|map("multiply",1000)|map("int")|list)| tojson}},
"load_power_forecast":{{[states('sensor.power_load_no_var_loads')|int] +(states('input_text.fi_fo_buffer').split(', ')|map('multiply',1000)|map('int')|list)[1:]}},
"soc_init":{{ max(0,states("sensor.battery_state_of_capacity")|int(0))/100 }},
"soc_final":{{ max(100,states("number.battery_end_of_discharge_soc")|int(0))/100 }},
"delta_forecast":2,
"def_total_hours":[{{ states('input_number.p_deffereble0_x_hours') | default(0) }},{{ states('sensor.p_deferrable1_hours') | default(0) }},{{ states('sensor.charger_def_hours') | default(0) }}],
"def_end_timestep": [0, 0, {{ max(0,states("sensor.emhass_deferrable2_end_timeslots")|int(0)) }}]
}' http://localhost:5000/action/naive-mpc-optim