Automatically Switch Themes for All Devices in Home Assistant

by Danny
0 comment

READING TIME: 2 MINUTES

In this guide, I’m going to show you a simple automation to set the default theme for all of your devices in Home Assistant.

This is a great way to make sure all of your Home Assistant devices follow the same theme. Rather than having to set each theme manually, having an automation automatically switch to the correct theme will save you a lot of time and effort, especially if you like to tinker and experiment with new themes and and Lovelace card layouts.

Let’s get started!


Step 1: Install Home Assistant Themes

First, you need install a few themes. You can either do this using HACS for one-click theme installs, or install a theme manually. Follow this guide to install a theme using either option.


Step 2: Set devices to use backend-selected themes

For this automation to work, you’ll need to set each device to use the “backend-selected” theme. To do, click your profile in the bottom-right corner .

Under the Theme section, choose Backend-selected.


Step 3: Create An Automation to Switch Themes at Startup

Next, we need to create a simple automation that will switch to a theme we specify. You will need to know the name of one of your themes for this step. Theme names can be found under your Profile > themes section.

File Editor > automations.yaml.

Then, paste this in this code at the very bottom:

- alias: 'Set Home Assistant theme at startup'
  trigger:
    platform: homeassistant
    event: start
  action:
    service: frontend.set_theme
    data:
      name: dark_teal

Then, restart Home Assistant. After rebooting, you should see that all of your devices are now using the backend-selected theme that you’ve specified in the automation!


Troubleshooting

If your mobile device doesn’t have the option to use the “backend-selected” theme, sign out of the app. You can sign out by clicking your Profile > Log Out.

The next time you log in, it should automatically show the new theme, but if it doesn’t – make sure you have backend-selected theme selected.


My Favorite Home Assistant Devices

Below are some of the Home Assistant-compatible devices I personally use in my home. I highly recommend each of them.

The full list of all Home Assistant compatible & recommended devices I use can be found on my Equipment List page.

0 comment

You may also like

Leave a Comment