EMHASS: An Energy Management for Home Assistant

Somewhere on your data list you are passing this string 'NOTRUN' instead of a float.
Maybe a nodered related issue?

1 Like

I got the following error since two days (no changes on the configuration since one week):

Logger: homeassistant.components.shell_command
Source: /usr/src/homeassistant/homeassistant/components/shell_command/__init__.py:117
Integration: Shell Command (documentation, issues)
First occurred: 27 de julho de 2023 Ć s 05:30:47 (6 occurrences)
Last logged: 09:07:17

Error running command: `curl -i -H "Content-Type: application/json" -X POST -d '{"pv_power_forecast":{{states('sensor.solcast_24hrs_forecast')}}}' http://localhost:5000/action/dayahead-optim`, return code: 52
Error running command: `curl -i -H "Content-Type:application/json" -X POST -d '{}' http://localhost:5000/action/publish-data`, return code: 56
NoneType: None

Any idea what could be the issue? No errors in EMHASS but there are no results published since two days

David
Iā€™ve moved it back to the automations.yaml and configuation.yaml. No node red but still getting the same error. Something wrong with my array. Just donā€™t understand how a reboot can trigger it.

I notice that my template creates array with line feeds after each number until I put a bracket or curly bracket at the end? Have to go through it in detail and compare to other examples.

@davidusb
@markpurcell
Ok Iā€™ve reduced it down to the bare command line and this is what is being sent:

curl -i -H "Content-Type: application/json" -X POST -d '{"load_cost_forecast":[0.52, 0.53, 0.26, 0.23, 0.26, 0.26, 0.26, 0.26, 0.22, 0.22, 0.26, 0.26, 0.26, 0.26, 0.26, 0.2, 0.2, 0.2, 0.2, 0.17, 0.2, 0.2, 0.2, 0.21, 0.2, 0.18, 0.16, 0.13, 0.13, 0.13, 0.13, 0.08, 0.05, 0.04, 0.04, 0.04, 0.04, 0.04, 0.3, 0.39, 0.39, 0.3, 0.31, 0.41, 0.51, 0.7, 0.7, 0.7], "prod_price_forecast":[0.42, 0.43, 0.15, 0.13, 0.15, 0.15, 0.15, 0.15, 0.12, 0.12, 0.15, 0.15, 0.15, 0.15, 0.15, 0.1, 0.1, 0.1, 0.09, 0.07, 0.09, 0.09, 0.1, 0.1, 0.1, 0.08, 0.06, 0.04, 0.04, 0.04, 0.02, -0.03, -0.06, -0.06, -0.07, -0.07, -0.07, -0.07, 0.22, 0.3, 0.3, 0.22, 0.23, 0.32, 0.42, 0.59, 0.59, 0.59],"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, 0, 0, 93, 414, 876, 1278, 1634, 1964, 2156, 2142, 2110, 2071, 1981, 1818, 1693, 1608, 1451, 1207, 929, 666, 256, 66, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],"prediction_horizon":48,"soc_init":0.33,"soc_final":0.05,"def_total_hours":[2]}' http://192.168.99.17:5000/action/naive-mpc-optim

I can sent this command line verbatim from another machine and it causes this error?

