-
-
Notifications
You must be signed in to change notification settings - Fork 216
Add‐ons feature : add env variables
Alexandre edited this page Nov 1, 2023
·
6 revisions
Most add-ons include a feature to add your custom environment variables execute when it is starting.
You just need to create a folder named /config/addons_config/${slug}, slug corresponding to the "slug" value from the addon config.json in my repository. You don't have to search for it manually, as the exact path is described in the addon log when starting.
In this folder, you need to create a file named config.yaml that will contain 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
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