Dark + Light CSS + JS Domoticz Font Awesome 7

Nightglass Premium Dark Theme for Domoticz

A sophisticated dark/light theme that transforms your Domoticz home automation dashboard into a focused, control-room experience — deep navy surfaces, smart device icons, sparkline charts, and a command palette that puts every device at your fingertips.

What is Nightglass?

Nightglass is a drop-in theme for Domoticz. Clone the repository into Domoticz's www/styles/ directory — custom.css and custom.js are thin loaders that pull in the full theme from the src/css/ and src/js/ modules — and your dashboard is transformed.

The CSS layer handles all visual styling: color tokens, card layout, glassmorphism login, responsive navbar, and full dark/light mode support via a single body.dz-light class toggle. The JS layer adds intelligence: automatic Font Awesome icon replacement for every device type, live sparkline micro-charts, a command palette, keyboard shortcuts, cloud-synced settings, and more.

16 Theme Presets
One-click palettes from Nightglass to Cyberpunk, Nord, Dracula, and more. Full dark & light color systems for each.
Command Palette
Ctrl+K — global fuzzy search and device control from any page, like Spotlight for your home.
Sparkline Charts
Inline SVG micro-charts on every sensor card showing the last 24h trend — temperature, humidity, rain, wind, and more.
Smart Icon System
90+ device types automatically mapped to Font Awesome icons with correct on/off colors, glow effects, and wind rotation.
Dark / Light Mode
Full peer dark and light color systems. One-click toggle, OS auto-detection, and per-mode color customization.
Cloud Sync
Settings stored as Domoticz user variables — your theme follows you across every browser and device automatically.

Installation

Nightglass is a drop-in theme. No build step, no Node, no dependencies — clone it once and activate in Domoticz settings.

1

Navigate to your Domoticz styles directory

Domoticz loads custom themes from www/styles/ inside its install directory.

bash
cd /home/pi/domoticz/www/styles/
2

Clone the repository into a theme folder

The folder name determines the theme name shown in Domoticz. You can call it anything — nightglass is the conventional name.

bash
git clone https://github.com/galadril/Domoticz-Nightglass-Theme.git nightglass

Or update an existing installation:

bash
cd nightglass && git pull

The theme ships as custom.css, custom.js, and the full src/ directory. All CSS lives in src/css/ and all JS modules in src/js/ — the root files are thin loaders that import them. You need the entire repository, not just the two root files.

3

Restart Domoticz (first-time install only)

Domoticz needs a restart to detect the new theme directory. Not required for updates.

bash
sudo systemctl restart domoticz
4

Activate in Domoticz

Go to Setup → Settings → Interface and set the theme to Nightglass. Save and reload.

Note: Nightglass overrides the Default theme CSS. The folder name you choose is what appears in the Domoticz theme dropdown — it does not have to be nightglass.

Visual Design

Nightglass uses a deep navy color palette with a single cool-blue accent that carries all interactive meaning — links, focus rings, active borders, and on-state icon color. Surface depth is created by stepping through surface-container levels, not by varying hue.

Elevation System
Four elevation levels using surface-container tokens. Glassmorphism reserved for modals & login — never on live device cards.
Smooth Animations
State-change flash, 3D card tilt, ambient device glow, and staggered navbar entrance. All respect prefers-reduced-motion.
Temperature Accents
Cards automatically pick up a color accent from the device's temperature reading — ice-blue at 0°C, warm red at 35°C+.
Fully Responsive
Navbar collapses to a hamburger, cards reflow to single column, filter drawer becomes mobile-optimized. Works on tablets and phones.
Staleness Indicator
Devices with no update for a configurable time period get a visual stale marker — instantly spot offline or stuck sensors.
System Font Stack
Zero web fonts. Text renders in the OS typeface — zero latency, zero layout shift, beautifully anti-aliased on every platform.

Color Token Reference

All colors are CSS custom properties defined in :root (dark) and overridden in body.dz-light (light). Never hardcode hex values.

