EMHASS & EMHASS-Add-on differences

User will pass parameters into EMHASS differently, based on running Standalone mode or addon Mode.
This page tries to help to resolve the common confusion between the two.
Its best to see EMHASS-Add-on as a Home Assistant Docker wrapper for EMHASS. However, because of this containerization, certain changes are made between the two modes.

Configuration & parameter differences

Both EMHASS & EMHASS-Add-on utilize config_emhass.yaml for receiving parameters.
Where they diverge is EMHASS-Add-ons additional use of options.json, generated by Home Assistants Configuration Page.
Any passed parameters given in options.json will overwrite the parameters hidden in the config_emhass.yaml file in EMHASS. (this results in config_emhass.yaml used for parameter default fall back if certain required parameters were missing in options.json)

The parameters naming convention has also been changed in options.json, designed to make it easier for the user to understand.

See bellow for a list of associations between the parameters from config_emhass.yaml and options.json:
You can view the current parameter differences in the Utils.py file under the build_params function.

config

config_emhass.yaml

options.json

options.json list dictionary key

retrieve_hass_conf

freq

optimization_time_step

retrieve_hass_conf

days_to_retrieve

historic_days_to_retrieve

retrieve_hass_conf

var_PV

sensor_power_photovoltaics

retrieve_hass_conf

var_load

sensor_power_load_no_var_loads

retrieve_hass_conf

load_negative

load_negative

retrieve_hass_conf

set_zero_min

set_zero_min

retrieve_hass_conf

method_ts_round

method_ts_round

params_secrets

solcast_api_key

optional_solcast_api_key

params_secrets

solcast_rooftop_id

optional_solcast_rooftop_id

params_secrets

solar_forecast_kwp

optional_solar_forecast_kwp

params_secrets

time_zone

time_zone

params_secrets

lat

Latitude

params_secrets

lon

Longitude

params_secrets

alt

Altitude

optim_conf

set_use_battery

set_use_battery

optim_conf

num_def_loads

number_of_deferrable_loads

optim_conf

P_deferrable_nom

list_nominal_power_of_deferrable_loads

nominal_power_of_deferrable_loads

optim_conf

def_total_hours

list_operating_hours_of_each_deferrable_load

operating_hours_of_each_deferrable_load

optim_conf

treat_def_as_semi_cont

list_treat_deferrable_load_as_semi_cont

treat_deferrable_load_as_semi_cont

optim_conf

set_def_constant

list_set_deferrable_load_single_constant

set_deferrable_load_single_constant

optim_conf

weather_forecast_method

weather_forecast_method

optim_conf

load_forecast_method

load_forecast_method

optim_conf

delta_forecast

delta_forecast_daily

optim_conf

load_cost_forecast_method

load_cost_forecast_method

optim_conf

load_cost_hp

load_peak_hours_cost

optim_conf

load_cost_hc

load_offpeak_hours_cost

optim_conf

prod_price_forecast_method

production_price_forecast_method

optim_conf

prod_sell_price

photovoltaic_production_sell_price

optim_conf

set_total_pv_sell

set_total_pv_sell

optim_conf

lp_solver

lp_solver

optim_conf

lp_solver_path

lp_solver_path

optim_conf

set_nocharge_from_grid

set_nocharge_from_grid

optim_conf

set_nodischarge_to_grid

set_nodischarge_to_grid

optim_conf

set_battery_dynamic

set_battery_dynamic

optim_conf

battery_dynamic_max

battery_dynamic_max

optim_conf

battery_dynamic_min

battery_dynamic_min

optim_conf

weight_battery_discharge

weight_battery_discharge

optim_conf

weight_battery_charge

weight_battery_charge

optim_conf

def_start_timestep

list_start_timesteps_of_each_deferrable_load

start_timesteps_of_each_deferrable_load

optim_conf

def_end_timestep

list_end_timesteps_of_each_deferrable_load

end_timesteps_of_each_deferrable_load

plant_conf

P_grid_max

maximum_power_from_grid

plant_conf

module_model

list_pv_module_model

pv_module_model

plant_conf

inverter_model

list_pv_inverter_model

pv_inverter_model

plant_conf

surface_tilt

list_surface_tilt

surface_tilt

plant_conf

surface_azimuth

list_surface_azimuth

surface_azimuth

plant_conf

modules_per_string,list_modules_per_string

modules_per_string

plant_conf

strings_per_inverter

list_strings_per_inverter

strings_per_inverter

plant_conf

Pd_max

battery_discharge_power_max

plant_conf

Pc_max

battery_charge_power_max

plant_conf

eta_disch

battery_discharge_efficiency

plant_conf

eta_ch

battery_charge_efficiency

plant_conf

Enom

battery_nominal_energy_capacity

plant_conf

SOCmin

battery_minimum_state_of_charge

plant_conf

SOCmax

battery_maximum_state_of_charge

plant_conf

SOCtarget

battery_target_state_of_charge

Descriptions of each parameter, can be found at:

Passing in secret parameters

Secret parameters get passed differently, depending on which mode you choose. Alternative options are also present for passing secrets if running EMHASS separately from Home Assistant. (I.e. not via EMHASS-Add-on)

EMHASS (with standalone mode)

Running EMHASS in standalone mode’s default workflow retrieves all secret parameters via a passed secrets_emhass.yaml file. An example template has been provided under the name secrets_emhass(example).yaml.

Alternative Options

For users who are running EMHASS with methods other than EMHASS-Add-on, secret parameters can be passed with the use of arguments and/or environment variables. (instead of secrets_emhass.yaml)

Some arguments include: --url and --key
Some environment variables include: TIME_ZONE, LAT , LON, ALT, EMHASS_URL, EMHASS_KEY

Note: As of writing, EMHASS standalone will override ARG/ENV secret parameters if file is present.

For more information on passing arguments and environment variables using docker, have a look at some examples from Configuration and Installation and EMHASS Development pages.

EMHASS-Add-on (addon mode)

By default the URL and KEY parameters have been set to empty/blank. This results in EMHASS calling to its Supervisor API to gain access locally. This is the easiest method, as there is no user input necessary.

However, if you wish to receive/send sensor data to a different Home Assistant environment, set url and key values in the hass_url & long_lived_token hidden parameters.

  • hass_url example: https://192.168.1.2:8123/

  • long_lived_token generated from the Long-lived access tokens section in your user profile settings

Secret Parameters such as: time_zone, lon, lat and alt are also automatically passed in via the Home Assistants environment. (Values set in the Home Assistants config/general page)
Note: Local currency could also be obtained via the Home Assistant environment, however as of writing, this functionality has not yet been developed.

Secret Parameters such as: solcast_api_key, solcast_rooftop_id and solar_forecast_kwp (used by their respective weather_forecast_method parameter values), can also be set via hidden parameters in the configuration page.