@KasperEdw
I solved it! I found out I have done two errors.
The first was passing wrong amount of data in this list. Nordpool publish prices for every hour so the list must have 24 data points, not 48 points.
You need to be careful here to send the correct amount of data on this list, the correct length. For example, if the data time step is defined to 1h and you are performing a day-ahead optimization, then this list length should be of 24 data points.
In the emhass configuration you must also have 60 (minuts) for optimization_time_step.
The price data must also be for the next day and price data must be in Euro. When you setup Nordpool addon you can choose Euro as the price data.
Update: You can use whatever currency you want as long as you use the same currency everywhere.
The second was using template with errors. My template was wrong with the parenthesis and curly bracket. After fixing the template the shell_command worked and the passing of load_cost_forecast and prod_price_forecast was successful.
Here is the correct template for passing forecast data from Nordpool.
shell_command:
publish_data: "curl -i -H 'Content-Type:application/json' -X POST -d '{}' http://localhost:5000/action/publish-data"
post_nordpool_forecast: "curl -i -H 'Content-Type: application/json' -X POST -d '{\"load_cost_forecast\":{{(
(state_attr('sensor.nordpool_euro', 'raw_tomorrow')|map(attribute='value')|list)[:24])
}},\"prod_price_forecast\":{{(
(state_attr('sensor.nordpool_euro', 'raw_tomorrow')|map(attribute='value')|list)[:24])}}}' http://localhost:5000/action/dayahead-optim"
Hope it helps others