Hi Sam,
Some more info on my config:
I provide following parameters at runtime:
{
"load_cost_forecast": [0.247, 0.247, 0.23, 0.23, 0.236, 0.236, 0.25, 0.25, 0.264, 0.264, 0.22, 0.22, 0.213, 0.213, 0.206, 0.206, 0.201, 0.201, 0.207, 0.207, 0.206, 0.206, 0.214, 0.214, 0.221, 0.221, 0.207, 0.207, 0.2, 0.2, 0.19, 0.19, 0.191, 0.191, 0.19, 0.19, 0.196, 0.196, 0.212, 0.212, 0.206, 0.206, 0.218, 0.218, 0.214, 0.214, 0.2, 0.2, 0.188, 0.188],
"prod_price_forecast":[0.13, 0.13, 0.113, 0.113, 0.119, 0.119, 0.133, 0.133, 0.147, 0.147, 0.103, 0.103, 0.097, 0.097, 0.089, 0.089, 0.084, 0.084, 0.09, 0.09, 0.09, 0.09, 0.097, 0.097, 0.104, 0.104, 0.091, 0.091, 0.084, 0.084, 0.074, 0.074, 0.075, 0.075, 0.073, 0.073, 0.079, 0.079, 0.096, 0.096, 0.089, 0.089, 0.101, 0.101, 0.097, 0.097, 0.083, 0.083, 0.071, 0.071],
"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, 0, 0, 0, 0, 0, 2, 26, 62, 101, 154, 197, 222, 244, 249, 235, 217, 187, 165, 133, 91, 55, 24, 2, 0],
"def_total_hours": [20, 0],
"def_start_timestep": [0,0],
"def_end_timestep": [0,-25],
"prediction_horizon": 48,
"soc_init": 0.08
}
This is generated dynamically using templating in Node-Red.
This worked before, but since my last update of EMHASS, the abovementioned issue began.
Here’s my EMHASS config file:
{
"battery_charge_efficiency": 0.95,
"battery_charge_power_max": 3000,
"battery_discharge_efficiency": 0.95,
"battery_discharge_power_max": 3000,
"battery_dynamic_max": 0.9,
"battery_dynamic_min": -0.9,
"battery_maximum_state_of_charge": 0.9,
"battery_minimum_state_of_charge": 0.02,
"battery_nominal_energy_capacity": 8000,
"battery_target_state_of_charge": 0.6,
"compute_curtailment": false,
"continual_publish": false,
"costfun": "profit",
"delta_forecast_daily": 1,
"end_timesteps_of_each_deferrable_load": [
0,
9
],
"historic_days_to_retrieve": 2,
"inverter_is_hybrid": false,
"load_cost_forecast_method": "hp_hc_periods",
"load_forecast_method": "naive",
"load_negative": false,
"load_offpeak_hours_cost": 0.1419,
"load_peak_hour_periods": {
"period_hp_1": [
{
"start": "02:54"
},
{
"end": "15:24"
}
],
"period_hp_2": [
{
"start": "17:24"
},
{
"end": "20:24"
}
]
},
"load_peak_hours_cost": 0.1907,
"logging_level": "DEBUG",
"lp_solver": "COIN_CMD",
"lp_solver_path": "empty",
"maximum_power_from_grid": 8000,
"maximum_power_to_grid": 9000,
"method_ts_round": "first",
"modules_per_string": [
16
],
"nominal_power_of_deferrable_loads": [
2400,
7360
],
"number_of_deferrable_loads": 2,
"operating_hours_of_each_deferrable_load": [
18,
1
],
"optimization_time_step": 30,
"photovoltaic_production_sell_price": 0.1419,
"production_price_forecast_method": "constant",
"pv_inverter_model": [
"Fronius_International_GmbH__Fronius_Primo_5_0_1_208_240__240V_"
],
"pv_module_model": [
"CSUN_Eurasia_Energy_Systems_Industry_and_Trade_CSUN295_60M"
],
"sensor_linear_interp": [
"sensor.pv1_inverter_watts",
"sensor.power_load_no_var_loads"
],
"sensor_power_load_no_var_loads": "sensor.power_load_no_var_loads",
"sensor_power_photovoltaics": "sensor.pv1_inverter_watts",
"sensor_replace_zero": [
"sensor.pv1_inverter_watts"
],
"set_battery_dynamic": false,
"set_deferrable_load_single_constant": [
false,
false
],
"set_deferrable_startup_penalty": [
0,
0
],
"set_nocharge_from_grid": false,
"set_nodischarge_to_grid": false,
"set_total_pv_sell": false,
"set_use_battery": true,
"set_zero_min": true,
"start_timesteps_of_each_deferrable_load": [
0,
3
],
"strings_per_inverter": [
1
],
"surface_azimuth": [
205
],
"surface_tilt": [
30
],
"treat_deferrable_load_as_semi_cont": [
true,
false
],
"weather_forecast_method": "scrapper",
"weight_battery_charge": 0.01,
"weight_battery_discharge": 0.01
}
If you’d like the same chart is I have, here’s the code
YAML code:
type: custom:apexcharts-card
span:
start: minute
header:
show: true
title: Optimizer
show_states: true
colorize_states: true
now:
show: true
yaxis:
- id: power
decimals: 0
max: 8000
- id: price
decimals: 3
opposite: true
series:
- entity: sensor.p_pv_forecast
yaxis_id: power
curve: stepline
show:
in_header: before_now
legend_value: false
stroke_width: 1
data_generator: |
return entity.attributes.forecasts.map((entry) => {
return [new Date(entry.date), entry.p_pv_forecast];
});
- entity: sensor.p_load_forecast
yaxis_id: power
curve: stepline
show:
in_header: before_now
legend_value: false
stroke_width: 1
data_generator: |
return entity.attributes.forecasts.map((entry) => {
return [new Date(entry.date), entry.p_load_forecast];
});
- entity: sensor.p_deferrable0
name: Warmtepomp
yaxis_id: power
type: area
stroke_width: 2
show:
in_header: before_now
legend_value: false
data_generator: |
return entity.attributes.deferrables_schedule.map((entry) => {
return [new Date(entry.date), entry.p_deferrable0];
});
- entity: sensor.p_deferrable1
name: Laadpaal
yaxis_id: power
type: area
stroke_width: 2
show:
in_header: before_now
legend_value: false
data_generator: |
return entity.attributes.deferrables_schedule.map((entry) => {
return [new Date(entry.date), entry.p_deferrable1];
});
- entity: sensor.current_electricity_price_offtake
name: Afnametarief
curve: stepline
stroke_width: 1
data_generator: |
return entity.attributes.prices.map((entry) => {
return [new Date(entry.time), entry.price];
});
show:
legend_value: false
in_header: before_now
yaxis_id: price
float_precision: 3