This only started to happen once the grid price went to -0.02
Currently infeasible.
@markpurcell the p_deferrable_nom is reading a crazy values compared to what I injected (1800W), but now its fine after positive prices.
In saying that I do self curtail with Node Red and Home Assistant, not sure if EMHASS saw no production in my photovoltics sensor and freaked out.
post_mpc_optim_solcast: >
curl -i -H "Content-Type: application/json" -X POST -d '{
"load_cost_forecast": {{ (
[states('sensor.general_price')|float(0) | round(2)] +
state_attr('sensor.general_forecast', 'forecasts') | map(attribute='per_kwh') | map('round', 2) | list
)|tojson }},
"prod_price_forecast": {{ (
[states('sensor.feed_in_price')|float(0) | round(2)] +
state_attr('sensor.feed_in_forecast', 'forecasts') | map(attribute='per_kwh') | map('round', 2) | list
)|tojson }},
"pv_power_forecast": {{ states('sensor.solcast_24hrs_forecast_watts') }},
"prediction_horizon": 24,
"num_def_loads": 1,
"p_deferrable_nom": [1800],
"soc_init": {{ (states('sensor.powerwall_charge')|float(0) / 100)|tojson }},
"soc_final": 0.20,
"def_total_hours": [2],
"def_load_start": [0],
"def_load_end": [95]
}' http://localhost:5000/action/naive-mpc-optim
Template render
post_mpc_optim_solcast: >
curl -i -H "Content-Type: application/json" -X POST -d '{
"load_cost_forecast": [0.04, 0.28, 0.33, 0.71, 0.71, 0.73, 0.58, 0.55, 0.53, 0.52, 0.49, 0.26, 0.22, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.15, 0.12, 0.11, 0.12, 0.13, 0.11, 0.11, 0.15, 0.16, 0.43, 0.52, 1.37, 12.2, 19.58, 19.51, 12.2, 1.37, 1.37, 1.3, 1.3, 0.45, 0.45, 0.36, 0.36, 0.36, 0.36, 0.45, 0.36, 0.36, 1.28],
"prod_price_forecast": [-0.05, 0.12, 0.17, 0.3, 0.3, 0.31, 0.19, 0.15, 0.13, 0.13, 0.1, 0.1, 0.06, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.0, -0.02, -0.04, -0.03, -0.02, -0.04, -0.04, 0.0, 0.01, 0.25, 0.33, 1.11, 10.96, 17.67, 17.6, 10.96, 1.11, 1.11, 1.1, 1.1, 0.32, 0.32, 0.24, 0.24, 0.24, 0.24, 0.32, 0.24, 0.24, 1.08],
"pv_power_forecast": [1195, 2685, 2864, 1971, 634, 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, 0, 246, 1310, 2655, 3757, 4540, 5172, 5593, 5821, 5788, 5669, 5506, 5269, 4881, 4354],
"prediction_horizon": 24,
"num_def_loads": 1,
"p_deferrable_nom": [1800],
"soc_init": 1.0,
"soc_final": 0.20,
"def_total_hours": [2],
"def_load_start": [0],
"def_load_end": [95]
}' http://localhost:5000/action/naive-mpc-optim
The logs
2024-06-11 15:33:00,362 - web_server - INFO - Passed runtime parameters: {'load_cost_forecast': [0.04, 0.28, 0.32, 0.72, 0.59, 0.66, 0.56, 0.55, 0.52, 0.51, 0.46, 0.25, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.15, 0.13, 0.12, 0.12, 0.12, 0.11, 0.11, 0.11, 0.12, 0.16, 0.36, 0.5, 12.2, 19.51, 19.58, 19.58, 19.39, 12.2, 12.2, 19.32, 12.14, 1.3, 1.3, 0.45, 0.45, 0.36, 0.45, 1.28, 0.36, 0.37, 1.33], 'prod_price_forecast': [-0.05, 0.12, 0.15, 0.31, 0.2, 0.26, 0.16, 0.15, 0.13, 0.12, 0.07, 0.09, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.0, -0.02, -0.02, -0.03, -0.02, -0.03, -0.03, -0.03, -0.02, 0.01, 0.19, 0.32, 10.96, 17.6, 17.67, 17.67, 17.49, 10.96, 10.96, 17.48, 10.95, 1.1, 1.1, 0.32, 0.32, 0.24, 0.32, 1.08, 0.24, 0.25, 1.12], 'pv_power_forecast': [1195, 2685, 2864, 1971, 634, 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, 0, 246, 1310, 2655, 3757, 4540, 5172, 5593, 5821, 5788, 5669, 5506, 5269, 4881, 4354], 'prediction_horizon': 24, 'num_def_loads': 1, 'p_deferrable_nom': [1800], 'soc_init': 0.99, 'soc_final': 0.2, 'def_total_hours': [2], 'def_load_start': [0], 'def_load_end': [95]}
2024-06-11 15:33:00,362 - web_server - INFO - >> Setting input data dict
2024-06-11 15:33:00,362 - web_server - INFO - Setting up needed data
2024-06-11 15:33:00,364 - web_server - INFO - Retrieve hass get data method initiated...
2024-06-11 15:33:00,691 - web_server - INFO - Retrieving weather forecast data using method = list
2024-06-11 15:33:00,692 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2024-06-11 15:33:00,692 - web_server - INFO - Retrieve hass get data method initiated...
2024-06-11 15:33:01,319 - web_server - INFO - >> Performing naive MPC optimization...
2024-06-11 15:33:01,319 - web_server - INFO - Performing naive MPC optimization
2024-06-11 15:33:01,329 - web_server - INFO - Perform an iteration of a naive MPC controller
2024-06-11 15:33:01,391 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> 0
2024-06-11 15:33:01,391 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> 0
2024-06-11 15:33:01,401 - web_server - WARNING - Solver default unknown, using default
Welcome to the CBC MILP Solver
Version: 2.10.3
Build Date: Dec 15 2019
command line - /usr/local/lib/python3.11/dist-packages/pulp/solverdir/cbc/linux/64/cbc /tmp/9e44a74fa299472c8547dea7a970ba30-pulp.mps -max -timeMode elapsed -branch -printingOptions all -solution /tmp/9e44a74fa299472c8547dea7a970ba30-pulp.sol (default strategy 1)
At line 2 NAME MODEL
At line 3 ROWS
At line 435 COLUMNS
At line 2777 RHS
At line 3208 BOUNDS
At line 3497 ENDATA
Problem MODEL has 430 rows, 264 columns and 2030 elements
Coin0008I MODEL read with 0 errors
Option for timeMode changed from cpu to elapsed
Problem is infeasible - 0.00 seconds
Option for printingOptions changed from normal to all
Total time (CPU seconds): 0.00 (Wallclock seconds): 0.00
2024-06-11 15:33:01,414 - web_server - INFO - Status: Infeasible
2024-06-11 15:33:01,414 - web_server - INFO - Total value of the Cost function = -1.03
2024-06-11 15:33:01,594 - web_server - INFO - Passed runtime parameters: {}
2024-06-11 15:33:01,594 - web_server - INFO - >> Setting input data dict
2024-06-11 15:33:01,594 - web_server - INFO - Setting up needed data
2024-06-11 15:33:01,595 - web_server - INFO - >> Publishing data...
2024-06-11 15:33:01,596 - web_server - INFO - Publishing data to HASS instance
2024-06-11 15:33:01,605 - web_server - INFO - Successfully posted to sensor.p_pv_forecast = 827.24
2024-06-11 15:33:01,612 - web_server - INFO - Successfully posted to sensor.p_load_forecast = 1068.03
2024-06-11 15:33:01,618 - web_server - INFO - Successfully posted to sensor.p_pv_curtailment = 0.0
2024-06-11 15:33:01,625 - web_server - INFO - Successfully posted to sensor.p_deferrable0 = -240.78
2024-06-11 15:33:01,632 - web_server - INFO - Successfully posted to sensor.p_batt_forecast = 0.0
2024-06-11 15:33:01,638 - web_server - INFO - Successfully posted to sensor.soc_batt_forecast = 99.0
2024-06-11 15:33:01,645 - web_server - INFO - Successfully posted to sensor.p_grid_forecast = 0.0
2024-06-11 15:33:01,651 - web_server - INFO - Successfully posted to sensor.total_cost_fun_value = 0.89
2024-06-11 15:33:01,656 - web_server - INFO - Successfully posted to sensor.optim_status = Infeasible
2024-06-11 15:33:01,663 - web_server - INFO - Successfully posted to sensor.unit_load_cost = 0.04
2024-06-11 15:33:01,670 - web_server - INFO - Successfully posted to sensor.unit_prod_price = -0.05