Skip to main content

Config

On the hass object there is an instance of the Config class. The Config class contains the users preferred units, the path to the config directory and which components are loaded.

NameTypeDescription
latitudefloatLatitude of the instance location
longitudefloatLongitude of the instance location
elevationintElevation of the instance
location_namestrName of the instance
time_zonestrTimezone
unitsUnitSystemUnit system
internal_urlstrURL the instance can be reached on internally
external_urlstrURL the instance can be reached on externally
currencystrPreferred currency
countrystrCountry the instance is in
languagestrPreferred language
config_sourceConfigSourceIf the configuration was set via the UI or stored in YAML
skip_pipboolIf True, pip install is skipped for requirements on startup
skip_pip_packageslist[str]List of packages to skip when installing requirements on startup
componentsset[str]List of loaded components
apiApiConfigAPI (HTTP) server configuration
config_dirstrDirectory that holds the configuration
allowlist_external_dirsset[str]List of allowed external dirs to access
allowlist_external_urlsset[str]List of allowed external URLs that integrations may use
media_dirsdict[str, str]Dictionary of Media folders that integrations may use
safe_modeboolIf Home Assistant is running in safe mode
legacy_templatesboolUse legacy template behavior

It also provides some helper methods. See available methods.