TokenDark defaultRole
--dz-body-bg#1b1d25Page background
--dz-card-bg#23252fDevice card fill
--dz-accent-color#4e9af1Primary accent — links, focus, on-state
--dz-text-color#e2e4edPrimary text
--dz-text-muted#b0b3c6Secondary / label text
--dz-border-color#3a3b47Card and panel borders
--dz-success-color#4caf7dSuccess / on-state green
--dz-warning-color#f0a832Warning / low battery amber
--dz-danger-color#e05555Error / timeout red

Smart Features

The JS layer adds a layer of intelligence on top of the Domoticz AngularJS application without modifying any Domoticz files.

Live WebSocket Updates

Real-time card updates via Angular's device_update events — device values, icons, and timestamps update without any page refresh. State changes trigger a brief flash animation to draw your eye to what just changed.

Sparkline Micro-Charts

Every sensor card that supports history (temperature, humidity, rain, wind speed, counters, UV index) gets an inline SVG area chart injected beneath the value. Data is fetched from the Domoticz JSON API and rendered as a 24-hour trend.

Timestamp Formatting

Raw Domoticz timestamps are reformatted to human-readable relative labels: today 3:42 pm, yesterday 10:15 am, Apr 3, 2:00 pm. Each card gets a pinned footer bar with the formatted timestamp.

Ace Editor & Highcharts Theming

The Events page Ace editor automatically applies and persists your chosen theme. Highcharts panels (device history, reports) get a full dark or light palette applied globally — no chart looks out of place.

Icon System

Every Domoticz PNG device image is automatically replaced with a Font Awesome 7 icon using a two-pass replacement strategy: initial scan on load, then delta updates via MutationObserver watching image src attribute changes.

Device Map

90+ device types are mapped in DEVICE_MAP inside src/js/icons.js. Each entry specifies an icon class, an on-state color, and an off-state color:

javascript
// Add a new device type to DEVICE_MAP:
"ChargingStation48": {
    icon:     "fa-solid fa-charging-station",
    colorOn:  "#4e9af1",
    colorOff: "#6c757d"
}

Per-Device Overrides

Individual devices can override their icon and color from the Nightglass Settings panel in Domoticz — no code changes needed. See Per-Device Overrides.

Special Behaviors

FeatureHow it works
Wind directionCompass direction filenames (N, NE, E, …) apply a CSS transform: rotate(Ndeg) to the arrow icon
Temperature rangesThermometer icon color shifts from ice-blue (≤0°C) through green (18–22°C) to red (≥35°C)
Alert levelsAlert icons adapt color to the device's alert level (0–4) from green to red
Favorite starsFilled/outline star based on the device's favorite state
Ambient glowOn-state icons emit a soft box-shadow in colorOn tint
Skip patternsCamera defaults, RGB color picker, and evohome folder images are never replaced

Keyboard Shortcuts

Nightglass turns your keyboard into a dashboard remote. Three distinct shortcut systems cover navigation, search, and device control.

Quick Navigation — Number Keys

Press a number key (when no input is focused) to instantly jump to a section:

KeySection
1Dashboard
2Switches & Lights
3Scenes & Groups
4Temperature
5Weather
6Utility
7Cameras
8Log
9Setup

Page Filter — /

Quickly find a device on the current page. Type to filter, navigate with , press Enter to scroll to and flash-highlight the device. Press Esc to close.

Use this when you're already on the right page (e.g., Switches) and want to find one device among many without scrolling.

Command Palette — Ctrl + K

A Spotlight-style overlay for global device control from any page. Press Ctrl + K (or ⌘K on Mac) anywhere to open it.

ShortcutAction
Ctrl + KOpen / close the command palette
/ Navigate the device list
EnterToggle device on/off (or expand dimmer)
Shift + EnterNavigate to the device's page and highlight it
EscClose palette

Command Palette Features

  • Fuzzy search — type lvng lght to find "Living Room Light"
  • Favorites first — shows starred devices by default
  • Live state — current on/off/level/temp with color coding
  • Dimmer slider — inline 0–100% brightness control
  • Smart routing — auto-navigates to the correct page for each device type

