I’ve just started so my configuration may be seriously wrong, but it appears to have generated the result that seemingly reasonable/logical. However, the MPC will only run when maximum_power_from_grid is NOT 0 and must have at least 1000W. Otherwise I got the “infeasible” error and I have no idea what or where went wrong. @davidusb, really keen if you can help or assist in validating if there is anything wrong with my config or point me the in right direction to resolve this.
'costfun': 'profit',
'prediction_horizon': 576,
'optimization_time_step': 5,
'delta_forecast_daily': 2,
'set_use_pv': True,
'set_use_battery': True,
'inverter_is_hybrid': True,
'number_of_deferrable_loads': 1,
'set_nodischarge_to_grid': False,
'logging_level': 'debug',
'lp_solver_timeout': 45,
'compute_curtailment': True,
'nominal_power_of_deferrable_loads': [5000],
'operating_hours_of_each_deferrable_load': [4],
'start_timesteps_of_each_deferrable_load': [-148],
'end_timesteps_of_each_deferrable_load': [-28],
'treat_deferrable_load_as_semi_cont': [False],
'set_deferrable_load_single_constant': [True]
'weight_battery_charge': 0.1,
'weight_battery_discharge': 0.1,
'battery_minimum_state_of_charge': 0.5,
'battery_nominal_energy_capacity': 40300,
'battery_charge_power_max': 21000,
'battery_discharge_power_max': 24000,
'maximum_power_from_grid': **1000,**
'maximum_power_to_grid': 5000,
'inverter_ac_output_max': 9999,
'inverter_ac_input_max': 9999,
'soc_init': 0.796,
'soc_final': 0.5,
'load_cost_forecast': {'2026-02-18T00:00:00+11:00': 0.2001, '2026-02-18T00:05:00+11:00': 0.2001, '2026-02-18T00:10:00+11:00': 0.2001, '2026-02-18T00:15:00+11:00': 0.2001, '2026-02-18T00:20:00+11:00': 0.2001, '2026-02-18T00:25:00+11:00': 0.2001, '2026-02-18T00:30:00+11:00': 0.2001, '2026-02-18T00:35:00+11:00': 0.2001, '2026-02-18T00:40:00+11:00': 0.2001, '2026-02-18T00:45:00+11:00': 0.2001, '2026-02-18T00:50:00+11:00': 0.2001, '2026-02-18T00:55:00+11:00': 0.2001, '2026-02-18T01:00:00+11:00': 0.2001, '2026-02-18T01:05:00+11:00': 0.2001, '2026-02-18T01:10:00+11:00': 0.2001, '2026-02-18T01:15:00+11:00': 0.2001, '2026-02-18T01:20:00+11:00': 0.2001, '2026-02-18T01:25:00+11:00': 0.2001, '2026-02-18T01:30:00+11:00': 0.2001, '2026-02-18T01:35:00+11:00': 0.2001, '2026-02-18T01:40:00+11:00': 0.2001, '2026-02-18T01:45:00+11:00': 0.2001, '2026-02-18T01:50:00+11:00': 0.2001, '2026-02-18T01:55:00+11:00': 0.2001, '2026-02-18T02:00:00+11:00': 0.2001, '2026-02-18T02:05:00+11:00': 0.2001, '2026-02-18T02:10:00+11:00': 0.2001, '2026-02-18T02:15:00+11:00': 0.2001, '2026-02-18T02:20:00+11:00': 0.2001, '2026-02-18T02:25:00+11:00': 0.2001, '2026-02-18T02:30:00+11:00': 0.2001, '2026-02-18T02:35:00+11:00': 0.2001, '2026-02-18T02:40:00+11:00': 0.2001, '2026-02-18T02:45:00+11:00': 0.2001, '2026-02-18T02:50:00+11:00': 0.2001, '2026-02-18T02:55:00+11:00': 0.2001, '2026-02-18T03:00:00+11:00': 0.2001, '2026-02-18T03:05:00+11:00': 0.2001, '2026-02-18T03:10:00+11:00': 0.2001, '2026-02-18T03:15:00+11:00': 0.2001, '2026-02-18T03:20:00+11:00': 0.2001, '2026-02-18T03:25:00+11:00': 0.2001, '2026-02-18T03:30:00+11:00': 0.2001, '2026-02-18T03:35:00+11:00': 0.2001, '2026-02-18T03:40:00+11:00': 0.2001, '2026-02-18T03:45:00+11:00': 0.2001, '2026-02-18T03:50:00+11:00': 0.2001, '2026-02-18T03:55:00+11:00': 0.2001, '2026-02-18T04:00:00+11:00': 0.2001, '2026-02-18T04:05:00+11:00': 0.2001, '2026-02-18T04:10:00+11:00': 0.2001, '2026-02-18T04:15:00+11:00': 0.2001, '2026-02-18T04:20:00+11:00': 0.2001, '2026-02-18T04:25:00+11:00': 0.2001, '2026-02-18T04:30:00+11:00': 0.2001, '2026-02-18T04:35:00+11:00': 0.2001, '2026-02-18T04:40:00+11:00': 0.2001, '2026-02-18T04:45:00+11:00': 0.2001, '2026-02-18T04:50:00+11:00': 0.2001, '2026-02-18T04:55:00+11:00': 0.2001, '2026-02-18T05:00:00+11:00': 0.2001, '2026-02-18T05:05:00+11:00': 0.2001, '2026-02-18T05:10:00+11:00': 0.2001, '2026-02-18T05:15:00+11:00': 0.2001, '2026-02-18T05:20:00+11:00': 0.2001, '2026-02-18T05:25:00+11:00': 0.2001, '2026-02-18T05:30:00+11:00': 0.2001, '2026-02-18T05:35:00+11:00': 0.2001, '2026-02-18T05:40:00+11:00': 0.2001, '2026-02-18T05:45:00+11:00': 0.2001, '2026-02-18T05:50:00+11:00': 0.2001, '2026-02-18T05:55:00+11:00': 0.2001, '2026-02-18T06:00:00+11:00': 0.3001, '2026-02-18T06:05:00+11:00': 0.3001, '2026-02-18T06:10:00+11:00': 0.3001, '2026-02-18T06:15:00+11:00': 0.3001, '2026-02-18T06:20:00+11:00': 0.3001, '2026-02-18T06:25:00+11:00': 0.3001, '2026-02-18T06:30:00+11:00': 0.3001, '2026-02-18T06:35:00+11:00': 0.3001, '2026-02-18T06:40:00+11:00': 0.3001, '2026-02-18T06:45:00+11:00': 0.3001, '2026-02-18T06:50:00+11:00': 0.3001, '2026-02-18T06:55:00+11:00': 0.3001, '2026-02-18T07:00:00+11:00': 0.3001, '2026-02-18T07:05:00+11:00': 0.3001, '2026-02-18T07:10:00+11:00': 0.3001, '2026-02-18T07:15:00+11:00': 0.3001, '2026-02-18T07:20:00+11:00': 0.3001, '2026-02-18T07:25:00+11:00': 0.3001, '2026-02-18T07:30:00+11:00': 0.3001, '2026-02-18T07:35:00+11:00': 0.3001, '2026-02-18T07:40:00+11:00': 0.3001, '2026-02-18T07:45:00+11:00': 0.3001, '2026-02-18T07:50:00+11:00': 0.3001, '2026-02-18T07:55:00+11:00': 0.3001, '2026-02-18T08:00:00+11:00': 0.3001, '2026-02-18T08:05:00+11:00': 0.3001, '2026-02-18T08:10:00+11:00': 0.3001, '2026-02-18T08:15:00+11:00': 0.3001, '2026-02-18T08:20:00+11:00': 0.3001, '2026-02-18T08:25:00+11:00': 0.3001, '2026-02-18T08:30:00+11:00': 0.3001, '2026-02-18T08:35:00+11:00': 0.3001, '2026-02-18T08:40:00+11:00': 0.3001, '2026-02-18T08:45:00+11:00': 0.3001, '2026-02-18T08:50:00+11:00': 0.3001, '2026-02-18T08:55:00+11:00': 0.3001, '2026-02-18T09:00:00+11:00': 0.3001, '2026-02-18T09:05:00+11:00': 0.3001, '2026-02-18T09:10:00+11:00': 0.3001, '2026-02-18T09:15:00+11:00': 0.3001, '2026-02-18T09:20:00+11:00': 0.3001, '2026-02-18T09:25:00+11:00': 0.3001, '2026-02-18T09:30:00+11:00': 0.3001, '2026-02-18T09:35:00+11:00': 0.3001, '2026-02-18T09:40:00+11:00': 0.3001, '2026-02-18T09:45:00+11:00': 0.3001, '2026-02-18T09:50:00+11:00': 0.3001, '2026-02-18T09:55:00+11:00': 0.3001, '2026-02-18T10:00:00+11:00': 0.3001, '2026-02-18T10:05:00+11:00': 0.3001, '2026-02-18T10:10:00+11:00': 0.3001, '2026-02-18T10:15:00+11:00': 0.3001, '2026-02-18T10:20:00+11:00': 0.3001, '2026-02-18T10:25:00+11:00': 0.3001, '2026-02-18T10:30:00+11:00': 0.3001, '2026-02-18T10:35:00+11:00': 0.3001, '2026-02-18T10:40:00+11:00': 0.3001, '2026-02-18T10:45:00+11:00': 0.3001, '2026-02-18T10:50:00+11:00': 0.3001, '2026-02-18T10:55:00+11:00': 0.3001, '2026-02-18T11:00:00+11:00': 0.3001, '2026-02-18T11:05:00+11:00': 0.3001, '2026-02-18T11:10:00+11:00': 0.3001, '2026-02-18T11:15:00+11:00': 0.3001, '2026-02-18T11:20:00+11:00': 0.3001, '2026-02-18T11:25:00+11:00': 0.3001, '2026-02-18T11:30:00+11:00': 0.3001, '2026-02-18T11:35:00+11:00': 0.3001, '2026-02-18T11:40:00+11:00': 0.3001, '2026-02-18T11:45:00+11:00': 0.3001, '2026-02-18T11:50:00+11:00': 0.3001, '2026-02-18T11:55:00+11:00': 0.3001, '2026-02-18T12:00:00+11:00': 0.3001, '2026-02-18T12:05:00+11:00': 0.3001, '2026-02-18T12:10:00+11:00': 0.3001, '2026-02-18T12:15:00+11:00': 0.3001, '2026-02-18T12:20:00+11:00': 0.3001, '2026-02-18T12:25:00+11:00': 0.3001, '2026-02-18T12:30:00+11:00': 0.3001, '2026-02-18T12:35:00+11:00': 0.3001, '2026-02-18T12:40:00+11:00': 0.3001, '2026-02-18T12:45:00+11:00': 0.3001, '2026-02-18T12:50:00+11:00': 0.3001, '2026-02-18T12:55:00+11:00': 0.3001, '2026-02-18T13:00:00+11:00': 0.3001, '2026-02-18T13:05:00+11:00': 0.3001, '2026-02-18T13:10:00+11:00': 0.3001, '2026-02-18T13:15:00+11:00': 0.3001, '2026-02-18T13:20:00+11:00': 0.3001, '2026-02-18T13:25:00+11:00': 0.3001, '2026-02-18T13:30:00+11:00': 0.3001, '2026-02-18T13:35:00+11:00': 0.3001, '2026-02-18T13:40:00+11:00': 0.3001, '2026-02-18T13:45:00+11:00': 0.3001, '2026-02-18T13:50:00+11:00': 0.3001, '2026-02-18T13:55:00+11:00': 0.3001, '2026-02-18T14:00:00+11:00': 0.3001, '2026-02-18T14:05:00+11:00': 0.3001, '2026-02-18T14:10:00+11:00': 0.3001, '2026-02-18T14:15:00+11:00': 0.3001, '2026-02-18T14:20:00+11:00': 0.3001, '2026-02-18T14:25:00+11:00': 0.3001, '2026-02-18T14:30:00+11:00': 0.3001, '2026-02-18T14:35:00+11:00': 0.3001, '2026-02-18T14:40:00+11:00': 0.3001, '2026-02-18T14:45:00+11:00': 0.3001, '2026-02-18T14:50:00+11:00': 0.3001, '2026-02-18T14:55:00+11:00': 0.3001, '2026-02-18T15:00:00+11:00': 0.3001, '2026-02-18T15:05:00+11:00': 0.3001, '2026-02-18T15:10:00+11:00': 0.3001, '2026-02-18T15:15:00+11:00': 0.3001, '2026-02-18T15:20:00+11:00': 0.3001, '2026-02-18T15:25:00+11:00': 0.3001, '2026-02-18T15:30:00+11:00': 0.3001, '2026-02-18T15:35:00+11:00': 0.3001, '2026-02-18T15:40:00+11:00': 0.3001, '2026-02-18T15:45:00+11:00': 0.3001, '2026-02-18T15:50:00+11:00': 0.3001, '2026-02-18T15:55:00+11:00': 0.3001, '2026-02-18T16:00:00+11:00': 0.3001, '2026-02-18T16:05:00+11:00': 0.3001, '2026-02-18T16:10:00+11:00': 0.3001, '2026-02-18T16:15:00+11:00': 0.3001, '2026-02-18T16:20:00+11:00': 0.3001, '2026-02-18T16:25:00+11:00': 0.3001, '2026-02-18T16:30:00+11:00': 0.3001, '2026-02-18T16:35:00+11:00': 0.3001, '2026-02-18T16:40:00+11:00': 0.3001, '2026-02-18T16:45:00+11:00': 0.3001, '2026-02-18T16:50:00+11:00': 0.3001, '2026-02-18T16:55:00+11:00': 0.3001, '2026-02-18T17:00:00+11:00': 0.3001, '2026-02-18T17:05:00+11:00': 0.3001, '2026-02-18T17:10:00+11:00': 0.3001, '2026-02-18T17:15:00+11:00': 0.3001, '2026-02-18T17:20:00+11:00': 0.3001, '2026-02-18T17:25:00+11:00': 0.3001, '2026-02-18T17:30:00+11:00': 0.3001, '2026-02-18T17:35:00+11:00': 0.3001, '2026-02-18T17:40:00+11:00': 0.3001, '2026-02-18T17:45:00+11:00': 0.3001, '2026-02-18T17:50:00+11:00': 0.3001, '2026-02-18T17:55:00+11:00': 0.3001, '2026-02-18T18:00:00+11:00': 0.3001, '2026-02-18T18:05:00+11:00': 0.3001, '2026-02-18T18:10:00+11:00': 0.3001, '2026-02-18T18:15:00+11:00': 0.3001, '2026-02-18T18:20:00+11:00': 0.3001, '2026-02-18T18:25:00+11:00': 0.3001, '2026-02-18T18:30:00+11:00': 0.3001, '2026-02-18T18:35:00+11:00': 0.3001, '2026-02-18T18:40:00+11:00': 0.3001, '2026-02-18T18:45:00+11:00': 0.3001, '2026-02-18T18:50:00+11:00': 0.3001, '2026-02-18T18:55:00+11:00': 0.3001, '2026-02-18T19:00:00+11:00': 0.3001, '2026-02-18T19:05:00+11:00': 0.3001, '2026-02-18T19:10:00+11:00': 0.3001, '2026-02-18T19:15:00+11:00': 0.3001, '2026-02-18T19:20:00+11:00': 0.3001, '2026-02-18T19:25:00+11:00': 0.3001, '2026-02-18T19:30:00+11:00': 0.3001, '2026-02-18T19:35:00+11:00': 0.3001, '2026-02-18T19:40:00+11:00': 0.3001, '2026-02-18T19:45:00+11:00': 0.3001, '2026-02-18T19:50:00+11:00': 0.3001, '2026-02-18T19:55:00+11:00': 0.3001, '2026-02-18T20:00:00+11:00': 0.3001, '2026-02-18T20:05:00+11:00': 0.3001, '2026-02-18T20:10:00+11:00': 0.3001, '2026-02-18T20:15:00+11:00': 0.3001, '2026-02-18T20:20:00+11:00': 0.3001, '2026-02-18T20:25:00+11:00': 0.3001, '2026-02-18T20:30:00+11:00': 0.3001, '2026-02-18T20:35:00+11:00': 0.3001, '2026-02-18T20:40:00+11:00': 0.3001, '2026-02-18T20:45:00+11:00': 0.3001, '2026-02-18T20:50:00+11:00': 0.3001, '2026-02-18T20:55:00+11:00': 0.3001, '2026-02-18T21:00:00+11:00': 0.3001, '2026-02-18T21:05:00+11:00': 0.3001, '2026-02-18T21:10:00+11:00': 0.3001, '2026-02-18T21:15:00+11:00': 0.3001, '2026-02-18T21:20:00+11:00': 0.3001, '2026-02-18T21:25:00+11:00': 0.3001, '2026-02-18T21:30:00+11:00': 0.3001, '2026-02-18T21:35:00+11:00': 0.3001, '2026-02-18T21:40:00+11:00': 0.3001, '2026-02-18T21:45:00+11:00': 0.3001, '2026-02-18T21:50:00+11:00': 0.3001, '2026-02-18T21:55:00+11:00': 0.3001, '2026-02-18T22:00:00+11:00': 0.3001, '2026-02-18T22:05:00+11:00': 0.3001, '2026-02-18T22:10:00+11:00': 0.3001, '2026-02-18T22:15:00+11:00': 0.3001, '2026-02-18T22:20:00+11:00': 0.3001, '2026-02-18T22:25:00+11:00': 0.3001, '2026-02-18T22:30:00+11:00': 0.3001, '2026-02-18T22:35:00+11:00': 0.3001, '2026-02-18T22:40:00+11:00': 0.3001, '2026-02-18T22:45:00+11:00': 0.3001, '2026-02-18T22:50:00+11:00': 0.3001, '2026-02-18T22:55:00+11:00': 0.3001, '2026-02-18T23:00:00+11:00': 0.3001, '2026-02-18T23:05:00+11:00': 0.3001, '2026-02-18T23:10:00+11:00': 0.3001, '2026-02-18T23:15:00+11:00': 0.3001, '2026-02-18T23:20:00+11:00': 0.3001, '2026-02-18T23:25:00+11:00': 0.3001, '2026-02-18T23:30:00+11:00': 0.3001, '2026-02-18T23:35:00+11:00': 0.3001, '2026-02-18T23:40:00+11:00': 0.3001, '2026-02-18T23:45:00+11:00': 0.3001, '2026-02-18T23:50:00+11:00': 0.3001, '2026-02-18T23:55:00+11:00': 0.3001, '2026-02-19T00:00:00+11:00': 0.2001, '2026-02-19T00:05:00+11:00': 0.2001, '2026-02-19T00:10:00+11:00': 0.2001, '2026-02-19T00:15:00+11:00': 0.2001, '2026-02-19T00:20:00+11:00': 0.2001, '2026-02-19T00:25:00+11:00': 0.2001, '2026-02-19T00:30:00+11:00': 0.2001, '2026-02-19T00:35:00+11:00': 0.2001, '2026-02-19T00:40:00+11:00': 0.2001, '2026-02-19T00:45:00+11:00': 0.2001, '2026-02-19T00:50:00+11:00': 0.2001, '2026-02-19T00:55:00+11:00': 0.2001, '2026-02-19T01:00:00+11:00': 0.2001, '2026-02-19T01:05:00+11:00': 0.2001, '2026-02-19T01:10:00+11:00': 0.2001, '2026-02-19T01:15:00+11:00': 0.2001, '2026-02-19T01:20:00+11:00': 0.2001, '2026-02-19T01:25:00+11:00': 0.2001, '2026-02-19T01:30:00+11:00': 0.2001, '2026-02-19T01:35:00+11:00': 0.2001, '2026-02-19T01:40:00+11:00': 0.2001, '2026-02-19T01:45:00+11:00': 0.2001, '2026-02-19T01:50:00+11:00': 0.2001, '2026-02-19T01:55:00+11:00': 0.2001, '2026-02-19T02:00:00+11:00': 0.2001, '2026-02-19T02:05:00+11:00': 0.2001, '2026-02-19T02:10:00+11:00': 0.2001, '2026-02-19T02:15:00+11:00': 0.2001, '2026-02-19T02:20:00+11:00': 0.2001, '2026-02-19T02:25:00+11:00': 0.2001, '2026-02-19T02:30:00+11:00': 0.2001, '2026-02-19T02:35:00+11:00': 0.2001, '2026-02-19T02:40:00+11:00': 0.2001, '2026-02-19T02:45:00+11:00': 0.2001, '2026-02-19T02:50:00+11:00': 0.2001, '2026-02-19T02:55:00+11:00': 0.2001, '2026-02-19T03:00:00+11:00': 0.2001, '2026-02-19T03:05:00+11:00': 0.2001, '2026-02-19T03:10:00+11:00': 0.2001, '2026-02-19T03:15:00+11:00': 0.2001, '2026-02-19T03:20:00+11:00': 0.2001, '2026-02-19T03:25:00+11:00': 0.2001, '2026-02-19T03:30:00+11:00': 0.2001, '2026-02-19T03:35:00+11:00': 0.2001, '2026-02-19T03:40:00+11:00': 0.2001, '2026-02-19T03:45:00+11:00': 0.2001, '2026-02-19T03:50:00+11:00': 0.2001, '2026-02-19T03:55:00+11:00': 0.2001, '2026-02-19T04:00:00+11:00': 0.2001, '2026-02-19T04:05:00+11:00': 0.2001, '2026-02-19T04:10:00+11:00': 0.2001, '2026-02-19T04:15:00+11:00': 0.2001, '2026-02-19T04:20:00+11:00': 0.2001, '2026-02-19T04:25:00+11:00': 0.2001, '2026-02-19T04:30:00+11:00': 0.2001, '2026-02-19T04:35:00+11:00': 0.2001, '2026-02-19T04:40:00+11:00': 0.2001, '2026-02-19T04:45:00+11:00': 0.2001, '2026-02-19T04:50:00+11:00': 0.2001, '2026-02-19T04:55:00+11:00': 0.2001, '2026-02-19T05:00:00+11:00': 0.2001, '2026-02-19T05:05:00+11:00': 0.2001, '2026-02-19T05:10:00+11:00': 0.2001, '2026-02-19T05:15:00+11:00': 0.2001, '2026-02-19T05:20:00+11:00': 0.2001, '2026-02-19T05:25:00+11:00': 0.2001, '2026-02-19T05:30:00+11:00': 0.2001, '2026-02-19T05:35:00+11:00': 0.2001, '2026-02-19T05:40:00+11:00': 0.2001, '2026-02-19T05:45:00+11:00': 0.2001, '2026-02-19T05:50:00+11:00': 0.2001, '2026-02-19T05:55:00+11:00': 0.2001, '2026-02-19T06:00:00+11:00': 0.3001, '2026-02-19T06:05:00+11:00': 0.3001, '2026-02-19T06:10:00+11:00': 0.3001, '2026-02-19T06:15:00+11:00': 0.3001, '2026-02-19T06:20:00+11:00': 0.3001, '2026-02-19T06:25:00+11:00': 0.3001, '2026-02-19T06:30:00+11:00': 0.3001, '2026-02-19T06:35:00+11:00': 0.3001, '2026-02-19T06:40:00+11:00': 0.3001, '2026-02-19T06:45:00+11:00': 0.3001, '2026-02-19T06:50:00+11:00': 0.3001, '2026-02-19T06:55:00+11:00': 0.3001, '2026-02-19T07:00:00+11:00': 0.3001, '2026-02-19T07:05:00+11:00': 0.3001, '2026-02-19T07:10:00+11:00': 0.3001, '2026-02-19T07:15:00+11:00': 0.3001, '2026-02-19T07:20:00+11:00': 0.3001, '2026-02-19T07:25:00+11:00': 0.3001, '2026-02-19T07:30:00+11:00': 0.3001, '2026-02-19T07:35:00+11:00': 0.3001, '2026-02-19T07:40:00+11:00': 0.3001, '2026-02-19T07:45:00+11:00': 0.3001, '2026-02-19T07:50:00+11:00': 0.3001, '2026-02-19T07:55:00+11:00': 0.3001, '2026-02-19T08:00:00+11:00': 0.3001, '2026-02-19T08:05:00+11:00': 0.3001, '2026-02-19T08:10:00+11:00': 0.3001, '2026-02-19T08:15:00+11:00': 0.3001, '2026-02-19T08:20:00+11:00': 0.3001, '2026-02-19T08:25:00+11:00': 0.3001, '2026-02-19T08:30:00+11:00': 0.3001, '2026-02-19T08:35:00+11:00': 0.3001, '2026-02-19T08:40:00+11:00': 0.3001, '2026-02-19T08:45:00+11:00': 0.3001, '2026-02-19T08:50:00+11:00': 0.3001, '2026-02-19T08:55:00+11:00': 0.3001, '2026-02-19T09:00:00+11:00': 0.3001, '2026-02-19T09:05:00+11:00': 0.3001, '2026-02-19T09:10:00+11:00': 0.3001, '2026-02-19T09:15:00+11:00': 0.3001, '2026-02-19T09:20:00+11:00': 0.3001, '2026-02-19T09:25:00+11:00': 0.3001, '2026-02-19T09:30:00+11:00': 0.3001, '2026-02-19T09:35:00+11:00': 0.3001, '2026-02-19T09:40:00+11:00': 0.3001, '2026-02-19T09:45:00+11:00': 0.3001, '2026-02-19T09:50:00+11:00': 0.3001, '2026-02-19T09:55:00+11:00': 0.3001, '2026-02-19T10:00:00+11:00': 0.3001, '2026-02-19T10:05:00+11:00': 0.3001, '2026-02-19T10:10:00+11:00': 0.3001, '2026-02-19T10:15:00+11:00': 0.3001, '2026-02-19T10:20:00+11:00': 0.3001, '2026-02-19T10
:25:00+11:00': 0.3001, '2026-02-19T10:30:00+11:00': 0.3001, '2026-02-19T10:35:00+11:00': 0.3001, '2026-02-19T10:40:00+11:00': 0.3001, '2026-02-19T10:45:00+11:00': 0.3001, '2026-02-19T10:50:00+11:00': 0.3001, '2026-02-19T10:55:00+11:00': 0.3001, '2026-02-19T11:00:00+11:00': 0.3001, '2026-02-19T11:05:00+11:00': 0.3001, '2026-02-19T11:10:00+11:00': 0.3001, '2026-02-19T11:15:00+11:00': 0.3001, '2026-02-19T11:20:00+11:00': 0.3001, '2026-02-19T11:25:00+11:00': 0.3001, '2026-02-19T11:30:00+11:00': 0.3001, '2026-02-19T11:35:00+11:00': 0.3001, '2026-02-19T11:40:00+11:00': 0.3001, '2026-02-19T11:45:00+11:00': 0.3001, '2026-02-19T11:50:00+11:00': 0.3001, '2026-02-19T11:55:00+11:00': 0.3001, '2026-02-19T12:00:00+11:00': 0.3001, '2026-02-19T12:05:00+11:00': 0.3001, '2026-02-19T12:10:00+11:00': 0.3001, '2026-02-19T12:15:00+11:00': 0.3001, '2026-02-19T12:20:00+11:00': 0.3001, '2026-02-19T12:25:00+11:00': 0.3001, '2026-02-19T12:30:00+11:00': 0.3001, '2026-02-19T12:35:00+11:00': 0.3001, '2026-02-19T12:40:00+11:00': 0.3001, '2026-02-19T12:45:00+11:00': 0.3001, '2026-02-19T12:50:00+11:00': 0.3001, '2026-02-19T12:55:00+11:00': 0.3001, '2026-02-19T13:00:00+11:00': 0.3001, '2026-02-19T13:05:00+11:00': 0.3001, '2026-02-19T13:10:00+11:00': 0.3001, '2026-02-19T13:15:00+11:00': 0.3001, '2026-02-19T13:20:00+11:00': 0.3001, '2026-02-19T13:25:00+11:00': 0.3001, '2026-02-19T13:30:00+11:00': 0.3001, '2026-02-19T13:35:00+11:00': 0.3001, '2026-02-19T13:40:00+11:00': 0.3001, '2026-02-19T13:45:00+11:00': 0.3001, '2026-02-19T13:50:00+11:00': 0.3001, '2026-02-19T13:55:00+11:00': 0.3001, '2026-02-19T14:00:00+11:00': 0.3001, '2026-02-19T14:05:00+11:00': 0.3001, '2026-02-19T14:10:00+11:00': 0.3001, '2026-02-19T14:15:00+11:00': 0.3001, '2026-02-19T14:20:00+11:00': 0.3001, '2026-02-19T14:25:00+11:00': 0.3001, '2026-02-19T14:30:00+11:00': 0.3001, '2026-02-19T14:35:00+11:00': 0.3001, '2026-02-19T14:40:00+11:00': 0.3001, '2026-02-19T14:45:00+11:00': 0.3001, '2026-02-19T14:50:00+11:00': 0.3001, '2026-02-19T14:55:00+11:00': 0.3001, '2026-02-19T15:00:00+11:00': 0.3001, '2026-02-19T15:05:00+11:00': 0.3001, '2026-02-19T15:10:00+11:00': 0.3001, '2026-02-19T15:15:00+11:00': 0.3001, '2026-02-19T15:20:00+11:00': 0.3001, '2026-02-19T15:25:00+11:00': 0.3001, '2026-02-19T15:30:00+11:00': 0.3001, '2026-02-19T15:35:00+11:00': 0.3001, '2026-02-19T15:40:00+11:00': 0.3001, '2026-02-19T15:45:00+11:00': 0.3001, '2026-02-19T15:50:00+11:00': 0.3001, '2026-02-19T15:55:00+11:00': 0.3001, '2026-02-19T16:00:00+11:00': 0.3001, '2026-02-19T16:05:00+11:00': 0.3001, '2026-02-19T16:10:00+11:00': 0.3001, '2026-02-19T16:15:00+11:00': 0.3001, '2026-02-19T16:20:00+11:00': 0.3001, '2026-02-19T16:25:00+11:00': 0.3001, '2026-02-19T16:30:00+11:00': 0.3001, '2026-02-19T16:35:00+11:00': 0.3001, '2026-02-19T16:40:00+11:00': 0.3001, '2026-02-19T16:45:00+11:00': 0.3001, '2026-02-19T16:50:00+11:00': 0.3001, '2026-02-19T16:55:00+11:00': 0.3001, '2026-02-19T17:00:00+11:00': 0.3001, '2026-02-19T17:05:00+11:00': 0.3001, '2026-02-19T17:10:00+11:00': 0.3001, '2026-02-19T17:15:00+11:00': 0.3001, '2026-02-19T17:20:00+11:00': 0.3001, '2026-02-19T17:25:00+11:00': 0.3001, '2026-02-19T17:30:00+11:00': 0.3001, '2026-02-19T17:35:00+11:00': 0.3001, '2026-02-19T17:40:00+11:00': 0.3001, '2026-02-19T17:45:00+11:00': 0.3001, '2026-02-19T17:50:00+11:00': 0.3001, '2026-02-19T17:55:00+11:00': 0.3001, '2026-02-19T18:00:00+11:00': 0.3001, '2026-02-19T18:05:00+11:00': 0.3001, '2026-02-19T18:10:00+11:00': 0.3001, '2026-02-19T18:15:00+11:00': 0.3001, '2026-02-19T18:20:00+11:00': 0.3001, '2026-02-19T18:25:00+11:00': 0.3001, '2026-02-19T18:30:00+11:00': 0.3001, '2026-02-19T18:35:00+11:00': 0.3001, '2026-02-19T18:40:00+11:00': 0.3001, '2026-02-19T18:45:00+11:00': 0.3001, '2026-02-19T18:50:00+11:00': 0.3001, '2026-02-19T18:55:00+11:00': 0.3001, '2026-02-19T19:00:00+11:00': 0.3001, '2026-02-19T19:05:00+11:00': 0.3001, '2026-02-19T19:10:00+11:00': 0.3001, '2026-02-19T19:15:00+11:00': 0.3001, '2026-02-19T19:20:00+11:00': 0.3001, '2026-02-19T19:25:00+11:00': 0.3001, '2026-02-19T19:30:00+11:00': 0.3001, '2026-02-19T19:35:00+11:00': 0.3001, '2026-02-19T19:40:00+11:00': 0.3001, '2026-02-19T19:45:00+11:00': 0.3001, '2026-02-19T19:50:00+11:00': 0.3001, '2026-02-19T19:55:00+11:00': 0.3001, '2026-02-19T20:00:00+11:00': 0.3001, '2026-02-19T20:05:00+11:00': 0.3001, '2026-02-19T20:10:00+11:00': 0.3001, '2026-02-19T20:15:00+11:00': 0.3001, '2026-02-19T20:20:00+11:00': 0.3001, '2026-02-19T20:25:00+11:00': 0.3001, '2026-02-19T20:30:00+11:00': 0.3001, '2026-02-19T20:35:00+11:00': 0.3001, '2026-02-19T20:40:00+11:00': 0.3001, '2026-02-19T20:45:00+11:00': 0.3001, '2026-02-19T20:50:00+11:00': 0.3001, '2026-02-19T20:55:00+11:00': 0.3001, '2026-02-19T21:00:00+11:00': 0.3001, '2026-02-19T21:05:00+11:00': 0.3001, '2026-02-19T21:10:00+11:00': 0.3001, '2026-02-19T21:15:00+11:00': 0.3001, '2026-02-19T21:20:00+11:00': 0.3001, '2026-02-19T21:25:00+11:00': 0.3001, '2026-02-19T21:30:00+11:00': 0.3001, '2026-02-19T21:35:00+11:00': 0.3001, '2026-02-19T21:40:00+11:00': 0.3001, '2026-02-19T21:45:00+11:00': 0.3001, '2026-02-19T21:50:00+11:00': 0.3001, '2026-02-19T21:55:00+11:00': 0.3001, '2026-02-19T22:00:00+11:00': 0.3001, '2026-02-19T22:05:00+11:00': 0.3001, '2026-02-19T22:10:00+11:00': 0.3001, '2026-02-19T22:15:00+11:00': 0.3001, '2026-02-19T22:20:00+11:00': 0.3001, '2026-02-19T22:25:00+11:00': 0.3001, '2026-02-19T22:30:00+11:00': 0.3001, '2026-02-19T22:35:00+11:00': 0.3001, '2026-02-19T22:40:00+11:00': 0.3001, '2026-02-19T22:45:00+11:00': 0.3001, '2026-02-19T22:50:00+11:00': 0.3001, '2026-02-19T22:55:00+11:00': 0.3001, '2026-02-19T23:00:00+11:00': 0.3001, '2026-02-19T23:05:00+11:00': 0.3001, '2026-02-19T23:10:00+11:00': 0.3001, '2026-02-19T23:15:00+11:00': 0.3001, '2026-02-19T23:20:00+11:00': 0.3001, '2026-02-19T23:25:00+11:00': 0.3001, '2026-02-19T23:30:00+11:00': 0.3001, '2026-02-19T23:35:00+11:00': 0.3001, '2026-02-19T23:40:00+11:00': 0.3001, '2026-02-19T23:45:00+11:00': 0.3001, '2026-02-19T23:50:00+11:00': 0.3001, '2026-02-19T23:55:00+11:00': 0.3001}, 'prod_price_forecast': {'2026-02-18T00:00:00+11:00': 0.1, '2026-02-19T00:00:00+11:00': 0.1}
'pv_power_forecast': {'2026-02-18T22:20:51+11:00': 0, '2026-02-18T22:30:00+11:00': 0, '2026-02-18T23:00:00+11:00': 0, '2026-02-18T23:30:00+11:00': 0, '2026-02-19T00:00:00+11:00': 0, '2026-02-19T00:30:00+11:00': 0, '2026-02-19T01:00:00+11:00': 0, '2026-02-19T01:30:00+11:00': 0, '2026-02-19T02:00:00+11:00': 0, '2026-02-19T02:30:00+11:00': 0, '2026-02-19T03:00:00+11:00': 0, '2026-02-19T03:30:00+11:00': 0, '2026-02-19T04:00:00+11:00': 0, '2026-02-19T04:30:00+11:00': 0, '2026-02-19T05:00:00+11:00': 0, '2026-02-19T05:30:00+11:00': 0, '2026-02-19T06:00:00+11:00': 0, '2026-02-19T06:30:00+11:00': 0, '2026-02-19T07:00:00+11:00': 237, '2026-02-19T07:30:00+11:00': 1324, '2026-02-19T08:00:00+11:00': 2709, '2026-02-19T08:30:00+11:00': 3944, '2026-02-19T09:00:00+11:00': 5038, '2026-02-19T09:30:00+11:00': 5979, '2026-02-19T10:00:00+11:00': 6661, '2026-02-19T10:30:00+11:00': 7206, '2026-02-19T11:00:00+11:00': 7628, '2026-02-19T11:30:00+11:00': 7955, '2026-02-19T12:00:00+11:00': 8102, '2026-02-19T12:30:00+11:00': 8001, '2026-02-19T13:00:00+11:00': 7946, '2026-02-19T13:30:00+11:00': 7845, '2026-02-19T14:00:00+11:00': 7764, '2026-02-19T14:30:00+11:00': 7646, '2026-02-19T15:00:00+11:00': 7329
'load_power_forecast': {'2026-02-18T22:20:51+11:00': 2235, '2026-02-18T23:00:00+11:00': 1935, '2026-02-19T00:00:00+11:00': 1872, '2026-02-19T01:00:00+11:00': 1628, '2026-02-19T02:00:00+11:00': 1500, '2026-02-19T03:00:00+11:00': 373, '2026-02-19T04:00:00+11:00': 361, '2026-02-19T05:00:00+11:00': 292, '2026-02-19T06:00:00+11:00': 251, '2026-02-19T07:00:00+11:00': 818, '2026-02-19T08:00:00+11:00': 892, '2026-02-19T09:00:00+11:00': 269, '2026-02-19T10:00:00+11:00': 275, '2026-02-19T11:00:00+11:00': 286, '2026-02-19T12:00:00+11:00': 1400, '2026-02-19T13:00:00+11:00': 5713, '2026-02-19T14:00:00+11:00': 5213, '2026-02-19T15:00:00+11:00': 4772, '2026-02-19T16:00:00+11:00': 1172, '2026-02-19T17:00:00+11:00': 4521, '2026-02-19T18:00:00+11:00': 2153, '2026-02-19T19:00:00+11:00': 1920, '2026-02-19T20:00:00+11:00': 1509, '2026-02-19T21:00:00+11:00': 1681, '2026-02-19T22:00:00+11:00': 1113, '2026-02-19T23:00:00+11:00': 545, '2026-02-20T00:00:00+11:00': 577, '2026-02-20T01:00:00+11:00': 919, '2026-02-20T02:00:00+11:00': 677, '2026-02-20T03:00:00+11:00': 324, '2026-02-20T04:00:00+11:00': 301, '2026-02-20T05:00:00+11:00': 299, '2026-02-20T06:00:00+11:00': 677, '2026-02-20T07:00:00+11:00': 1730, '2026-02-20T08:00:00+11:00': 333, '2026-02-20T09:00:00+11:00': 327, '2026-02-20T10:00:00+11:00': 301, '2026-02-20T11:00:00+11:00': 365, '2026-02-20T12:00:00+11:00': 338, '2026-02-20T13:00:00+11:00': 273, '2026-02-20T14:00:00+11:00': 258, '2026-02-20T15:00:00+11:00': 276, '2026-02-20T16:00:00+11:00': 317, '2026-02-20T17:00:00+11:00': 3527, '2026-02-20T18:00:00+11:00': 3367, '2026-02-20T19:00:00+11:00': 1974, '2026-02-20T20:00:00+11:00': 2242, '2026-02-20T21:00:00+11:00': 2152}}
When maximum_power_from_grid is set to 0, below are the messages I get and the optimisation is not complete (no data published)
[2026-02-18 22:19:21,795] INFO in command_line: Setting up needed data
[2026-02-18 22:19:21,944] INFO in retrieve_hass: get HA config from rest api.
[2026-02-18 22:19:21,956] INFO in forecast: Retrieving weather forecast data using method = list
[2026-02-18 22:19:21,965] INFO in web_server: >> Performing naive-mpc-optim...
[2026-02-18 22:19:21,965] INFO in command_line: Performing naive MPC optimization
[2026-02-18 22:19:22,079] INFO in optimization: Perform an iteration of a naive MPC controller
[2026-02-18 22:19:22,086] INFO in optimization: Building CVXPY problem structure...
[2026-02-18 22:19:31,781] WARNING in optimization: **Optimization failed with status: 'infeasible'. Retrying with relaxed constraints (Continuous LP)...**
[2026-02-18 22:19:31,787] INFO in optimization: Solving relaxed problem (LP)...
[2026-02-18 22:19:32,224] ERROR in optimization: Relaxed optimization also failed with status: infeasible
[2026-02-18 22:19:32,225] WARNING in optimization: Cost function cannot be evaluated or Infeasible/Unbounded
[2026-02-18 22:19:32,546] INFO in web_server: >> Setting input data dict
[2026-02-18 22:19:32,546] INFO in command_line: Setting up needed data
[2026-02-18 22:19:32,557] INFO in retrieve_hass: get HA config from rest api.
[2026-02-18 22:19:32,568] INFO in web_server: >> Publishing data...
[2026-02-18 22:19:32,568] INFO in command_line: Publishing data to HASS instance
[2026-02-18 22:19:32,581] ERROR in app: Exception on request POST /action/publish-data
Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 3641, in get_loc
return self._engine.get_loc(casted_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pandas/_libs/index.pyx", line 168, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 197, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 7668, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 7676, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'P_PV'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/quart/app.py", line 1464, in handle_request
return await self.full_dispatch_request(request_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/quart/app.py", line 1502, in full_dispatch_request
result = await self.handle_user_exception(error)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/quart/app.py", line 1059, in handle_user_exception
raise error
File "/app/.venv/lib/python3.12/site-packages/quart/app.py", line 1500, in full_dispatch_request
result = await self.dispatch_request(request_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/quart/app.py", line 1597, in dispatch_request
return await self.ensure_async(handler)(**request_.view_args) # type: ignore[return-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/src/emhass/web_server.py", line 652, in action_call
msg, status = await _handle_action_dispatch(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/src/emhass/web_server.py", line 506, in _handle_action_dispatch
_ = await publish_data(input_data_dict, logger)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/src/emhass/command_line.py", line 2034, in publish_data
cols_published.extend(await _publish_standard_forecasts(ctx, opt_res_latest))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/src/emhass/command_line.py", line 1731, in _publish_standard_forecasts
opt_res_latest["P_PV"],
~~~~~~~~~~~~~~^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/pandas/core/frame.py", line 4378, in __getitem__
indexer = self.columns.get_loc(key)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 3648, in get_loc
raise KeyError(key) from err
KeyError: 'P_PV'