Hi everyone,
Can someone explain how I can solve the infeasible message?
2023-08-02 10:00:00,503 - web_server - INFO - Publishing data to HASS instance
2023-08-02 10:00:00,689 - web_server - INFO - Successfully posted to sensor.p_pv_forecast = 1514
2023-08-02 10:00:00,796 - web_server - INFO - Successfully posted to sensor.p_load_forecast = 425.42
2023-08-02 10:00:00,808 - web_server - INFO - Successfully posted to sensor.p_deferrable0 = 0.0
2023-08-02 10:00:00,820 - web_server - INFO - Successfully posted to sensor.p_deferrable1 = 0.0
2023-08-02 10:00:00,888 - web_server - INFO - Successfully posted to sensor.p_batt_forecast = 0.0
2023-08-02 10:00:00,926 - web_server - INFO - Successfully posted to sensor.soc_batt_forecast = 30.0
2023-08-02 10:00:00,958 - web_server - INFO - Successfully posted to sensor.p_grid_forecast = -1088.58
2023-08-02 10:00:00,979 - web_server - INFO - Successfully posted to sensor.total_cost_fun_value = 4.71
2023-08-02 10:00:00,990 - web_server - INFO - Successfully posted to sensor.unit_load_cost = 0.269
2023-08-02 10:00:01,022 - web_server - INFO - Successfully posted to sensor.unit_prod_price = 0.269
2023-08-02 10:00:01,210 - web_server - INFO - Retrieving weather forecast data using method = list
2023-08-02 10:00:01,211 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2023-08-02 10:00:01,211 - web_server - INFO - Retrieve hass get data method initiated...
2023-08-02 10:00:04,161 - web_server - INFO - >> Performing naive MPC optimization...
2023-08-02 10:00:04,161 - web_server - INFO - Performing naive MPC optimization
2023-08-02 10:00:04,166 - web_server - INFO - Perform an iteration of a naive MPC controller
2023-08-02 10:00:04,197 - web_server - INFO - Status: Infeasible
2023-08-02 10:00:04,198 - web_server - INFO - Total value of the Cost function = 5.3
my mpc:
naive_mpc_optim:
url: http://localhost:5000/action/naive-mpc-optim
method: POST
content_type: 'application/json'
payload: >-
{
"prod_price_forecast": {{
((state_attr('sensor.nordpool_kwh_nl_eur_3_09_0', 'raw_today') | map(attribute='value') | list + state_attr('sensor.nordpool_kwh_nl_eur_3_09_0', 'raw_tomorrow') | map(attribute='value') | list))[now().hour:][:24]
| tojson
}},
"load_cost_forecast": {{
((state_attr('sensor.nordpool_kwh_nl_eur_3_09_0', 'raw_today') | map(attribute='value') | list + state_attr('sensor.nordpool_kwh_nl_eur_3_09_0', 'raw_tomorrow') | map(attribute='value') | list))[now().hour:][:24]
| tojson
}},
"pv_power_forecast": {{([states('sensor.solaredge_ac_power')|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(12, (((state_attr('sensor.nordpool_kwh_nl_eur_3_09_0', 'raw_today')|map(attribute='value')|list + state_attr('sensor.nordpool_kwh_nl_eur_3_09_0', 'raw_tomorrow') | map(attribute='value')| list))|length)+1)
}},
"alpha": 1,
"beta": 0,
"num_def_loads": 2,
"def_total_hours": [{{states('input_number.def_total_hours_ev')}},
{{states('input_number.def_total_hours_ww')}}],
"treat_def_as_semi_cont": [1,1],
"set_def_constant": [0,0],
"soc_init": {{ (states('sensor.sofarcontroller_battery_soc')|int(0))/100 }},
"soc_final": 0.05
}```