Filter Bar

A multi-dimensional filter panel that replaces Domoticz's native room selector on every device page — pure client-side, zero page reloads.

The filter bar appears below the top bar on all category pages (Dashboard, Switches, Temperature, etc.). It offers four filter dimensions that can be combined:

DimensionOptionsBehavior
RoomsAll plans from DomoticzPersists across page navigation
TypeSwitch types & sensor types on current pagePruned when navigating to a new page
HardwareHardware names on current pagePruned when navigating to a new page
FavouritesOn / Off togglePruned when not relevant on new page

All filtering is AND-ed across dimensions and OR-ed within each dimension. The filter bar patches Angular's dashboardService.loadFavorites and livesocket.getJson to always fetch all devices (not just the current room's subset), so every device is in the DOM for instant client-side show/hide.

Open or close the filter panel with the Filters button in the search bar. On mobile it slides in as a full-height drawer with a backdrop.

Theme Presets

16 built-in palettes selectable with a single click in the Nightglass settings panel. Each preset defines a complete dark and light color system.

Nightglass The original dark theme — deep navy surfaces with cool blue accents
Emerald Forest Lush greens on charcoal — nature-inspired and easy on the eyes
Solar Flare Warm amber and burnt orange on deep brown — sunset dashboard vibes
Arctic Ice Crisp cyan and white on slate — clean, clinical, and modern
Violet Nebula Rich purples and magentas on deep space — a cosmic palette
Rose Gold Soft pink-copper tones on warm gray — elegant and refined
Monochrome Pure grayscale — minimal, distraction-free, and timeless
Crimson Ember Bold reds on dark charcoal — intense, dramatic, and powerful
Matrix Green phosphor on black — follow the white rabbit
Cyberpunk Neon magenta and electric cyan on pitch black — Night City awaits
Dracula The beloved Dracula color scheme — purple, pink, green and cyan on dark
Solarized Precision colors designed for readability and reduced eye strain
Synthwave Retro 80s neon — nostalgic vibes with electric pinks and purples
Nord Arctic-inspired pastels — calm, minimal, and easy on the eyes
Hacker Terminal amber on pitch black — command-line inspired
Ocean Depth Deep blues and teals — underwater serenity

Select any preset in Setup → Settings → Nightglass. Presets instantly apply with a live preview. You can then further fine-tune individual colors with the color editor.

Color Editor

Fine-tune every color role with a live preview. Changes take effect instantly on the Domoticz interface behind the settings panel.

The color editor exposes these categories independently for dark and light mode:

  • Accent colors — primary accent, danger, warning, success
  • Background & surfaces — page background, navbar, card fill, elevated surfaces
  • Borders — card borders, divider lines
  • Text — primary, secondary, and muted text hierarchy

Always update both dark and light color slots when changing a color role — each mode has separate storage.

Per-Device Icon Overrides

Assign a custom Font Awesome icon, on-color, and off-color to any individual device — no code changes required.

Open the Nightglass settings panel, navigate to Per-Device Icons, search for your device by name or idx, then pick any Font Awesome 7 icon from the visual picker and choose your colors. The override is stored as a Domoticz user variable and syncs across browsers.

  • Visual icon picker with live search across all Font Awesome icons
  • Color pickers for on-state and off-state colors with live preview
  • Overrides take effect immediately without page reload
  • Remove any override to revert to the automatic icon from DEVICE_MAP

Sync & Export

Nightglass settings are stored as Domoticz user variables (ngTheme_*) via the JSON API — your theme automatically follows you to any browser or device connected to the same Domoticz server.

Import / Export

The settings panel has one-click Export and Import buttons. Export saves your full color theme, feature flags, and icon overrides as a single JSON file that can be shared with the community or backed up.

StorageWhatWhen
Domoticz user variablesAll settings (primary store)On every change
localStorageDark/light mode preferenceInstant toggle (fast)
JSON export fileFull settings snapshotManual export

