Skip to content

Add‐ons feature : add env variables

Alexandre edited this page Nov 24, 2023 · 6 revisions

Auto scripting feature

Most add-ons include a feature to add your custom environment variables execute when it is starting.

The path is described in the starting log. To access it, you need to use my Filebrowser addon. Depending on the addon structure (old or new HA logic) you can look for the folder containing your addon name either in /addon_configs/XXX-name ; or in /homeassistant/addons_config/name. If you have started the addon at least once , it will contain a config.yaml file.

In this file, you can set all the environment variables that you wish to add to the addon. It must respect the yaml format - to be sure you can use the site https://www.yamllint.com/ to check its validity. Here is a customizable example : https://github.com/alexbelgium/hassio-addons/blob/master/.templates/config.template

Examples

Example 1 : add a TZ variable to your addon
---
#============================#
# ALEXBELGIUM'S ENV INJECTOR #
#============================#
#
# All env variables set in this file will be enabled in the app
# This allows enabling more options that normally available in the addon options
# This file must be filled according to the yaml format.
# If the format is invalid, the addon will note an error.
# To validate your yaml, you can use the free online tool http://www.yamllint.com/

# EXAMPLE of the format (you need to remove the # for it to become active)
TZ: Europe/Paris