Home Assistant Frontend

This offers the official frontend to control Home Assistant. This integration is by default enabled, unless you’ve disabled or removed the default_config: line from your configuration. If that is the case, the following example shows you how to enable this integration manually:

# Example configuration.yaml entry

Configuration Variables

javascript_versionstring(Optional, default: auto)

DEPRECATED, it is now done using feature detection in the browser. Version of the JavaScript to serve to clients. Options: es5 - transpiled so old browsers understand it. latest - not transpiled, so will work on recent browsers only. auto - select a version according to the browser user-agent. The value in the configuration can be overiden by putting es5 or latest in the URL. For example http://localhost:8123/states?es5


Allow to define different themes. See below for further details.

[identifier]list | mapRequired

Name to use in the frontend.

[css-identifier]list | stringRequired

The CSS identifier.


DEPRECATED List of additional resources to load in latest javascript mode.


List of additional javascript modules to load in latest javascript mode.


List of additional javascript code to load in es5 javascript mode.


Allow to point to a directory containing frontend files instead of taking them from a pre-built PyPI package. Useful for Frontend development.

Defining Themes

Starting with version 0.49 you can define themes:

# Example configuration.yaml entry
      primary-color: pink
      primary-color: blue

The example above defined two themes named happy and sad. For each theme you can set values for CSS variables. For a partial list of variables used by the main frontend see ha-style.ts.

Check our community forums to find themes to use.

Theme automation

There are 2 themes-related services:

  • frontend.reload_themes: reloads theme configuration from your configuration.yaml file.
  • frontend.set_theme(name): sets backend-preferred theme name.

Example in automation:

Set a theme at the startup of Home Assistant:

  - alias: 'Set theme at startup'
     - platform: homeassistant
       event: start
      service: frontend.set_theme
        name: happy

To enable “night mode”:

  - alias: 'Set dark theme for the night'
      - platform: time
        at: '21:00:00'
      - service: frontend.set_theme
          name: darkred

Manual Theme Selection

When themes are enabled in the configuration.yaml file, a new option will show up in the user profile page (accessed by clicking your user account initials at the bottom of the sidebar). You can then choose any installed theme from the dropdown list and it will be applied immediately.

Set a theme

Loading extra JavaScript

Starting with version 0.95 you can load extra custom JavaScript.


# Example configuration.yaml entry
    - /local/my_module.js
    - /local/my_es5.js

Modules will be loaded with import(), on devices that support it (latest mode). For other devices (es5 mode) you can use extra_js_url_es5, this will be loaded with <script defer src=''></script>

The ES5 and module version will never both be loaded, depending on if the device supports import the module of ES5 version will be loaded.

Manual Language Selection

The browser language is automatically detected. To use a different language, go to the user profile page (accessed by clicking your user account initials at the bottom of the sidebar) and select one. It will be applied immediately.

Choose a Language