2023-07-28 19:22:39,370 - web_server - INFO - Setting up needed data
2023-07-28 19:22:39,373 - web_server - INFO - Retrieve hass get data method initiated...
2023-07-28 19:22:39,896 - web_server - ERROR - Exception on /action/naive-mpc-optim [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/local/lib/python3.9/dist-packages/emhass/web_server.py", line 174, in action_call
    input_data_dict = set_input_data_dict(config_path, str(data_path), costfun,
  File "/usr/local/lib/python3.9/dist-packages/emhass/command_line.py", line 110, in set_input_data_dict
    rh.get_data(days_list, var_list,
  File "/usr/local/lib/python3.9/dist-packages/emhass/retrieve_hass.py", line 140, in get_data
    df_tp = df_raw.copy()[['state']].replace(
  File "/usr/local/lib/python3.9/dist-packages/pandas/core/generic.py", line 5920, in astype
    new_data = self._mgr.astype(dtype=dtype, copy=copy, errors=errors)
  File "/usr/local/lib/python3.9/dist-packages/pandas/core/internals/managers.py", line 419, in astype
    return self.apply("astype", dtype=dtype, copy=copy, errors=errors)
  File "/usr/local/lib/python3.9/dist-packages/pandas/core/internals/managers.py", line 304, in apply
    applied = getattr(b, f)(**kwargs)
  File "/usr/local/lib/python3.9/dist-packages/pandas/core/internals/blocks.py", line 580, in astype
    new_values = astype_array_safe(values, dtype, copy=copy, errors=errors)
  File "/usr/local/lib/python3.9/dist-packages/pandas/core/dtypes/cast.py", line 1292, in astype_array_safe
    new_values = astype_array(values, dtype, copy=copy)
  File "/usr/local/lib/python3.9/dist-packages/pandas/core/dtypes/cast.py", line 1237, in astype_array
    values = astype_nansafe(values, dtype, copy=copy)
  File "/usr/local/lib/python3.9/dist-packages/pandas/core/dtypes/cast.py", line 1098, in astype_nansafe
    result = astype_nansafe(flat, dtype, copy=copy, skipna=skipna)
  File "/usr/local/lib/python3.9/dist-packages/pandas/core/dtypes/cast.py", line 1181, in astype_nansafe
    return arr.astype(dtype, copy=True)
ValueError: could not convert string to float: 'NOTRUN'

Any ideas?

Thanks
Rob

What is the error? What does the logger says?

Iā€™m getting some errors relating to the battery?

Logger: homeassistant.helpers.template_entity
Source: helpers/template_entity.py:409
First occurred: 17:48:14 (30 occurrences)
Last logged: 19:09:06

TemplateError('UndefinedError: 'None' has no attribute 'attributes'') while processing template 'Template<template=({{ states.sensor.json_sonnen.attributes["Consumption_W"] }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.sonnen_power_consumption'
TemplateError('UndefinedError: 'None' has no attribute 'attributes'') while processing template 'Template<template=({{ states.sensor.json_sonnen.attributes["GridFeedIn_W"] }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.sonnen_power_supply'
TemplateError('UndefinedError: 'None' has no attribute 'attributes'') while processing template 'Template<template=({{ states.sensor.json_sonnen.attributes["Production_W"] }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.sonnen_power_generation'
TemplateError('UndefinedError: 'None' has no attribute 'attributes'') while processing template 'Template<template=({{ states.sensor.json_sonnen.attributes["USOC"] }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.sonnen_electricity_storage'
TemplateError('UndefinedError: 'None' has no attribute 'attributes'') while processing template 'Template<template=({{ states.sensor.json_sonnen.attributes["Uac"] }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.sonnen_alternating_current'

Iā€™ll look into that. Perhaps the HACS that extracts battery info is off?

THanks will have a look at that and come back.

This must be it

Log Details (WARNING)
Logger: homeassistant.components.integration.sensor
Source: components/integration/sensor.py:356
Integration: integration (documentation, issues)
First occurred: 20:12:16 (6 occurrences)
Last logged: 20:12:16

Invalid state (NOTRUN > 1439): [<class 'decimal.ConversionSyntax'>]
Invalid state (NOTRUN > 0): [<class 'decimal.ConversionSyntax'>]
Invalid state (NOTRUN > 1): [<class 'decimal.ConversionSyntax'>]
Invalid state (NOTRUN > -9): [<class 'decimal.ConversionSyntax'>]
Invalid state (NOTRUN > 1460.8): [<class 'decimal.ConversionSyntax'>]

Ć·

@davidusb
Is there any way to tell what entity is cuasing this error?

ValueError: could not convert string to float: 'NOTRUN'

Iā€™ve looked at the two entities in EMHASS config file:


Both seem to be ok:

And the template creating the lists seem to be ok:

'{"load_cost_forecast":{{(
        ([states('sensor.cecil_st_general_price')|float(0)] +
        state_attr('sensor.cecil_st_general_forecast', 'forecasts') |map(attribute='per_kwh')|list)[:48])
        }},"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)[:48]) 
        }},"pv_power_forecast":{{([states('sensor.sonnenbatterie_84324_production_w')|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(48, (state_attr('sensor.cecil_st_feed_in_forecast', 'forecasts')|map(attribute='per_kwh')|list|length)+1)
        }},"soc_init":{{(states('sensor.sonnenbatterie_84324_state_charge_user')|float(0))/100
        }},"soc_final":0.05,"def_total_hours":[2]}'

The list:

'{"load_cost_forecast":[0.15, 0.13, 0.16, 0.06, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.41, 0.41, 0.39, 0.35, 0.35, 0.41, 0.51, 0.7, 0.7, 0.7, 0.52, 0.51, 0.23, 0.26, 0.21, 0.22, 0.23, 0.26, 0.25, 0.22, 0.23, 0.2, 0.2, 0.2, 0.19, 0.16, 0.16, 0.16],"prod_price_forecast":[0.05, 0.04, 0.04, -0.05, 0.02, 0.02, 0.02, 0.01, 0.02, 0.02, 0.32, 0.32, 0.3, 0.27, 0.27, 0.32, 0.42, 0.59, 0.59, 0.59, 0.42, 0.41, 0.13, 0.15, 0.11, 0.12, 0.13, 0.15, 0.14, 0.12, 0.13, 0.09, 0.09, 0.09, 0.09, 0.06, 0.06, 0.06],"pv_power_forecast":[1056, 2501, 2806, 3007, 3173, 3214, 3148, 3054, 2786, 2339, 1906, 1435, 984, 579, 187, 58, 2, 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, 133, 593, 1122, 1610, 2028, 2506, 2861, 2981, 3167, 3377, 3409, 3381, 3274, 3083, 2825, 2362, 1994, 1552, 974, 296, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],"prediction_horizon":38,"soc_init":0.19,"soc_final":0.05,"def_total_hours":[2]}'

The logger is clear of any errors related to this. Has some ring door bell errors etc.
What else can I look at?
THanks
Rob

Is this normal for EMHASS to export to grid with negative FIT

Iā€™m handling this with if then else conditionsā€¦ just curious maybe an improvement

Looks like you are going to have to export to grid at some stage today, as your battery is going to fully charged and you donā€™t have any more deferrable load to add.

So in that case you are better to export at -4Ā¢ now and make some additional room in your battery rather than exporting at -6Ā¢ later.

My forcing using rules you are not going to have an optimal solution as you will need to export at -6Ā¢ later when you battery fills up earlier.

How much longer in the day does your -ve FIT run for?

Do you have other household loads you can turn on? I have 0830-1500 today with -ve FIT in s.qld.

Can you solar PV go into zero export mode?

Thanks for the explanation markā€¦ that makes senseā€¦ really trying to understand how EMHASS thinks. :smiley: negative FIT runs up until 4PM
I can manage the negative FIT later if it holdsā€¦charging EV will fixt thisā€¦ thanks againā€¦

If you schedule your EV in EMHASS then it can also take th at into account.

Even if you have to manual switch your charging, I have mine automated via the https://github.com/alandtse/tesla

I have not get around my head to automate it and taken into EMHASSā€¦ the deferral load keeps on moving and not continous like 4 hoursā€¦ I have not any deferral yet automaticallyā€¦ I use that Tesla HA integration to charge the EV by monitoring export and adjusting the amps accordingly just to charge with excess solar.

I use the deferral load 0 for my dishwasherā€¦I will check when is the best timeā€¦ and schedule the diswasher accordinglyā€¦

Not for now but I could work to improve the error message for that.

Seems ok on that graph because the HomeAssistant graphic code managed somewhere to convert that string to generate the plot, however that ā€œNOTRUNā€ string is there. You can replace these weird strings directly in your template

When running the HA addon, the ML forecast model fit button in the webui doesnt appear to respect the sensor_power_load_no_var_loads option in the config, when i click the button i get an error saying the json object is empty.

When i run curl -i -H "Content-Type:application/json" -X POST -d '{"days_to_retrieve": 30,"var_model": "sensor.house_consumption"}' http://homeassistant.local:5000/action/forecast-model-fit the ml forcaster runs and predicts my loads

Hi guys,

Iā€™ve got the following problem, first I didnā€™t used the p_batt because I donā€™t got any battery, now I gonna install a home battery and I enabeled ā€˜Set if a battery is presentā€™
but I got the following error:
ā€˜ERROR - P_batt was not found in results DataFrame. Optimization task may need to be relaunched or it did not converged to a solution.ā€™

Someone know how I can solve this problem?

Yes I found it. Thanks so much for your help.
The Render Template node had this jinja code:

'{"load_cost_forecast":{{(
        ([states('sensor.cecil_st_general_price')|float(0)] +
        state_attr('sensor.cecil_st_general_forecast', 'forecasts') |map(attribute='per_kwh')|list)[:48])
        }},"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)[:48]) 
        }},"pv_power_forecast":{{([states('sensor.sonnenbatterie_84324_production_w')|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(48, (state_attr('sensor.cecil_st_feed_in_forecast', 'forecasts')|map(attribute='per_kwh')|list|length)+1)
        }},"soc_init":{{(states('sensor.sonnenbatterie_84324_state_charge_user')|float(0))/100
        }},"soc_final":0.05,"def_total_hours":[2]}'

Originally there were no single quotes around the code and it produced this:

{
  "load_cost_forecast": [
    0.19,
    0.17,
    0.21,
    0.2,
    0.2,
    0.19,
    0.19,
    0.16,
    0.16,
    0.16,
    0.16,
    0.16,
    0.16,
    0.16,
    0.17,
    0.18,
    0.17,
    0.16,
    0.16,
    0.13,
    0.13,
    0.09,
    0.04,
    0.03,
    0.02,
    0.02,
    0.02,
    0.02,
    0.02,
    0.03,
    0.29,
    0.35,
    0.39,
    0.37,
    0.39,
    0.41,
    0.43,
    0.57,
    0.7,
    0.7,
    0.7,
    0.7,
    0.29,
    0.27,
    0.26,
    0.25,
    0.2,
    0.2
  ],
  "prod_price_forecast": [
    0.09,
    0.07,
    0.11,
    0.09,
    0.09,
    0.09,
    0.09,
    0.06,
    0.07,
    0.06,
    0.06,
    0.06,
    0.07,
    0.06,
    0.07,
    0.08,
    0.07,
    0.06,
    0.06,
    0.04,
    0.04,
    0,
    -0.06,
    -0.07,
    -0.08,
    -0.08,
    -0.08,
    -0.08,
    -0.08,
    -0.08,
    0.21,
    0.27,
    0.3,
    0.29,
    0.3,
    0.32,
    0.34,
    0.47,
    0.59,
    0.59,
    0.59,
    0.59,
    0.18,
    0.16,
    0.15,
    0.15,
    0.09,
    0.09
  ],
  "pv_power_forecast": [
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    182,
    667,
    1186,
    1659,
    2049,
    2478,
    2892,
    3148,
    3314,
    3362,
    3306,
    3246,
    3091,
    2817,
    2518,
    2135,
    1795,
    1377,
    826,
    265,
    5,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ],
  "prediction_horizon": 48,
  "soc_init": 0.25,
  "soc_final": 0.05,
  "def_total_hours": [
    2
  ]
}

Put single quotes around it and it produces this:

'{"load_cost_forecast":[0.19, 0.18, 0.21, 0.2, 0.2, 0.19, 0.19, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.17, 0.18, 0.17, 0.16, 0.16, 0.13, 0.13, 0.09, 0.04, 0.03, 0.02, 0.02, 0.02, 0.02, 0.02, 0.03, 0.29, 0.35, 0.39, 0.37, 0.39, 0.41, 0.43, 0.57, 0.7, 0.7, 0.7, 0.7, 0.29, 0.27, 0.26, 0.25, 0.2, 0.2],"prod_price_forecast":[0.09, 0.08, 0.11, 0.09, 0.09, 0.09, 0.09, 0.06, 0.07, 0.06, 0.06, 0.06, 0.07, 0.06, 0.07, 0.08, 0.07, 0.06, 0.06, 0.04, 0.04, -0.0, -0.06, -0.07, -0.08, -0.08, -0.08, -0.08, -0.08, -0.08, 0.21, 0.27, 0.3, 0.29, 0.3, 0.32, 0.34, 0.47, 0.59, 0.59, 0.59, 0.59, 0.18, 0.16, 0.15, 0.15, 0.09, 0.09],"pv_power_forecast":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, 667, 1186, 1659, 2049, 2478, 2892, 3148, 3314, 3362, 3306, 3246, 3091, 2817, 2518, 2135, 1795, 1377, 826, 265, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],"prediction_horizon":48,"soc_init":0.25,"soc_final":0.05,"def_total_hours":[2]}'

The first is syntactically correct JSON, the second is not. Helps to test the output here if your not used to this stuff https://jsonlint.com/

1 Like

@mrVoltrix can you show your configuration? Are you passing your own forecast data, is so can you show how and what you are passing? Post data and code in preformatted text using the </> above.

hi rcruikshank,
Below u find my configuration,
Yes Iā€™m using my own forecast data for my solar panels from solcast PV Forecast.
and iā€™m using 1 deferrable load: my ev charger

Configuration EMHASS:

hass_url: empty
long_lived_token: empty
costfun: profit
logging_level: INFO
optimization_time_step: 30
historic_days_to_retrieve: 9
method_ts_round: first
set_total_pv_sell: false
lp_solver: COIN_CMD
lp_solver_path: /usr/bin/cbc
set_nocharge_from_grid: false
set_nodischarge_to_grid: false
set_battery_dynamic: false
battery_dynamic_max: 0.9
battery_dynamic_min: -0.9
load_forecast_method: mlforecaster
sensor_power_photovoltaics: sensor.solaredge_ac_power
sensor_power_load_no_var_loads: sensor.power_load_no_var_loads
number_of_deferrable_loads: 1
list_nominal_power_of_deferrable_loads:
  - nominal_power_of_deferrable_loads: 6400
list_operating_hours_of_each_deferrable_load:
  - operating_hours_of_each_deferrable_load: 6
list_peak_hours_periods_start_hours:
  - peak_hours_periods_start_hours: "12:30"
list_peak_hours_periods_end_hours:
  - peak_hours_periods_end_hours: "15:48"
list_treat_deferrable_load_as_semi_cont:
  - treat_deferrable_load_as_semi_cont: true
load_peak_hours_cost: 0.1159
load_offpeak_hours_cost: 0.1159
photovoltaic_production_sell_price: 0.0606
maximum_power_from_grid: 5000
list_pv_module_model:
  - pv_module_model: CSUN_Eurasia_Energy_Systems_Industry_and_Trade_CSUN295_60M
list_pv_inverter_model:
  - pv_inverter_model: Fronius_International_GmbH__Fronius_Primo_5_0_1_208_240__240V_
list_surface_tilt:
  - surface_tilt: 30
list_surface_azimuth:
  - surface_azimuth: 180
list_modules_per_string:
  - modules_per_string: 15
list_strings_per_inverter:
  - strings_per_inverter: 1
set_use_battery: true
battery_discharge_power_max: 1000
battery_charge_power_max: 1000
battery_discharge_efficiency: 0.95
battery_charge_efficiency: 0.95
battery_nominal_energy_capacity: 5000
battery_minimum_state_of_charge: 0.3
battery_maximum_state_of_charge: 0.9
battery_target_state_of_charge: 0.6

Config.yaml:

      
shell_command:
  dayahead_optim: "curl -i -H \"Content-Type:application/json\" -X POST -d '{\"pv_power_forecast\":{{states('sensor.forecast_tomorrow')}}}' http://localhost:5000/action/dayahead-optim"
  publish_data: "curl -i -H \"Content-Type:application/json\" -X POST -d '{}' http://localhost:5000/action/publish-data"

Hi
I think this template renders the following:

{"pv_power_forecast":24.13}

And for the dayahead optimisation you can post four forecast lists:

  1. pv_power_forecast for the PV power production forecast.
  2. load_power_forecast for the Load power forecast.
  3. load_cost_forecast for the Load cost forecast.
  4. prod_price_forecast for the PV production selling price forecast.

See section 1.7.1 Forecast data in the manual.

I understand you can get away with only posting three of these from a previous comment in this list. Apparently you can leave out number 2 load_power_forecast.

So this is another template that might help if you revers engineer it (it has some of my entity names that would need changing to yours):

{"load_cost_forecast":{{(([states('sensor.amber_general_price')|float(0)] + state_attr('sensor.amber_general_forecast', 'forecasts') |map(attribute='per_kwh')|list)[:48])
}},"prod_price_forecast":{{(([states('sensor.amber_feed_in_price')|float(0)] + state_attr('sensor.amber_feed_in_forecast', 'forecasts')|map(attribute='per_kwh')|list)[:48]) 
}},"pv_power_forecast":{{([states('sensor.sonnenbatterie_XXXXX_production_w')|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)[:48]| tojson
}}}

Result from this is:

{"load_cost_forecast":[0.17, 0.16, 0.16, 0.16, 0.17, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.2, 0.2, 0.22, 0.43, 0.43, 0.24, 0.16, 0.16, 0.14, 0.12, 0.11, 0.08, 0.04, 0.03, 0.04, 0.04, 0.04, 0.04, 0.32, 0.35, 0.35, 0.37, 0.39, 0.42, 0.49, 0.52, 0.61, 0.56, 0.52, 0.51, 0.26, 0.24, 0.22, 0.19, 0.17],"prod_price_forecast":[0.07, 0.06, 0.06, 0.06, 0.07, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.09, 0.09, 0.12, 0.31, 0.31, 0.13, 0.06, 0.06, 0.05, 0.03, -0.0, -0.03, -0.07, -0.07, -0.07, -0.07, -0.07, -0.06, 0.24, 0.27, 0.27, 0.29, 0.3, 0.33, 0.4, 0.42, 0.5, 0.46, 0.42, 0.41, 0.15, 0.13, 0.12, 0.09, 0.07],"pv_power_forecast":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 331, 893, 1425, 1909, 2370, 2760, 3052, 3308, 3468, 3559, 3591, 3533, 3379, 3204, 2941, 2615, 2240, 1801, 1250, 611, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}

So if you were only posting pv_power_forecast the curl line would look more like this. You can se the very first value in the list is the actual current PV power from your inverter or battery (where ever you can get it in Home Assistant) and the rest of the list is the data from solcast and is only a forecast. I might be wrong but I think the first value sould be the actual current PV output:

dayahead_optim: "curl -i -H \"Content-Type:application/json\" -X POST -d '\"pv_power_forecast\":{{([states('sensor.YOUR_CURRENT _PV_OUTPUT_IN_WATTS')|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)[:48]| tojson
}}}' http://localhost:5000/action/dayahead-optim"

Also if your automation for charging your EV is capable of varying the rate then.

- treat_deferrable_load_as_semi_cont: false

If your charging the EV at one rate 6400 Watts then true is correct.