Never say never, I have another EMHASS instance that I use the load power forecast to inject my air conditioner power consumption as a function of the external temp.(summer time here). Iāll just inject that into the other system and will be back up and runningā¦
rest_command:
naive_mpc_optim:
url: http://localhost:5000/action/naive-mpc-optim
method: POST
content_type: 'application/json'
payload: >-
{
"prod_price_forecast": {{
([states('sensor.amber_feed_in_price')|float(0)] +
(state_attr('sensor.amber_feed_in_forecast', 'forecasts')|map(attribute='per_kwh')|list))
| tojson
}},
"load_cost_forecast": {{
([states('sensor.amber_general_price')|float(0)] +
state_attr('sensor.amber_general_forecast', 'forecasts') |map(attribute='per_kwh')|list)
| tojson
}},
"load_power_forecast": {{
([states('sensor.power_load_no_var_loads')|int] +
states('sensor.hvac_power_forecast') | from_json | map('multiply', 1000) | list
)| tojson
}},
"pv_power_forecast": {{
([states('sensor.solaredge_nopowerlimit')|int(0)] +
state_attr('sensor.solcast_pv_forecast_forecast_today', 'detailedForecast')|selectattr('period_start','gt',utcnow()) | map(attribute='pv_estimate')|map('multiply',1000)|map('int')|list +
state_attr('sensor.solcast_pv_forecast_forecast_tomorrow', 'detailedForecast')|selectattr('period_start','gt',utcnow()) | map(attribute='pv_estimate')|map('multiply',1000)|map('int')|list
)| tojson
}},
"prediction_horizon": {{
min(48, (state_attr('sensor.amber_feed_in_forecast', 'forecasts')|map(attribute='per_kwh')|list|length)+1)
}},
"alpha": 1,
"beta": 0,
"num_def_loads": 6,
"def_total_hours": {{[states('sensor.def_total_hours_pool_filter')|int(0),
states('sensor.def_total_hours_pool_heatpump')|int(0),
states('sensor.def_total_hours_ev')|int(0),
states('sensor.def_total_hours_hvac')|int(0),
states('sensor.def_total_hours_hws')|int(0),
states('sensor.def_total_hours_ev2')|int(0)]}},
"P_deferrable_nom": [945,
6000,
{{ states('sensor.p_nom_ev')}},
{{ states('input_number.p_nom_hvac')}},
600,
{{ states('sensor.p_nom_ev2')}}],
"treat_def_as_semi_cont": [1, 1, 0, 0, 1, 0],
"set_def_constant": [0, 1, 0, 0, 0, 0],
"soc_init": {{ (states('sensor.gateway_battery')|int(0))/100 }},
"soc_final": {{ max(20,states('sensor.gateway_battery')|int(0))/100 }}
}
rest_command:
naive_mpc_optim:
url: http://localhost:5000/action/naive-mpc-optim
method: POST
content_type: 'application/json'
payload: >-
{
"prod_price_forecast": [0.98, 0.41, 0.39, 0.39, 0.39, 0.27, 0.26, 0.3, 0.27, 0.15, 0.09, 0.15, 0.09, 0.09, 0.09, 0.09, 0.07, 0.07, 0.07, 0.08, 0.09, 0.1, 0.09, 0.07, 0.04, 0.02, 0.02, 0.02, 0.0, 0.02, -0.02, -0.02, -0.02, -0.03, -0.03, -0.02, -0.02, -0.01, 0.02, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.07, 0.1, 0.38, 0.4],
"load_cost_forecast": [1.3, 0.67, 0.64, 0.64, 0.64, 0.38, 0.37, 0.41, 0.38, 0.24, 0.18, 0.24, 0.18, 0.18, 0.18, 0.18, 0.16, 0.16, 0.15, 0.17, 0.18, 0.19, 0.18, 0.15, 0.12, 0.1, 0.1, 0.1, 0.08, 0.1, 0.05, 0.05, 0.05, 0.04, 0.04, 0.05, 0.05, 0.06, 0.1, 0.11, 0.11, 0.11, 0.12, 0.26, 0.26, 0.29, 0.33, 0.63, 0.66],
"load_power_forecast": [2807, 1500.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 1000.0, 3000.0, 3000.0, 4500.0, 4500.0, 6000.0, 6000.0, 7500.0, 7500.0, 7500.0, 7500.0, 7500.0, 7500.0, 6000.0, 6000.0, 6000.0, 6000.0, 4500.0, 4500.0, 4500.0, 4500.0, 1500.0],
"pv_power_forecast": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 309, 1208, 2715, 4413, 6219, 7914, 9403, 10719, 11896, 12549, 13124, 13664, 13849, 13738, 13456, 13112, 12831, 12543, 11513, 10360, 9309, 7769, 5973, 4218, 2336, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"prediction_horizon": 48,
"alpha": 1,
"beta": 0,
"num_def_loads": 6,
"def_total_hours": [7, 4, 0, 0, 6, 6],
"P_deferrable_nom": [945,
6000,
7680,
0.0,
600,
7680],
"treat_def_as_semi_cont": [1, 1, 0, 0, 1, 0],
"set_def_constant": [0, 1, 0, 0, 0, 0],
"soc_init": 0.55,
"soc_final": 0.55
}
Update: yes that has worked and I have the instance up and running with wonkey load forecast, but the rest is functionalā¦