Skip to content

Configuration

Stefan Allius edited this page May 10, 2026 · 8 revisions

Configuration procedure in general

The proxy requires some settings for operation, which can be taken from various sources. The internal default configuration is always read first. This contains all mandatory values and sensible default values. Other files, if available, are then parsed and the configuration is supplemented or replaced with the new values:

  1. read default_config.toml from the source directory
  2. read env values
  3. read config.json from the config dir
  4. read config.toml from the config dir
  5. read JSON-file specified by the --json_config command line argument
  6. read TOML-file specified by the --toml_config command line argument

The lowest priority is therefore an Env variable and the highest a toml file, which is passed to the CLI.

Configuration procedure for the Home Assistant App variant

If the proxy is operated as an HA App, the configuration is created in the app administration and transferred to the proxy as a json file (/data/options.json).

The 6 steps for creating the configuration are as follows:

  1. read default_config.toml from the source directory
  2. read env values to get the MQTT configuration for HA's mosquito setup
  3. read /homeassistant/tsun-proxy/config.json if exists
  4. read /homeassistant/tsun-proxy/config.toml if exists
  5. read /data/options.json
  6. NOT USED

If you want to set additional configuration values that are not supported by the app administration, you can create a config.json or config.toml file and put this into /addon_configs/{REPO}_<your addon's slug> directory of your HA machine. This directory will be mapped into the app as /homeassistant/tsun-proxy/ directory. So the proxy can read the config.json or config.toml file. This will be logged in the protocol of the app during the start. If the app is installed locally, {REPO} will be local. If the app is installed from a GitHub repository, {REPO} is a hashed identifier generated from the GitHub repository's. The <your addon's slug> depends on the version you have installed.

You will find this information on the Info page of you running app under hostname: App info page showing the hostname of the container

So for this dev version the complete path will be: /addon_configs/c676133d_tsun-proxy-dev/config.json

Configuration procedure for the prebuild docker container

The 6 steps for creating the configuration are as follows:

  1. read default_config.toml from the source directory
  2. read env values
  3. read /home/tsun-proxy/config.json if exists
  4. read /home/tsun-proxy/config.toml if exists
  5. NOT USED
  6. NOT USED

It is recommended that you only use config.toml (step 4). For security reasons, the MQTT credentials (MQTT_USER and MQTT_PASSWD) should be transferred via the environment and not be specified in plain text in config.toml. However, never set them in the Docker build command, as this can cause them to be displayed with Docker Inspect.

Clone this wiki locally