@soco
Although I havenāt yet solved my configuration UI problem, here are the logs from the rest command:
emhass_thermal_battery_optim:
url: http://192.168.178.149:5005/action/dayahead-optim
method: POST
content_type: "application/json"
timeout: 300
payload: >-
{
"load_cost_forecast":{{((state_attr('sensor.nord_pool_electricity_prices', 'data') | map(attribute='price') | list))[now().hour*4 + (now().minute / 15) | int:][:96] }},
"outdoor_temperature_forecast": {{ (state_attr('sensor.temperaturvorhersage_24h_15min', 'forecast') | map(attribute='temperature') | list)[:96] }},
"operating_hours_of_each_deferrable_load": [0,0,0,0],
"def_load_config": [
{
"thermal_battery":
{
"supply_temperature": 32.0,
"volume": 26.5,
"start_temperature": 22,
"min_temperatures": {{ [23.0] * 96 }},
"max_temperatures": {{ [24.0] * 96 }},
"carnot_efficiency": 0.42,
"u_value": 0.35,
"envelope_area": 473.0,
"ventilation_rate": 0.4,
"heated_volume": 500.0,
"window_area": 45.0,
"shgc": 0.6
}
},
{},
{},
{}
]
}
[2026-01-14 15:12:26,010] INFO in web_server: >> Obtaining params:
[2026-01-14 15:12:26,017] INFO in web_server: Passed runtime parameters: {'load_cost_forecast': [0.336, 0.348, 0.385, 0.389, 0.326, 0.35, 0.381, 0.44, 0.389, 0.435, 0.459, 0.439, 0.42, 0.408, 0.401, 0.409, 0.418, 0.385, 0.368, 0.355, 0.374, 0.354, 0.346, 0.334, 0.359, 0.35, 0.326, 0.315, 0.342, 0.346, 0.315, 0.309, 0.319, 0.309, 0.305, 0.299, 0.324, 0.316, 0.307, 0.303, 0.31, 0.306, 0.303, 0.3, 0.305, 0.299, 0.296, 0.296, 0.296, 0.295, 0.293, 0.291, 0.291, 0.291, 0.291, 0.293, 0.293, 0.293, 0.296, 0.299, 0.304, 0.307, 0.309, 0.317, 0.312, 0.315, 0.318, 0.324, 0.318, 0.321, 0.318, 0.314, 0.32, 0.315, 0.311, 0.307, 0.32, 0.314, 0.309, 0.306, 0.314, 0.31, 0.307, 0.306, 0.307, 0.304, 0.305, 0.307, 0.31, 0.312, 0.314, 0.314, 0.313, 0.318, 0.317, 0.326], 'outdoor_temperature_forecast': [5.3, 5.3, 5.3, 5.3, 5.1, 5.1, 5.1, 5.1, 5.2, 5.2, 5.2, 5.2, 5.1, 5.1, 5.1, 5.1, 5.0, 5.0, 5.0, 5.0, 5.1, 5.1, 5.1, 5.1, 5.1, 5.1, 5.1, 5.1, 4.6, 4.6, 4.6, 4.6, 4.1, 4.1, 4.1, 4.1, 4.2, 4.2, 4.2, 4.2, 3.8, 3.8, 3.8, 3.8, 3.7, 3.7, 3.7, 3.7, 3.9, 3.9, 3.9, 3.9, 4.1, 4.1, 4.1, 4.1, 4.2, 4.2, 4.2, 4.2, 4.3, 4.3, 4.3, 4.3, 4.1, 4.1, 4.1, 4.1, 4.2, 4.2, 4.2, 4.2, 4.6, 4.6, 4.6, 4.6, 4.8, 4.8, 4.8, 4.8, 5.1, 5.1, 5.1, 5.1, 5.7, 5.7, 5.7, 5.7, 5.7, 5.7, 5.7, 5.7, 5.8, 5.8, 5.8, 5.8], 'operating_hours_of_each_deferrable_load': [0, 0, 0, 0], 'def_load_config': [{'thermal_battery': {'supply_temperature': 32.0, 'volume': 26.5, 'start_temperature': 22, 'min_temperatures': [23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0, 23.0], 'max_temperatures': [24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 24.0], 'carnot_efficiency': 0.42, 'u_value': 0.35, 'envelope_area': 473.0, 'ventilation_rate': 0.4, 'heated_volume': 500.0, 'window_area': 45.0, 'shgc': 0.6}}, {}, {}, {}]}
[2026-01-14 15:12:26,018] INFO in web_server: >> Setting input data dict
[2026-01-14 15:12:26,018] INFO in command_line: Setting up needed data
[2026-01-14 15:12:26,032] DEBUG in utils: setting`passed_data:days_to_retrieve` to 9 for fit/predict/tune
[2026-01-14 15:12:26,034] DEBUG in retrieve_hass: Websocket integration disabled, using Home Assistant API
[2026-01-14 15:12:26,034] INFO in retrieve_hass: InfluxDB integration enabled: 192.168.178.149:8086/homeassistant
[2026-01-14 15:12:26,035] INFO in retrieve_hass: get HA config from rest api.
[2026-01-14 15:12:26,055] DEBUG in optimization: Initialized Optimization with retrieve_hass_conf: {'optimization_time_step': Timedelta('0 days 00:15:00'), 'historic_days_to_retrieve': 2, 'sensor_power_photovoltaics': 'sensor.pv_inverter_watts', 'sensor_power_photovoltaics_forecast': 'sensor.p_pv_forecast', 'sensor_power_load_no_var_loads': 'sensor.power_load_no_var_loads', 'load_negative': False, 'set_zero_min': True, 'sensor_replace_zero': ['sensor.power_photovoltaics'], 'sensor_linear_interp': ['sensor.power_photovoltaics'], 'use_influxdb': True, 'influxdb_host': '192.168.178.149', 'influxdb_port': 8086, 'influxdb_username': 'influx-db-user', 'influxdb_password': 'influx-db-user', 'influxdb_database': 'homeassistant', 'influxdb_measurement': 'W', 'influxdb_retention_policy': 'autogen', 'influxdb_use_ssl': False, 'influxdb_verify_ssl': False, 'method_ts_round': 'first', 'continual_publish': False, 'use_websocket': False, 'hass_url': 'http://supervisor/core/api', 'long_lived_token': '0e270787fc67c3cec2f9250a067c981a6c0ecd49115c102232745a8119cd14e76677e00d4a3074386cf82d5706b06f0e8ae7a6d669fbf58d', 'time_zone': <DstTzInfo 'Europe/Berlin' LMT+0:53:00 STD>, 'Latitude': 50.64753866400673, 'Longitude': 7.933228611946107, 'Altitude': 525}
[2026-01-14 15:12:26,055] DEBUG in optimization: Optimization configuration: {'costfun': 'self-consumption', 'logging_level': 'DEBUG', 'set_use_pv': True, 'set_use_adjusted_pv': False, 'adjusted_pv_regression_model': 'LassoRegression', 'adjusted_pv_solar_elevation_threshold': 10, 'adjusted_pv_model_max_age': 24, 'set_use_battery': False, 'number_of_deferrable_loads': 4, 'nominal_power_of_deferrable_loads': [1750, 2250, 2250, 2250], 'minimum_power_of_deferrable_loads': [0, 0, 0, 0], 'operating_hours_of_each_deferrable_load': [0, 0, 0, 0], 'treat_deferrable_load_as_semi_cont': [True, True, True, True], 'set_deferrable_load_single_constant': [False, False, False, False], 'set_deferrable_startup_penalty': [400, 250, 250, 250], 'delta_forecast_daily': Timedelta('1 days 00:00:00'), 'load_forecast_method': 'naive', 'load_cost_forecast_method': 'list', 'load_peak_hours_cost': 0.1907, 'load_offpeak_hours_cost': 0.1419, 'production_price_forecast_method': 'constant', 'photovoltaic_production_sell_price': 0.07553, 'set_total_pv_sell': False, 'lp_solver': 'default', 'lp_solver_path': 'empty', 'lp_solver_timeout': 45, 'num_threads': 0, 'set_nocharge_from_grid': False, 'set_nodischarge_to_grid': True, 'set_battery_dynamic': False, 'battery_dynamic_max': 0.9, 'battery_dynamic_min': -0.9, 'weight_battery_discharge': 0.0, 'weight_battery_charge': 0.0, 'weather_forecast_method': 'open-meteo', 'open_meteo_cache_max_age': 30, 'start_timesteps_of_each_deferrable_load': [0, 0, 56, 86], 'end_timesteps_of_each_deferrable_load': [0, 28, 64, 0], 'load_peak_hour_periods': {'period_hp_1': [{'start': '08:00'}, {'end': '12:00'}], 'period_hp_2': [{'start': '15:00'}, {'end': '18:00'}]}, 'model_type': 'load_forecast', 'var_model': 'sensor.power_load_no_var_loads', 'sklearn_model': 'KNeighborsRegressor', 'num_lags': 48, 'split_date_delta': '48h', 'perform_backtest': False, 'outdoor_temperature_forecast_method': 'list'}
[2026-01-14 15:12:26,055] DEBUG in optimization: Plant configuration: {'maximum_power_from_grid': 9000, 'maximum_power_to_grid': 9000, 'pv_module_model': ['Trina_Solar_TSM_465DEG15VC_20_II_', 'Trina_Solar_TSM_465DEG15VC_20_II_', 'Trina_Solar_TSM_465DEG15VC_20_II_'], 'pv_inverter_model': ['Fronius_International_GmbH__Fronius_Primo_10_0_1_208_240__240V_', 'Fronius_International_GmbH__Fronius_Primo_10_0_1_208_240__240V_', 'Fronius_International_GmbH__Fronius_Primo_10_0_1_208_240__240V_'], 'surface_tilt': [21, 21, 21], 'surface_azimuth': [85, 175, 265], 'modules_per_string': [12, 11, 12], 'strings_per_inverter': [1, 1, 1], 'inverter_is_hybrid': False, 'inverter_ac_output_max': 1000, 'inverter_ac_input_max': 1000, 'inverter_efficiency_dc_ac': 1, 'inverter_efficiency_ac_dc': 1, 'inverter_stress_cost': 0, 'inverter_stress_segments': 10, 'compute_curtailment': 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, 'battery_stress_cost': 0.0, 'battery_stress_segments': 10}
[2026-01-14 15:12:26,056] DEBUG in optimization: Solver configuration: lp_solver=default, lp_solver_path=empty
[2026-01-14 15:12:26,056] DEBUG in optimization: Number of threads: 2
[2026-01-14 15:12:26,057] INFO in forecast: Retrieving weather forecast data using method = open-meteo
[2026-01-14 15:12:26,058] DEBUG in forecast: Open-Meteo forecast_days is low (1) so defaulting to 3 days
[2026-01-14 15:12:26,058] INFO in forecast: Loading existing cached Open-Meteo JSON file: /data/cached-open-meteo-forecast-b.json
[2026-01-14 15:12:26,061] INFO in forecast: The cached Open-Meteo JSON file is recent (age=8m, max_age=30m)
[2026-01-14 15:12:26,084] DEBUG in forecast: get_weather_forecast returning:
temp_air relative_humidity ... dhi dni
2026-01-14 15:00:00+01:00 6.1 100 ... 24.7 0.0
2026-01-14 15:15:00+01:00 6.1 100 ... 18.7 0.0
2026-01-14 15:30:00+01:00 6.1 100 ... 17.5 0.0
2026-01-14 15:45:00+01:00 6.0 99 ... 10.8 0.0
2026-01-14 16:00:00+01:00 6.0 99 ... 6.9 0.0
... ... ... ... ... ...
2026-01-15 13:45:00+01:00 6.4 94 ... 85.5 97.0
2026-01-15 14:00:00+01:00 6.4 94 ... 95.8 148.7
2026-01-15 14:15:00+01:00 6.4 93 ... 79.7 104.8
2026-01-15 14:30:00+01:00 6.4 92 ... 70.5 106.8
2026-01-15 14:45:00+01:00 6.4 91 ... 57.5 61.2
[96 rows x 8 columns]
[2026-01-14 15:12:26,933] DEBUG in forecast: get_power_from_weather returning:
2026-01-14 15:00:00+01:00 223.164155
2026-01-14 15:15:00+01:00 129.513101
2026-01-14 15:30:00+01:00 110.860924
2026-01-14 15:45:00+01:00 7.600377
2026-01-14 16:00:00+01:00 0.000000
...
2026-01-15 13:45:00+01:00 1752.908022
2026-01-15 14:00:00+01:00 2192.669374
2026-01-15 14:15:00+01:00 1658.385429
2026-01-15 14:30:00+01:00 1493.941598
2026-01-15 14:45:00+01:00 1037.679020
Freq: 15min, Length: 96, dtype: float64
[2026-01-14 15:12:26,936] INFO in forecast: Retrieving data from hass for load forecast using method = naive
[2026-01-14 15:12:26,936] DEBUG in retrieve_hass: Websocket integration disabled, using Home Assistant API
[2026-01-14 15:12:26,936] INFO in retrieve_hass: InfluxDB integration enabled: 192.168.178.149:8086/homeassistant
[2026-01-14 15:12:26,937] INFO in retrieve_hass: Retrieve InfluxDB get data method initiated...
[2026-01-14 15:12:26,940] DEBUG in retrieve_hass: Successfully connected to InfluxDB at 192.168.178.149:8086
[2026-01-14 15:12:26,941] INFO in retrieve_hass: Retrieving 1 sensors over 1 days from InfluxDB
[2026-01-14 15:12:26,941] DEBUG in retrieve_hass: Time range: 2026-01-13 00:00:00 to 2026-01-14 14:12:26.941213
[2026-01-14 15:12:26,941] DEBUG in retrieve_hass: End time capped at current time (requested: 2026-01-15 00:00:00)
[2026-01-14 15:12:26,941] DEBUG in retrieve_hass: Retrieving sensor: sensor.power_load_no_var_loads
[2026-01-14 15:12:26,945] DEBUG in retrieve_hass: Searching for entity 'power_load_no_var_loads' across 37 measurements
[2026-01-14 15:12:26,946] DEBUG in retrieve_hass: Checking measurement 'EUR/kWh' with tag query: SHOW TAG VALUES FROM "EUR/kWh" WITH KEY = "entity_id"
[2026-01-14 15:12:26,950] DEBUG in retrieve_hass: Checking measurement 'ā¬/kWh' with tag query: SHOW TAG VALUES FROM "ā¬/kWh" WITH KEY = "entity_id"
[2026-01-14 15:12:26,953] DEBUG in retrieve_hass: Checking measurement 'W' with tag query: SHOW TAG VALUES FROM "W" WITH KEY = "entity_id"
[2026-01-14 15:12:26,957] DEBUG in retrieve_hass: Found entity 'power_load_no_var_loads' in measurement 'W'
[2026-01-14 15:12:26,958] DEBUG in retrieve_hass: InfluxDB query:
SELECT mean("value") AS "mean_value"
FROM "homeassistant"."autogen"."W"
WHERE time >= '2026-01-13T00:00:00Z'
AND time < '2026-01-14T14:12:26Z'
AND "entity_id"='power_load_no_var_loads'
GROUP BY time(15m) FILL(previous)
[2026-01-14 15:12:26,972] INFO in retrieve_hass: Retrieved 153 data points for sensor.power_load_no_var_loads
[2026-01-14 15:12:26,977] DEBUG in retrieve_hass: Successfully retrieved 153 data points for 'power_load_no_var_loads' from measurement 'W'
[2026-01-14 15:12:26,980] INFO in retrieve_hass: InfluxDB data retrieval completed: (153, 1)
[2026-01-14 15:12:26,980] DEBUG in retrieve_hass: prepare_data self.var_list=['sensor.power_load_no_var_loads']
[2026-01-14 15:12:26,981] DEBUG in retrieve_hass: prepare_data var_load=sensor.power_load_no_var_loads
[2026-01-14 15:12:26,982] DEBUG in retrieve_hass: prepare_data var_list updated after rename: ['sensor.power_load_no_var_loads_positive']
[2026-01-14 15:12:26,985] WARNING in retrieve_hass: Unable to find all the sensors in sensor_replace_zero parameter
[2026-01-14 15:12:26,985] WARNING in retrieve_hass: Confirm sure all sensors in sensor_replace_zero are sensor_power_photovoltaics and/or sensor_power_load_no_var_loads
[2026-01-14 15:12:26,990] DEBUG in forecast: get_load_forecast returning:
2026-01-14 15:00:00+01:00 758.607143
2026-01-14 15:15:00+01:00 2517.000000
2026-01-14 15:30:00+01:00 903.518519
2026-01-14 15:45:00+01:00 539.148148
2026-01-14 16:00:00+01:00 478.785714
...
2026-01-15 13:45:00+01:00 99.068966
2026-01-15 14:00:00+01:00 544.545714
2026-01-15 14:15:00+01:00 275.457576
2026-01-15 14:30:00+01:00 275.181818
2026-01-15 14:45:00+01:00 319.682759
Name: yhat, Length: 96, dtype: float64
[2026-01-14 15:12:26,993] INFO in web_server: >> Performing dayahead-optim...
[2026-01-14 15:12:26,993] INFO in command_line: Performing day-ahead forecast optimization
[2026-01-14 15:12:27,003] DEBUG in forecast: get_load_cost_forecast returning:
p_pv_forecast p_load_forecast unit_load_cost
2026-01-14 15:00:00+01:00 223.164155 758.607143 0.336
2026-01-14 15:15:00+01:00 129.513101 2517.000000 0.348
2026-01-14 15:30:00+01:00 110.860924 903.518519 0.385
2026-01-14 15:45:00+01:00 7.600377 539.148148 0.389
2026-01-14 16:00:00+01:00 0.000000 478.785714 0.326
... ... ... ...
2026-01-15 13:45:00+01:00 1752.908022 99.068966 0.314
2026-01-15 14:00:00+01:00 2192.669374 544.545714 0.313
2026-01-15 14:15:00+01:00 1658.385429 275.457576 0.318
2026-01-15 14:30:00+01:00 1493.941598 275.181818 0.317
2026-01-15 14:45:00+01:00 1037.679020 319.682759 0.326
[96 rows x 3 columns]
[2026-01-14 15:12:27,020] DEBUG in forecast: get_prod_price_forecast returning:
p_pv_forecast ... unit_prod_price
2026-01-14 15:00:00+01:00 223.164155 ... 0.07553
2026-01-14 15:15:00+01:00 129.513101 ... 0.07553
2026-01-14 15:30:00+01:00 110.860924 ... 0.07553
2026-01-14 15:45:00+01:00 7.600377 ... 0.07553
2026-01-14 16:00:00+01:00 0.000000 ... 0.07553
... ... ... ...
2026-01-15 13:45:00+01:00 1752.908022 ... 0.07553
2026-01-15 14:00:00+01:00 2192.669374 ... 0.07553
2026-01-15 14:15:00+01:00 1658.385429 ... 0.07553
2026-01-15 14:30:00+01:00 1493.941598 ... 0.07553
2026-01-15 14:45:00+01:00 1037.679020 ... 0.07553
[96 rows x 4 columns]
[2026-01-14 15:12:27,041] DEBUG in command_line: Merged GHI data into optimization input: mean=18.2 W/m², max=137.8 W/m²
[2026-01-14 15:12:27,041] INFO in optimization: Perform optimization for the day-ahead
[2026-01-14 15:12:27,079] DEBUG in optimization: Processing deferrable load 0
[2026-01-14 15:12:27,079] DEBUG in optimization: Deferrable load 0: Proposed optimization window: 0 --> 0
[2026-01-14 15:12:27,079] DEBUG in optimization: Deferrable load 0: Validated optimization window: 0 --> 0
[2026-01-14 15:12:27,083] DEBUG in optimization: Processing deferrable load 1
[2026-01-14 15:12:27,083] DEBUG in optimization: Deferrable load 1: Proposed optimization window: 0 --> 28
[2026-01-14 15:12:27,084] DEBUG in optimization: Deferrable load 1: Validated optimization window: 0 --> 28
[2026-01-14 15:12:27,088] DEBUG in optimization: Processing deferrable load 2
[2026-01-14 15:12:27,089] DEBUG in optimization: Deferrable load 2: Proposed optimization window: 56 --> 64
[2026-01-14 15:12:27,089] DEBUG in optimization: Deferrable load 2: Validated optimization window: 56 --> 64
[2026-01-14 15:12:27,094] DEBUG in optimization: Processing deferrable load 3
[2026-01-14 15:12:27,094] DEBUG in optimization: Deferrable load 3: Proposed optimization window: 86 --> 0
[2026-01-14 15:12:27,094] DEBUG in optimization: Deferrable load 3: Validated optimization window: 86 --> 0
[2026-01-14 15:12:27,101] WARNING in optimization: Solver default unknown, using default
[2026-01-14 15:12:27,215] INFO in optimization: Status: Optimal
[2026-01-14 15:12:27,216] INFO in optimization: Total value of the Cost function = -2970.92
[2026-01-14 15:12:27,232] DEBUG in optimization: Deferrable load operating hours: [0, 0, 0, 0]
[2026-01-14 15:12:27,233] DEBUG in optimization: Deferrable load timesteps: None
[2026-01-14 15:12:27,233] DEBUG in optimization: Deferrable load start timesteps: [0, 0, 56, 86]
[2026-01-14 15:12:27,234] DEBUG in optimization: Deferrable load end timesteps: [0, 28, 64, 0]
[2026-01-14 15:12:27,235] DEBUG in optimization: Selected cost function type: self-consumption
[2026-01-14 15:12:27,235] DEBUG in optimization: Solver selected: default
[2026-01-14 15:12:27,236] INFO in optimization: Optimization status: Optimal