I assume you are are using the shell_command or rest_command method to POST your data to EMHASS and using a template to format the jason data to POST?
In that process you need to add something like this:
"load_power_forecast": {{([states('sensor.YOUR_CURRENT_CONSUMPTION_LESS_DEFERRABLE_LOADS')|int(0)] + states('input_text.fifo_buffer').split(',') | map('int') | list) }},
The .split(‘,’) in this template is if you use my node-red code as I have no spaces in my fifo_buffer and you need spaces between the numbers. Mark’s method is different so depending on which you are using you need to write the template to deliver the data correctly.
What this does is add something like this to the data being POSTed:
"load_power_forecast": [592, 386, 421, 410, 398, 428, 489, 474, 348, 337, 328, 334, 351, 313, 324, 329, 335, 343, 323, 317, 314, 318, 330, 549, 442, 425, 551, 407, 539, 507, 479, 588, 735, 2278, 3238, 4996, 1775, 678, 605, 575, 457, 495, 524, 539, 509, 492, 774, 586, 550],
This is my entire template used to format the data to pass to the MPC process:
{
"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))
| tojson
}},
{%- set current_month = now().month %}
{%- if (3 <= current_month <= 8) or (11 <= current_month <= 12) %}
"load_cost_forecast": {%- set current_time = now() %}
{%- set demand_tariff_start = "15:00:00" %}
{%- set demand_tariff_end = "21:00:00" %}
{%- set start_time = current_time.replace(hour=0, minute=0, second=0, microsecond=0) + timedelta(hours=(demand_tariff_start.split(":")[0]|int), minutes=(demand_tariff_start.split(":")[1]|int)) %}
{%- set end_time = current_time.replace(hour=0, minute=0, second=0, microsecond=0) + timedelta(hours=(demand_tariff_end.split(":")[0]|int), minutes=(demand_tariff_end.split(":")[1]|int)) %}
{%- if end_time <= start_time %}
{%- set end_time = end_time + timedelta(days=1) %}
{%- endif %}
{%- set values = ([states("sensor.cecil_st_general_price")|float(0)] + state_attr("sensor.cecil_st_general_forecast", "forecasts")|map(attribute="per_kwh")|list) %}
{%- set ns = namespace(x=[]) %}
{%- for i in range(values|length) %}
{%- set future_time = current_time + timedelta(minutes=i * 30) %}
{%- if start_time <= future_time < end_time and values[i] < 1 %}
{%- set ns.x = ns.x + [1.0] %}
{%- else %}
{%- set ns.x = ns.x + [values[i]] %}
{%- endif %}
{%- endfor %}
{{- ns.x | tojson }},
{%- else %}
"load_cost_forecast": {{
([states('sensor.cecil_st_general_price')|float(0)] +
state_attr('sensor.cecil_st_general_forecast', 'forecasts') |map(attribute='per_kwh')|list)
| tojson
}},
{%- endif %}
"pv_power_forecast": {{
([states('sensor.sonnenbatterie_84324_production_w')|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
}},
"load_power_forecast": {{
([states('sensor.house_power_consumption_less_deferrables')|int(0)] +
states('input_text.fifo_buffer').split(',') | map('int') | list)
}},
{#"load_power_forecast": {{"[500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500]"
}},#}
"prediction_horizon": {{
min(48, (state_attr('sensor.cecil_st_feed_in_forecast', 'forecasts')|map(attribute='per_kwh')|list|length)+1)
}},
"num_def_loads": 2,
"def_total_hours": [
{%- if 'unny' in states('sensor.denistone_east_extended_text_0') and states('sensor.cecil_st_general_price') | float(0) < 0.15 -%}
{%- if is_state('sensor.season', 'winter') -%}
{{2}}
{%- elif is_state('sensor.season', 'summer') -%}
{{4}}
{%- else -%}
{{3}}
{%- endif -%}
{%- else -%}
{{1}}
{%- endif -%},
{%- if is_state('device_tracker.ynot_location_tracker', ['home']) -%}
{%- if is_state('binary_sensor.ynot_charger', ['on']) -%}
{{ ((states('number.ynot_charge_limit')|int(80)-(states('sensor.ynot_battery')|int(0)))/30*3)|round(0) }}
{%- else -%}
0
{%- endif -%}
{%- else -%}
0
{%- endif -%}
],
"P_deferrable_nom": [1300, {{ (states('input_number.ev_amps') | int(0) * 230)|int(0) }}],
"treat_def_as_semi_cont": [1, 0],
"set_def_constant": [0, 0],
"soc_init": {{ (states('sensor.sonnenbatterie_84324_state_charge_user')|int(0))/100 }},
"soc_final": 0,
"alpha": 1,
"beta": 0
}
and what is prodices is this:
{
"prod_price_forecast": [0.16, 0.14, 0.13, 0.13, 0.11, 0.09, 0.11, 0.09, 0.1, 0.09, 0.08, 0.07, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.07, 0.06, 0.01, 0.0, 0.0, 0.0, -0.05, -0.05, -0.06, -0.07, -0.08, -0.08, -0.09, -0.09, -0.09, -0.09, -0.09, -0.07, -0.07, -0.05, -0.05, -0.02, 0.0, 0.07, 0.13, 0.16, 0.2, 0.16],
"load_cost_forecast": [0.22, 0.2, 0.19, 0.18, 0.19, 0.17, 0.19, 0.18, 0.18, 0.18, 0.16, 0.15, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.14, 0.15, 0.14, 0.08, 0.07, 0.07, 0.07, 0.02, 0.01, 0.01, 0.0, 0.0, -0.01, -0.01, -0.01, -0.01, -0.01, -0.01, 0.01, 0.01, 0.02, 0.02, 0.02, 0.05, 0.12, 0.19, 0.22, 0.26, 0.22],
"pv_power_forecast": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 105, 528, 1050, 1580, 2171, 2715, 3131, 3461, 3725, 3920, 4063, 4110, 4083, 3986, 3792, 3607, 3372, 3068, 2546, 1938, 1436, 914, 387, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"load_power_forecast": [560, 386, 421, 410, 398, 428, 489, 474, 348, 337, 328, 334, 351, 313, 324, 329, 335, 343, 323, 317, 314, 318, 330, 549, 442, 425, 551, 407, 539, 507, 479, 588, 735, 2278, 3238, 4996, 1775, 678, 605, 575, 457, 495, 524, 539, 509, 492, 774, 586, 550],
"prediction_horizon": 48,
"num_def_loads": 2,
"def_total_hours": [1,0],
"P_deferrable_nom": [1300, 4140],
"treat_def_as_semi_cont": [1, 0],
"set_def_constant": [0, 0],
"soc_init": 0.52,
"soc_final": 0,
"alpha": 1,
"beta": 0
}