Configuration Overview
Hassette configuration controls how the framework connects to Home Assistant, discovers your app files, manages the web UI, and stores persistent data. All settings live in a single hassette.toml file (or can be overridden via environment variables or CLI flags).
Configuration Sources
Hassette loads configuration from multiple sources, applied in this precedence order (highest to lowest):
- CLI flags — arguments passed to
hassetteat startup (e.g.,--base-url,--token) - Environment variables — variables like
HASSETTE__TOKENorHASSETTE__BASE_URL .envfiles — loaded from.envfiles; same key names as environment variableshassette.toml— the primary configuration file
When the same setting appears in multiple sources, the higher-precedence source wins. For example, setting HASSETTE__TOKEN in the environment overrides token in hassette.toml.
File Locations
Hassette searches for hassette.toml in:
/config/hassette.toml./hassette.toml(current working directory)./config/hassette.toml
.env files are searched in:
/config/.env./.env(current working directory)./config/.env
Override either with --config-file / -c or --env-file / -e.
Docker
In Docker, mount your configuration volume to /config. Hassette checks /config/hassette.toml first.
Configuration Sections
| Section | Purpose | Reference |
|---|---|---|
[hassette] |
Connection, runtime, storage, web UI, and all global settings | Global Settings |
[apps.<name>] |
Register and configure individual apps | Applications |
[[apps.<name>.config]] |
Multiple instances of the same app class | Applications |
Credentials
Your Home Assistant long-lived access token should never be committed to version control. Store it as an environment variable or in a .env file:
HASSETTE__TOKEN=your_token_here
See Authentication for all credential options.
See Also
- Authentication — setting up tokens and secrets
- Global Settings — connecting to Home Assistant and all runtime options
- Applications — registering and configuring your apps
- Getting Started — a guided first run