Dark mode (vs dark theme) on kiosk boot-up

(edited to simplify the post/question)
The goal:
I want “dark mode” enabled by default - for the default theme. Sounds simple.

That’s really it - It’ll allow my Pi Kiosk to boot without manual intervention, so my wife sees the screen in the right mode right from the start - that’s the need.

“Dark mode” was introduced in release 114, and you can see the setting if you click on the user profile at the bottom left corner of any UI instance.

In that release note link above, I find wording that describes an external detection of a “dark mode” on the host device - but doesn’t describe what the mechanism is, or ‘what host devices that have dark mode’ are supported specifically:

We detect if your device is in dark mode; if that is the case, our default theme will go dark. You can override the automatic switching between dark and light theme in your profile.

Raspbian Lite has no dark/light mode, so there must be another way.

One means of that is shown here. Screenshot is from the release notes - I’m referencing the “auto, light, dark” radio buttons at the center:


This setting does not persist, however. Reboot the Pi, it launches back up in “Light mode”.

I’ve tried an automation script - I do have a “on startup” trigger that works (hopefully that’s client-side, not server-side), but can’t find any action target details on what to actually set, to switch to “Dark Mode”.
I honestly don’t care if it’s a server-side setting impacting all users, or a client side automation.

Installation details:
I have a Pi is in a 3.5" touchscreen case, and I’m taking advantage of this form factor to provide my (luddite) wife a control panel that she wished for on her end table.
The case also houses the Pi that is running HA, in a separate virtual space.

  • Raspbian Lite
  • Home Assistant Core
  • X11/X windows, started in .bashrc script
  • Chromium browser, started in .xinitrc script
    • Using command line switches to start full screen, 65% zoom, no menus, scrollbars, etc.
    • Displays the Lovelace panel I built for my wife, to fit this tiny screen.

It needs to just start up and be ready for her (or anyone) to use, without trying to poke open a 65% shrunk menu window and access the override in the screenshot above.

This Raspbian Lite / HACore was installed exactly as official documentation, if that helps with the context.

A few things I’ve tried:
Here’s an automation - the trigger works, but I really don’t know what to set:


6336207413575680
My suspicion is “name: dark” is going to have it look for a theme called “dark”, rather than “dark mode” on the default theme.
Trying “mode: dark” seems to not exist, per a different logged error.
Since the trigger works, I can at least try things and access error details - I just don’t know specifically what property or action target details.

I have tried to find target details from threads like this - and probably 6 or 7 others I’ve picked apart over the past few weeks. I suspect I’m attempting to manipulate the wrong properties with my actions.

User context:

Just noting - this hardware is both server AND client.
HA is starting before any browser instance exists. It’s running in a virtual space under a different user, and serves (literally) as a server.
The browser starts separately as a client under it’s own user scope (different user).
So - settings or automations that operate within that context won’t impact the client device instance that I want to observe the results on. Essentially I have a client session on the screen, accessing the server that’s running in a virtual space.

That being said - if there’s a server-side setting that presents the “dark mode” of the default theme for any connected clients - no problem. I don’t care if all my clients get dark mode forced upon them.

In the automation, I’m assuming “frontend” is literally the context of any/every client instance, but I can’t say I know that for certain.

Even more stuff I’ve tried:
I’m seeing this thread that isn’t what I am doing (they are trying to script theme selection, I’m trying to script mode selection), that seems to imply I may also need to change a setting -
Would that selection be set to “backend-selected” if it’s not theme, but a theme’s “dark mode” that my automation is trying to engage?

*Note: that thread is for launching a whole different theme * - I would prefer not to go down that road since the default theme w. dark mode is perfect for me, and then I’d have to spend lots of time finding or making a theme that simply did that - that’s a kludge workaround I’d like to avoid if possible.

But if a theme-switching automation is the only option - I could be open to that… it just seems kludgy to have to replicate something that already exists (by default, even) as a whole separately-crafted theme.
Plus - that setting?

Resolved-

Seems apparent that the “dark mode” isn’t accessible other than from [unspecified] devices that themselves have a dark/light mode that HA has been designed to detect and follow suit.

It took less time and effort to install a dark theme and play with it to get the colors to be what I want.

The automation above works - in the “name: dark” just name a theme that you have installed, and then on your user profile page set the theme to “backend-selected” and it’ll default to that theme on all devices that access HA.

1 Like