EMHASS: An Energy Management for Home Assistant

There is already an update for solcast. Release v4.0.12 · oziee/ha-solcast-solar · GitHub

2 Likes

It seems emhass has difficulties grasping the day light saving time which is reverting to wintertime in Europe this weekend:

return meth(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/pandas/core/arrays/datetimes.py", line 1043, in tz_localize
    new_dates = tzconversion.tz_localize_to_utc(
  File "pandas/_libs/tslibs/tzconversion.pyx", line 284, in pandas._libs.tslibs.tzconversion.tz_localize_to_utc
pytz.exceptions.AmbiguousTimeError: Cannot infer dst time from 2023-10-29 02:00:00, try using the 'ambiguous' argument

As from 3 am last night my emhass tripped, look in at the log its probably because 2am does not exist today as this is the moment when we change the time?

Will turn emhass off for the remainder of the day. Suspect Tomorrow this will be resolved but perhaps there is a solution for next year?

3 Likes

Same problem here. EMHASS stopped with similar errors.

Same problems here.

Possible to set timezone for emhass same as home assistant?

Yes this has been seen before, two times per year :wink:
I just haven’t found an efficient way to prevent this. Open to suggestions if anyone have a solution

What about keeping EMHASS internal time calculations in one time zone, maybe UTC, and then converting to locale when displaying externally?

Though my emhass addon is working again all optimizations are one hour late. Anyone else experiencing the same? I think it’s because of the additional hour in the array with prices so hopefully back to normal tomorrow…

Hi, I like this project, but I can’t get it to work. I can’t save the configuration and don’t understand why.
Schermafbeelding 2023-10-29 220000

Could you add your configuration yaml file instead of an image? Something like this:

hass_url: empty
long_lived_token: empty
costfun: profit
logging_level: DEBUG
optimization_time_step: 30
historic_days_to_retrieve: 2
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: naive
sensor_power_photovoltaics: sensor.sonnenbatterie_84324_production_w
sensor_power_load_no_var_loads: sensor.house_power_consumption_less_deferrables
number_of_deferrable_loads: 2
list_nominal_power_of_deferrable_loads:
  - nominal_power_of_deferrable_loads: 1300
  - nominal_power_of_deferrable_loads: 7360
list_operating_hours_of_each_deferrable_load:
  - operating_hours_of_each_deferrable_load: 2
  - operating_hours_of_each_deferrable_load: 1
list_peak_hours_periods_start_hours:
  - peak_hours_periods_start_hours: "10:00"
  - peak_hours_periods_start_hours: "10:00"
list_peak_hours_periods_end_hours:
  - peak_hours_periods_end_hours: "16:00"
  - peak_hours_periods_end_hours: "16:00"
list_treat_deferrable_load_as_semi_cont:
  - treat_deferrable_load_as_semi_cont: true
  - treat_deferrable_load_as_semi_cont: false
load_peak_hours_cost: 0.1907
load_offpeak_hours_cost: 0.1419
photovoltaic_production_sell_price: 0.065
maximum_power_from_grid: 14490
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: 205
list_modules_per_string:
  - modules_per_string: 16
list_strings_per_inverter:
  - strings_per_inverter: 1
set_use_battery: true
battery_discharge_power_max: 3300
battery_charge_power_max: 3300
battery_discharge_efficiency: 0.95
battery_charge_efficiency: 0.95
battery_nominal_energy_capacity: 9300
battery_minimum_state_of_charge: 0.1
battery_maximum_state_of_charge: 1
battery_target_state_of_charge: 0.1

Click the three dots at the top of the configuration page and select yaml.

Hello @DarthMob
Do you mind sharing your ac_dimmer config in Esphome?
What is the dimmer model you use for 3 kW application?
I am having issues with zero crossing in a similar setup.

can we set Timezone for the running docker same as the host system I guess this will fix?

Got a bit on the way but there is still a bit of an error. Can anyone give me a hint as to what is wrong

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun emhass (no readiness notification)
s6-rc: info: service legacy-services successfully started
2023-10-30 10:34:22,443 - web_server - INFO - Launching the emhass webserver at: http://0.0.0.0:5000
2023-10-30 10:34:22,443 - web_server - INFO - Home Assistant data fetch will be performed using url: http://supervisor/core/api
2023-10-30 10:34:22,443 - web_server - INFO - The data path is: /share
2023-10-30 10:34:22,444 - web_server - INFO - Using core emhass version: 0.5.1
waitress   INFO  Serving on http://0.0.0.0:5000
2023-10-30 10:34:52,699 - web_server - INFO - Setting up needed data
2023-10-30 10:34:52,725 - web_server - INFO - Retrieving weather forecast data using method = scrapper
2023-10-30 10:34:53,660 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2023-10-30 10:34:53,661 - web_server - INFO - Retrieve hass get data method initiated...
2023-10-30 10:34:54,124 - web_server - INFO -  >> Performing dayahead optimization...
2023-10-30 10:34:54,124 - web_server - INFO - Performing day-ahead forecast optimization
2023-10-30 10:34:54,128 - web_server - INFO - Perform optimization for the day-ahead
2023-10-30 10:34:54,181 - web_server - INFO - Status: Optimal
2023-10-30 10:34:54,181 - web_server - INFO - Total value of the Cost function = -7.32
2023-10-30 10:35:00,138 - web_server - INFO - Setting up needed data
2023-10-30 10:35:00,140 - web_server - INFO -  >> Publishing data...
2023-10-30 10:35:00,140 - web_server - INFO - Publishing data to HASS instance
2023-10-30 10:35:00,155 - web_server - INFO - Successfully posted to sensor.p_pv_forecast = 711.39
2023-10-30 10:35:00,164 - web_server - INFO - Successfully posted to sensor.p_load_forecast = 1486.75
2023-10-30 10:35:00,175 - web_server - INFO - Successfully posted to sensor.p_deferrable0 = 0.0
2023-10-30 10:35:00,185 - web_server - INFO - Successfully posted to sensor.p_batt_forecast = 0.0
2023-10-30 10:35:00,196 - web_server - INFO - Successfully posted to sensor.soc_batt_forecast = 60.0
2023-10-30 10:35:00,206 - web_server - INFO - Successfully posted to sensor.p_grid_forecast = 775.36
2023-10-30 10:35:00,215 - web_server - INFO - Successfully posted to sensor.total_cost_fun_value = -7.32
2023-10-30 10:35:00,225 - web_server - INFO - Successfully posted to sensor.unit_load_cost = 0.1419
2023-10-30 10:35:00,234 - web_server - INFO - Successfully posted to sensor.unit_prod_price = 0.065
2023-10-30 10:35:14,313 - web_server - INFO - Setting up needed data
2023-10-30 10:35:14,314 - web_server - ERROR - ERROR: The passed data is either not a list or the length is not correct, length should be 24
2023-10-30 10:35:14,314 - web_server - ERROR - Passed type is <class 'list'> and length is 14
2023-10-30 10:35:14,315 - web_server - ERROR - ERROR: The passed data is either not a list or the length is not correct, length should be 24
2023-10-30 10:35:14,315 - web_server - ERROR - Passed type is <class 'list'> and length is 14
2023-10-30 10:35:14,316 - web_server - INFO - Retrieving weather forecast data using method = scrapper
2023-10-30 10:35:15,216 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2023-10-30 10:35:15,217 - web_server - INFO - Retrieve hass get data method initiated...
2023-10-30 10:35:15,661 - web_server - INFO -  >> Performing dayahead optimization...
2023-10-30 10:35:15,661 - web_server - INFO - Performing day-ahead forecast optimization
2023-10-30 10:35:15,664 - web_server - INFO - Perform optimization for the day-ahead
2023-10-30 10:35:15,731 - web_server - INFO - Status: Optimal
2023-10-30 10:35:15,731 - web_server - INFO - Total value of the Cost function = -7.32
2023-10-30 10:35:15,965 - web_server - INFO - Setting up needed data
2023-10-30 10:35:15,967 - web_server - INFO - Retrieve hass get data method initiated...
2023-10-30 10:35:15,975 - web_server - ERROR - The retrieved JSON is empty, check that correct day or variable names are passed
2023-10-30 10:35:15,975 - web_server - ERROR - Either the names of the passed variables are not correct or days_to_retrieve is larger than the recorded history of your sensor (check your recorder settings)
2023-10-30 10:35:15,976 - web_server - ERROR - Exception on /action/forecast-model-fit [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1455, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 869, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 867, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 852, 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 179, 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 146, 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 147, in get_data
    self.df_final = pd.concat([self.df_final, df_day], axis=0)
UnboundLocalError: local variable 'df_day' referenced before assignment
2023-10-30 10:35:15,987 - web_server - INFO - Setting up needed data
2023-10-30 10:35:15,989 - web_server - INFO - Retrieve hass get data method initiated...
2023-10-30 10:35:15,996 - web_server - ERROR - The retrieved JSON is empty, check that correct day or variable names are passed
2023-10-30 10:35:15,996 - web_server - ERROR - Either the names of the passed variables are not correct or days_to_retrieve is larger than the recorded history of your sensor (check your recorder settings)
2023-10-30 10:35:15,997 - web_server - ERROR - Exception on /action/forecast-model-tune [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1455, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 869, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 867, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 852, 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 179, 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 146, 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 147, in get_data
    self.df_final = pd.concat([self.df_final, df_day], axis=0)
UnboundLocalError: local variable 'df_day' referenced before assignment

My Shell command is:

shell_command:
####emhass####################################################################
  dayahead_optim: "curl -i -H \"Content-Type:application/json\" -X POST -d '{}' http://localhost:5000/action/dayahead-optim"
  publish_data: "curl -i -H \"Content-Type:application/json\" -X POST -d '{}' http://localhost:5000/action/publish-data"
  trigger_nordpool_forecast: 'curl -i -H "Content-Type: application/json" -X POST -d ''{
    "load_cost_forecast":{{((state_attr("sensor.nordpool_kwh_se3_sek_3_10_025", "raw_today") | map(attribute="value") | list  + state_attr("sensor.nordpool_kwh_se3_sek_3_10_025", "raw_tomorrow") | map(attribute="value") | list))[now().hour:][:24] }},
    "prod_price_forecast":{{((state_attr("sensor.nordpool_kwh_se3_sek_2_10_0", "raw_today") | map(attribute="value") | list  + state_attr("sensor.nordpool_kwh_se3_sek_2_10_0", "raw_tomorrow") | map(attribute="value") | list))[now().hour:][:24]}}
  }'' http://localhost:5000/action/dayahead-optim'
  ml_forecast_fit: "curl -i -H \"Content-Type:application/json\" -X POST -d '{\"num_lags\": 24}' http://localhost:5000/action/forecast-model-fit"
  ml_forecast_tune: "curl -i -H \"Content-Type:application/json\" -X POST -d '{\"num_lags\": 24}' http://localhost:5000/action/forecast-model-tune"

I think your shell_command trigger_nordpool_forecast has some fault with the quotation marks. Use the Home Assistent template editor to fix it. I have pasted your shell_command and the Nordpool shell_command which is documented here in the template editor. The forecast module — emhass 0.5.0 documentation

image

Why do you run all the shell commands? You need only trigger_nordpool_forecast and publish_data. When these commands are correct you can try with ml_forecast.

That’s exactly the thing, I don’t really know which shell command to run when, etc.?

configuration yaml

hass_url: empty
long_lived_token: empty
costfun: profit
logging_level: INFO
optimization_time_step: 30
historic_days_to_retrieve: 2
method_ts_round: nearest
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: naive
sensor_power_photovoltaics: sensor.total_production_power
sensor_power_load_no_var_loads: sensor.total_consumption_power
number_of_deferrable_loads: 2
list_nominal_power_of_deferrable_loads:
  - nominal_power_of_deferrable_loads: 3000
  - nominal_power_of_deferrable_loads: 750
list_operating_hours_of_each_deferrable_load:
  - operating_hours_of_each_deferrable_load: 5
  - operating_hours_of_each_deferrable_load: 8
list_peak_hours_periods_start_hours:
  - peak_hours_periods_start_hours: "05:54"
  - peak_hours_periods_start_hours: 624
list_peak_hours_periods_end_hours:
  - peak_hours_periods_end_hours: "09:24"
  - peak_hours_periods_end_hours: 714
list_treat_deferrable_load_as_semi_cont:
  - treat_deferrable_load_as_semi_cont: true
  - treat_deferrable_load_as_semi_cont: true
load_peak_hours_cost: 0.1907
load_offpeak_hours_cost: 0.1419
photovoltaic_production_sell_price: 0.065
maximum_power_from_grid: 9000
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: 205
list_modules_per_string:
  - modules_per_string: 16
list_strings_per_inverter:
  - strings_per_inverter: 1
set_use_battery: false
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

Just continuing the saga here. I an really desperate to crack this issue so any suggestions would be appreciated. I have reduced the nominal power of the EV and pool equipment loads in an attempt to reduce the number of infeasible optimiser results I am getting. I am not really getting there. There is plenty of spare PV and I have filtered out the new loads so my load forecast essentially do not include the new large loads from the pool equipment. It seems that as I start getting infeasible results, there is a resource leak and the CPU and Memory of the container start ticking up.

This is what I see in the log, notice that the MPC call does not return before the next step in the automation kicks in an I publish the latest results:

2023-10-31 16:40:00,256 - web_server - INFO - Setting up needed data
2023-10-31 16:40:00,259 - web_server - INFO - Retrieve hass get data method initiated...
2023-10-31 16:40:01,018 - web_server - INFO - Retrieving weather forecast data using method = list
2023-10-31 16:40:01,020 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2023-10-31 16:40:01,020 - web_server - INFO - Retrieve hass get data method initiated...
2023-10-31 16:40:01,541 - web_server - INFO -  >> Performing naive MPC optimization...
2023-10-31 16:40:01,541 - web_server - INFO - Performing naive MPC optimization
2023-10-31 16:40:01,548 - web_server - INFO - Perform an iteration of a naive MPC controller
2023-10-31 16:42:00,363 - web_server - INFO - Setting up needed data
2023-10-31 16:42:00,366 - web_server - INFO -  >> Publishing data...
2023-10-31 16:42:00,366 - web_server - INFO - Publishing data to HASS instance

I would love to understand why I am getting so many infeasible results. What are the rough heuristics? If you cannot fit the def_hours for each load (at the nominal power) in the next 24hrs then you get infeasible? Here are my latest results:

timestamp,P_PV,P_Load,P_deferrable0,P_deferrable1,P_grid_pos,P_grid_neg,P_grid,P_batt,SOC_opt,unit_load_cost,unit_prod_price,cost_profit,cost_fun_selfcons
2023-10-31 17:00:00+11:00,4740,3409.570491803279,0.0,0.0,0.0,-1330.4295,-1330.4295,0.0,0.95,0.46178,0.05,0.0332607375,0.0332607375
2023-10-31 17:30:00+11:00,6725,2104.423728813559,4620.5763,0.0,0.0,0.0,0.0,0.0,0.95,0.46178,0.05,-0.0,-0.0
2023-10-31 18:00:00+11:00,3944,2628.4666666666667,1315.5333,0.0,0.0,0.0,0.0,0.0,0.95,0.46178,0.05,-0.0,-0.0
2023-10-31 18:30:00+11:00,1373,3226.4,0.0,0.0,0.0,0.0,0.0,1853.4,0.9124817813765181,0.46178,0.05,-0.0,-0.0
2023-10-31 19:00:00+11:00,115,2810.677966101695,0.0,0.0,0.0,0.0,0.0,2695.678,0.8579134008097166,0.46178,0.05,-0.0,-0.0
2023-10-31 19:30:00+11:00,0,4093.9661016949153,0.0,0.0,0.0,0.0,0.0,4093.9661,0.7750395931174089,0.46178,0.05,-0.0,-0.0
2023-10-31 20:00:00+11:00,0,3399.15,0.0,0.0,0.0,0.0,0.0,3399.15,0.7062308886639675,0.24915,0.05,-0.0,-0.0
2023-10-31 20:30:00+11:00,0,3824.4745762711864,0.0,0.0,0.0,0.0,0.0,3824.4746,0.6288123744939271,0.24915,0.05,-0.0,-0.0
2023-10-31 21:00:00+11:00,0,3193.2419354838707,0.0,0.0,0.0,0.0,0.0,3193.2419,0.5641718502024291,0.24915,0.05,-0.0,-0.0
2023-10-31 21:30:00+11:00,0,2573.0508474576272,0.0,0.0,0.0,0.0,0.0,2573.0508,0.5120858016194332,0.24915,0.05,-0.0,-0.0
2023-10-31 22:00:00+11:00,0,2291.677966101695,0.0,0.0,0.0,0.0,0.0,2291.678,0.46569555870445345,0.19239,0.05,-0.0,-0.0
2023-10-31 22:30:00+11:00,0,1861.0,0.0,0.0,0.0,0.0,0.0,1861.0,0.4280234939271255,0.19239,0.05,-0.0,-0.0
2023-10-31 23:00:00+11:00,0,1425.5,0.0,0.0,1425.5,0.0,1425.5,0.0,0.4280234939271255,0.19239,0.05,-0.13712597250000003,-0.13712597250000003
2023-10-31 23:30:00+11:00,0,1211.6909090909091,0.0,0.0,0.0,0.0,0.0,1211.6909,0.4034953380566802,0.19239,0.05,-0.0,-0.0
2023-11-01 00:00:00+11:00,0,1356.5254237288136,0.0,0.0,1356.5254,0.0,1356.5254,0.0,0.4034953380566802,0.19239,0.05,-0.130490960853,-0.130490960853
2023-11-01 00:30:00+11:00,0,1545.433962264151,0.0,0.0,1131.0422,0.0,1131.0422,414.39179,0.3951068402834008,0.19239,0.05,-0.10880060442900003,-0.10880060442900003
2023-11-01 01:00:00+11:00,0,1782.0338983050847,0.0,0.0,0.0,0.0,0.0,1782.0339,0.35903327955465586,0.19239,0.05,-0.0,-0.0
2023-11-01 01:30:00+11:00,0,1588.1176470588234,0.0,0.0,0.0,0.0,0.0,1588.1176,0.32688515,0.19239,0.05,-0.0,-0.0
2023-11-01 02:00:00+11:00,0,2304.1833333333334,0.0,0.0,2304.1833,0.0,2304.1833,0.0,0.32688515,0.19239,0.05,-0.22165091254350003,-0.22165091254350003
2023-11-01 02:30:00+11:00,0,1941.037037037037,0.0,0.0,0.0,0.0,0.0,1941.037,0.28759290303643725,0.19239,0.05,-0.0,-0.0
2023-11-01 03:00:00+11:00,0,2077.633333333333,0.0,0.0,0.0,0.0,0.0,2077.6333,0.2455355487854251,0.19239,0.05,-0.0,-0.0
2023-11-01 03:30:00+11:00,0,1475.396551724138,0.0,0.0,0.0,0.0,0.0,1475.3966,0.21566922085020243,0.19239,0.05,-0.0,-0.0
2023-11-01 04:00:00+11:00,0,1259.2,0.0,0.0,0.0,0.0,0.0,1259.2,0.19017934230769232,0.19239,0.05,-0.0,-0.0
2023-11-01 04:30:00+11:00,0,1282.7068965517242,0.0,0.0,0.0,0.0,0.0,1282.7069,0.16421361558704456,0.19239,0.05,-0.0,-0.0
2023-11-01 05:00:00+11:00,0,913.0862068965517,0.0,0.0,913.08621,0.0,913.08621,0.0,0.16421361558704456,0.19239,0.05,-0.08783432797095002,-0.08783432797095002
2023-11-01 05:30:00+11:00,0,851.280701754386,0.0,0.0,851.2807,0.0,851.2807,0.0,0.16421361558704456,0.19239,0.05,-0.0818889469365,-0.0818889469365
2023-11-01 06:00:00+11:00,242,944.1525423728814,0.0,0.0,0.0,0.0,0.0,702.15254,0.15000000141700406,0.19239,0.05,-0.0,-0.0
2023-11-01 06:30:00+11:00,1316,1006.0169491525423,309.98305,0.0,0.0,0.0,0.0,0.0,0.15000000141700406,0.19239,0.05,-0.0,-0.0
2023-11-01 07:00:00+11:00,3582,1923.050847457627,0.0,0.0,0.0,-1658.9492,-1658.9492,0.0,0.15000000141700406,0.24915,0.05,0.04147373000000001,0.04147373000000001
2023-11-01 07:30:00+11:00,5765,1939.2758620689656,3825.7241,0.0,0.0,0.0,0.0,0.0,0.15000000141700406,0.24915,0.05,-0.0,-0.0
2023-11-01 08:00:00+11:00,7837,2076.754385964912,0.0,0.0,0.0,-5760.2456,-5760.2456,0.0,0.15000000141700406,0.24915,0.05,0.14400614000000003,0.14400614000000003
2023-11-01 08:30:00+11:00,9736,2651.8275862068967,6000.0,0.0,0.0,-1084.1724,-1084.1724,0.0,0.15000000141700406,0.24915,0.05,0.02710431,0.02710431
2023-11-01 09:00:00+11:00,11478,2185.6833333333334,6000.0,0.0,0.0,-3292.3167,-3292.3167,0.0,0.15000000141700406,0.24915,0.05,0.08230791750000001,0.08230791750000001
2023-11-01 09:30:00+11:00,13067,1604.311475409836,6000.0,5000.0,0.0,-462.68852,-462.68852,0.0,0.15000000141700406,0.24915,0.05,0.011567213000000002,0.011567213000000002
2023-11-01 10:00:00+11:00,14388,1435.5666666666666,0.0,5000.0,0.0,-7952.4333,-7952.4333,0.0,0.15000000141700406,0.24915,0.05,0.1988108325,0.1988108325
2023-11-01 10:30:00+11:00,15325,1543.8833333333334,0.0,0.0,0.0,-13781.117,-13781.117,0.0,0.15000000141700406,0.24915,0.05,0.34452792500000007,0.34452792500000007
2023-11-01 11:00:00+11:00,16040,2102.6984126984125,0.0,0.0,0.0,-13937.302,-13937.302,0.0,0.15000000141700406,0.24915,0.05,0.34843255,0.34843255
2023-11-01 11:30:00+11:00,16520,5594.683333333333,0.0,0.0,0.0,-10925.317,-10925.317,0.0,0.15000000141700406,0.24915,0.05,0.273132925,0.273132925
2023-11-01 12:00:00+11:00,16789,6126.166666666667,0.0,0.0,0.0,-10662.833,-10662.833,0.0,0.15000000141700406,0.24915,0.05,0.266570825,0.266570825
2023-11-01 12:30:00+11:00,16766,7749.169491525424,6000.0,0.0,0.0,-3016.8305,-3016.8305,0.0,0.15000000141700406,0.24915,0.05,0.07542076250000002,0.07542076250000002
2023-11-01 13:00:00+11:00,16613,7901.131147540984,0.0,0.0,0.0,-8711.8689,-8711.8689,0.0,0.15000000141700406,0.24915,0.05,0.21779672249999998,0.21779672249999998
2023-11-01 13:30:00+11:00,16402,5635.854838709677,0.0,5000.0,0.0,-5766.1452,-5766.1452,0.0,0.15000000141700406,0.24915,0.05,0.14415363,0.14415363
2023-11-01 14:00:00+11:00,15954,2251.322033898305,0.0,5000.0,0.0,-8702.678,-8702.678,0.0,0.15000000141700406,0.46178,0.05,0.21756695000000004,0.21756695000000004
2023-11-01 14:30:00+11:00,15324,2474.3492063492063,6000.0,5000.0,0.0,-1849.6508,-1849.6508,0.0,0.15000000141700406,0.46178,0.05,0.04624127,0.04624127
2023-11-01 15:00:00+11:00,14446,2558.0508474576272,6000.0,0.0,0.0,-5887.9492,-5887.9492,0.0,0.15000000141700406,0.46178,0.05,0.14719873000000003,0.14719873000000003
2023-11-01 15:30:00+11:00,13330,2827.9523809523807,1928.1832,5000.0,0.0,-3573.8644,-3573.8644,0.0,0.15000000141700406,0.46178,0.05,0.08934661,0.08934661
2023-11-01 16:00:00+11:00,11799,1974.2033898305085,0.0,0.0,0.0,-9824.7966,-9824.7966,0.0,0.15000000141700406,0.46178,0.05,0.245619915,0.245619915
2023-11-01 16:30:00+11:00,9787,3901.0,0.0,0.0,0.0,-5886.0,-5886.0,0.0,0.15000000141700406,0.46178,0.05,0.14715,0.14715

Have you reduced back to just one load?

Does day-ahead still work for you?

Merge drop PV forecast and buy/ sell forecasts to see if you can get something working?

Can anyone check if this looks correct?

  trigger_nordpool_forecast: "curl -i -H \"Content-Type: application/json\" -X POST -d '{
    \"load_cost_forecast\":{{((state_attr('sensor.nordpool_kwh_se3_sek_3_10_025', 'raw_today') | map(attribute='value') | list  + state_attr('sensor.nordpool_kwh_se3_sek_3_10_025', 'raw_tomorrow') | map(attribute='value') | list))[now().hour:][:24] }},
    \"prod_price_forecast\":{{((state_attr('sensor.nordpool_moms', 'raw_today') | map(attribute='value') | list  + state_attr('sensor.nordpool_moms', 'raw_tomorrow') | map(attribute='value') | list))[now().hour:][:24]}}
    }' http://localhost:5000/action/dayahead-optim"

1 Like

Now it actually seems to be working fine. Realize that Studio code server is not so good as it changes the formatting sometimes on lines. File editor is preferred.