Settings are accessed via window.dzNightglassSettings.get(key) and .set(key, value). All feature flags are gated on these settings, making it easy to add new settings-controlled behaviors.

Settings Reference

All settings are accessible at Setup → Settings → Nightglass.

Display

Default color scheme
Starting mode on first load: dark, light, or follow OS prefers-color-scheme.
dark
Show last-update timestamps
Show or hide the formatted timestamp footer on each device card.
on
Uppercase device names
Apply text-transform: uppercase to device name bars.
off
Icon size
Scale all device icons globally: small, default, large.
default

Card Features

Sparkline charts
Show inline SVG micro-charts on sensor cards. Fetches from the Domoticz history API.
on
3D card tilt
Apply a subtle ±3° perspective tilt on device cards as you move your mouse over them.
off
Temperature-reactive accent
Cards pick up a color accent from the device's temperature value.
on
Ambient icon glow
On-state device icons emit a soft colored glow matching colorOn.
on
State-change flash
Brief flash animation when a device icon changes state (on → off or off → on).
on
Staleness indicator
Show a visual marker on device cards that haven't updated in a configurable time period.
on
Staleness threshold (hours)
How many hours without an update before a card is considered stale.
24

Icons

Font Awesome icon replacement
Enable or disable the entire icon replacement system. Disabling restores original Domoticz PNG images.
on

Advanced

Debug logging
Enable verbose [RF], [IC], etc. logging to the browser console.
off
Ace Editor theme
Preferred Ace theme for the Events page code editor. Persists in localStorage.
monokai

Dark / Light Mode

Nightglass ships with a full peer dark and light color system — light mode is not an afterthought, every color token has a light-mode counterpart.

The sun/moon button injected into the navbar cycles between dark → light → auto. In auto mode the OS prefers-color-scheme is respected and live OS theme changes are applied without a reload. The preference is stored in localStorage under the key dz-theme-style.

Light mode is implemented as a single body.dz-light class override — all dark-mode tokens in :root are re-declared in body.dz-light with light-palette values. This means any third-party CSS targeting Domoticz elements will also respond correctly if it uses the --dz-* variables.

The color editor lets you set separate accent, surface, and text colors for dark and light modes independently.

Troubleshooting

Theme not showing after installation

Make sure the theme folder is directly inside www/styles/ and contains both custom.css and custom.js plus the src/ directory. Restart Domoticz once after cloning, then select the theme by folder name in Setup → Settings → Interface → Theme.

Icons not replacing / showing broken images

The icon replacement patches into Angular's rendering cycle. If icons appear as broken PNGs, check the browser console for JS errors. Make sure Font Awesome is loading — it ships with Domoticz but can be blocked by ad-blockers. Try disabling extensions.

Sparklines not appearing

Sparklines require a successful call to json.htm?type=graph. If the Domoticz API is unreachable from the client, they silently skip. Enable debug logging in the Nightglass settings panel and check the browser console for [SP] log lines.

Settings not saving

Nightglass saves settings as Domoticz user variables. Ensure the Domoticz user account has write access. If the API call fails, settings fall back to localStorage for the current session but won't sync to other browsers.

Filter bar not showing all rooms

Room pills are built from the Domoticz plans API. If a plan has no devices, it won't appear. The filter bar fetches plan data once on init — if it was loaded before plans were ready, reload the page.

Updating

To update Nightglass to the latest version:

bash
cd /home/pi/domoticz/www/styles/nightglass
git pull

No Domoticz restart required for updates — the browser loads the new files on next page visit. Hard-refresh (Ctrl+Shift+R) if you see stale CSS or JS due to browser caching.

Your custom settings and per-device icon overrides are stored as Domoticz user variables — they are never touched by git pull.

Support & Donate

Found a bug? Have a feature request? Open an issue on GitHub — pull requests are very welcome.

Buy me a coffee

If Nightglass has made your Domoticz experience better, a small donation is always appreciated. It keeps the project going and the coffee warm.