Anybody understand what these errors mean?
2023-07-28 16:42:20,021 - web_server - INFO - Retrieve hass get data method initiated...
2023-07-28 16:42:20,654 - web_server - ERROR - Exception on /action/naive-mpc-optim [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/usr/local/lib/python3.9/dist-packages/emhass/web_server.py", line 174, in action_call
input_data_dict = set_input_data_dict(config_path, str(data_path), costfun,
File "/usr/local/lib/python3.9/dist-packages/emhass/command_line.py", line 110, in set_input_data_dict
rh.get_data(days_list, var_list,
File "/usr/local/lib/python3.9/dist-packages/emhass/retrieve_hass.py", line 140, in get_data
df_tp = df_raw.copy()[['state']].replace(
File "/usr/local/lib/python3.9/dist-packages/pandas/core/generic.py", line 5920, in astype
new_data = self._mgr.astype(dtype=dtype, copy=copy, errors=errors)
File "/usr/local/lib/python3.9/dist-packages/pandas/core/internals/managers.py", line 419, in astype
return self.apply("astype", dtype=dtype, copy=copy, errors=errors)
File "/usr/local/lib/python3.9/dist-packages/pandas/core/internals/managers.py", line 304, in apply
applied = getattr(b, f)(**kwargs)
File "/usr/local/lib/python3.9/dist-packages/pandas/core/internals/blocks.py", line 580, in astype
new_values = astype_array_safe(values, dtype, copy=copy, errors=errors)
File "/usr/local/lib/python3.9/dist-packages/pandas/core/dtypes/cast.py", line 1292, in astype_array_safe
new_values = astype_array(values, dtype, copy=copy)
File "/usr/local/lib/python3.9/dist-packages/pandas/core/dtypes/cast.py", line 1237, in astype_array
values = astype_nansafe(values, dtype, copy=copy)
File "/usr/local/lib/python3.9/dist-packages/pandas/core/dtypes/cast.py", line 1098, in astype_nansafe
result = astype_nansafe(flat, dtype, copy=copy, skipna=skipna)
File "/usr/local/lib/python3.9/dist-packages/pandas/core/dtypes/cast.py", line 1181, in astype_nansafe
return arr.astype(dtype, copy=True)
ValueError: could not convert string to float: 'NOTRUN'
2023-07-28 16:42:20,687 - web_server - INFO - Setting up needed data
2023-07-28 16:42:20,690 - web_server - INFO - >> Publishing data...
2023-07-28 16:42:20,690 - web_server - INFO - Publishing data to HASS instance
2023-07-28 16:42:20,705 - web_server - INFO - Successfully posted to sensor.p_pv_forecast = 17.0
2023-07-28 16:42:20,716 - web_server - INFO - Successfully posted to sensor.p_load_forecast = 2587.03
2023-07-28 16:42:20,727 - web_server - INFO - Successfully posted to sensor.p_deferrable0 = 0.0
2023-07-28 16:42:20,740 - web_server - INFO - Successfully posted to sensor.p_batt_forecast = 2054.05
2023-07-28 16:42:20,751 - web_server - INFO - Successfully posted to sensor.soc_batt_forecast = 88.38
2023-07-28 16:42:20,762 - web_server - INFO - Successfully posted to sensor.p_grid_forecast = 515.98
2023-07-28 16:42:20,774 - web_server - INFO - Successfully posted to sensor.total_cost_fun_value = 0.61
2023-07-28 16:42:20,785 - web_server - INFO - Successfully posted to sensor.unit_load_cost = 0.55
2023-07-28 16:42:20,798 - web_server - INFO - Successfully posted to sensor.unit_prod_price = 0.45
I restarted HA and now I’m getting these errors with each MPC POST? Didn’t change anything relating to EMHASS.
{"load_cost_forecast":{{(
([states('sensor.cecil_st_general_price')|float(0)] +
state_attr('sensor.cecil_st_general_forecast', 'forecasts') |map(attribute='per_kwh')|list)[:48])
}},
"prod_price_forecast":{{(
([states('sensor.cecil_st_feed_in_price')|float(0)] +
state_attr('sensor.cecil_st_feed_in_forecast', 'forecasts')|map(attribute='per_kwh')|list)[:48])
}},
"pv_power_forecast":{{([states('sensor.sonnenbatterie_84324_production_w')|int(0)] +
state_attr('sensor.forecast_today', 'detailedForecast')|selectattr('period_start','gt',utcnow()) | map(attribute='pv_estimate')|map('multiply',2000)|map('int')|list +
state_attr('sensor.forecast_tomorrow', 'detailedForecast')|selectattr('period_start','gt',utcnow()) | map(attribute='pv_estimate')|map('multiply',2000)|map('int')|list
)| tojson
}},
"prediction_horizon":{{min(48, (state_attr('sensor.cecil_st_feed_in_forecast', 'forecasts')|map(attribute='per_kwh')|list|length)+1)
}},
"soc_init":{{(states('sensor.sonnenbatterie_84324_state_charge_user')|float(0))/100
}},
{"load_cost_forecast":[0.56, 0.52, 0.58, 0.68, 0.69, 0.64, 0.62, 0.4, 0.29, 0.34, 0.31, 0.43, 0.43, 0.26, 0.26, 0.31, 0.27, 0.26, 0.26, 0.26, 0.23, 0.21, 0.2, 0.2, 0.17, 0.2, 0.2, 0.2, 0.23, 0.2, 0.18, 0.16, 0.13, 0.13, 0.13, 0.13, 0.07, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.36, 0.39, 0.39, 0.3, 0.32],
"prod_price_forecast":[0.46, 0.42, 0.48, 0.56, 0.57, 0.53, 0.51, 0.28, 0.18, 0.23, 0.2, 0.31, 0.31, 0.15, 0.15, 0.2, 0.16, 0.15, 0.15, 0.15, 0.13, 0.1, 0.1, 0.09, 0.07, 0.09, 0.09, 0.1, 0.13, 0.1, 0.08, 0.06, 0.04, 0.04, 0.04, 0.02, -0.04, -0.06, -0.06, -0.07, -0.07, -0.06, -0.06, 0.27, 0.3, 0.3, 0.22, 0.24],
"pv_power_forecast":[30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 414, 876, 1278, 1634, 1964, 2156, 2142, 2110, 2071, 1981, 1818, 1693, 1608, 1451, 1207, 929, 666, 256, 66, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"prediction_horizon":48,
"soc_init":0.94,
"soc_final":0.05,"def_total_hours":[2]}}
Thanks
Rob