WTH Why can't I easily upload the standard background for the day and night theme in the UI?

How can you change the standard dashboard background picture for the day and night theme, while keeping the regular light/dark mode?

Or in other words, how can I set a background picuture in home assistant the easyway for dark and light mode? Can’t this no be made easy in the UI?

If you edit dashboard and then click the menu again, there is ‘Raw configuration editor’. You can upload the picture of your choice and then add: -

views:
  - background: center / cover no-repeat url("/local/Background.jpg")

Changing Background.jpg to whatever the file is called in your ‘www’ folder.

You might have to do this for each of your tabs, I can’t quite remember :thinking:

Thanks, but this way the background stays the same when the system switches from light to dark mode, need a different background in dark mode because of read-ability of the font-color changes. That’s why I “what the hack”-ed this can’t this be easyer :slight_smile:

1 Like

I solved my own problem by adding this below to the configyaml. It turned out I was still using an old themes layout in the configyaml, while more is possible these days.

frontend:
  themes:
    day_and_night:
      primary-color: "#3593bc"
      modes:
        light:
          lovelace-background: 'center / cover no-repeat url("/local/backgrounday.png") fixed'
        dark:
          lovelace-background: 'center / cover no-repeat url("/local/backgroundnight.jpg") fixed'

Like this it seems I can benefit form the built-in auto day/night switching, while maintaining the predesigned colorscemes of home assistant, and only adding a background for day and night so everything looks a bit better (standard these white cards offer little contrast to the background). Oh and making only the primary color a little a litte less blue.

Oh maybe i’m wrong…It worked yesterday but now it got an error in the log when an automation triggers “dark”. I don’t know exactly why yet…:

Logger: homeassistant.components.frontend
Source: components/frontend/init.py:437
Integration: Home Assistant Frontend (documentation, issues)
First occurred: 17:34:11 (1 occurrences)
Last logged: 17:34:11

Theme dark not found

alias: Auto theme change
description: Auto theme change
trigger:
  - platform: state
    entity_id: sun.sun
condition: []
action:
  - service_template: frontend.set_theme
    data_template:
      name: |
        {% if is_state('sun.sun', 'above_horizon') %}
          light
        {% else %}
          dark
        {% endif %}
    alias: Verander theme met zon op of onder
mode: single

Change name to mode