mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-20 07:46:52 +00:00
Added documentation for the env_var tag in configuration files (#2982)
This commit is contained in:
parent
80814f25ca
commit
de4f34867e
@ -61,3 +61,20 @@ sensor:
|
|||||||
state_topic: sensor2/topic
|
state_topic: sensor2/topic
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### {% linkable_title Using Environment Variables %}
|
||||||
|
|
||||||
|
You can include values from your system's environment variables with `!env_var`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
http:
|
||||||
|
api_password: !env_var PASSWORD
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Default Value
|
||||||
|
|
||||||
|
If an environment variable is not set, you can fallback to a default value.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
http:
|
||||||
|
api_password: !env_var PASSWORD default_password
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user