Skip to content

Repository files navigation

🇺🇦 У⁠к⁠р⁠а⁠ї⁠н⁠с⁠ь⁠к⁠а | ru Р⁠у⁠с⁠с⁠к⁠и⁠й | 🇿🇦 A⁠f⁠r⁠i⁠k⁠a⁠a⁠n⁠s | 🇸🇦 ا⁠ل⁠ع⁠ر⁠ب⁠ي⁠ة | 🇧🇬 Б⁠ъ⁠л⁠г⁠а⁠р⁠с⁠к⁠и | 🇧🇩 বাং⁠লা | 🇧🇦 B⁠o⁠s⁠a⁠n⁠s⁠k⁠i | ca C⁠a⁠t⁠a⁠l⁠à | 🇨🇿 Č⁠e⁠š⁠t⁠i⁠n⁠a | cy C⁠y⁠m⁠r⁠a⁠e⁠g | 🇩🇰 D⁠a⁠n⁠s⁠k | 🇩🇪 D⁠e⁠u⁠t⁠s⁠c⁠h | 🇬🇷 Ε⁠λ⁠λ⁠η⁠ν⁠ι⁠κ⁠ά | eo E⁠s⁠p⁠e⁠r⁠a⁠n⁠t⁠o | 🇪🇸 E⁠s⁠p⁠a⁠ñ⁠o⁠l | 🇪🇪 E⁠e⁠s⁠t⁠i | eu E⁠u⁠s⁠k⁠a⁠r⁠a | 🇮🇷 ف⁠ا⁠ر⁠س⁠ی | 🇫🇮 S⁠u⁠o⁠m⁠i | fy F⁠r⁠y⁠s⁠k | 🇫🇷 F⁠r⁠a⁠n⁠ç⁠a⁠i⁠s | 🇮🇪 G⁠a⁠e⁠i⁠l⁠g⁠e | gl G⁠a⁠l⁠e⁠g⁠o | 🇨🇭 S⁠c⁠h⁠w⁠i⁠i⁠z⁠e⁠r⁠d⁠ü⁠t⁠s⁠c⁠h | 🇮🇱 ע⁠ב⁠ר⁠י⁠ת | 🇮🇳 हि⁠न्दी | 🇭🇷 H⁠r⁠v⁠a⁠t⁠s⁠k⁠i | 🇭🇺 M⁠a⁠g⁠y⁠a⁠r | 🇦🇲 Հ⁠ա⁠յ⁠ե⁠ր⁠ե⁠ն | 🇮🇩 I⁠n⁠d⁠o⁠n⁠e⁠s⁠i⁠a | 🇮🇸 Í⁠s⁠l⁠e⁠n⁠s⁠k⁠a | 🇮🇹 I⁠t⁠a⁠l⁠i⁠a⁠n⁠o | 🇯🇵 日⁠本⁠語 | 🇬🇪 K⁠a⁠r⁠t⁠u⁠l⁠i | 🇰🇷 한⁠국⁠어 | 🇱🇺 L⁠ë⁠t⁠z⁠e⁠b⁠u⁠e⁠r⁠g⁠e⁠s⁠c⁠h | 🇱🇹 L⁠i⁠e⁠t⁠u⁠v⁠i⁠ų | 🇱🇻 L⁠a⁠t⁠v⁠i⁠e⁠š⁠u | 🇲🇰 М⁠а⁠к⁠е⁠д⁠о⁠н⁠с⁠к⁠и | 🇮🇳 മ⁠ല⁠യാ⁠ളം | 🇳🇴 N⁠o⁠r⁠s⁠k⁠ ⁠B⁠o⁠k⁠m⁠å⁠l | 🇳🇱 N⁠e⁠d⁠e⁠r⁠l⁠a⁠n⁠d⁠s | 🇳🇴 N⁠o⁠r⁠s⁠k⁠ ⁠N⁠y⁠n⁠o⁠r⁠s⁠k | 🇵🇱 P⁠o⁠l⁠s⁠k⁠i | 🇵🇹 P⁠o⁠r⁠t⁠u⁠g⁠u⁠ê⁠s | 🇧🇷 P⁠o⁠r⁠t⁠u⁠g⁠u⁠ê⁠s⁠ ⁠(⁠B⁠R⁠) | 🇷🇴 R⁠o⁠m⁠â⁠n⁠ă | 🇸🇰 S⁠l⁠o⁠v⁠e⁠n⁠č⁠i⁠n⁠a | 🇸🇮 S⁠l⁠o⁠v⁠e⁠n⁠š⁠č⁠i⁠n⁠a | 🇦🇱 S⁠h⁠q⁠i⁠p | 🇷🇸 С⁠р⁠п⁠с⁠к⁠и | 🇷🇸 S⁠r⁠p⁠s⁠k⁠i | 🇸🇪 S⁠v⁠e⁠n⁠s⁠k⁠a | 🇮🇳 த⁠மி⁠ழ் | 🇮🇳 తె⁠లు⁠గు | 🇹🇭 ภ⁠า⁠ษ⁠า⁠ไ⁠ท⁠ย | 🇹🇷 T⁠ü⁠r⁠k⁠ç⁠e | 🇵🇰 اُ⁠ر⁠دُ⁠و | 🇻🇳 T⁠i⁠ế⁠n⁠g⁠ ⁠V⁠i⁠ệ⁠t | 🇨🇳 简⁠体⁠中⁠文 | 🇹🇼 繁⁠體⁠中⁠文

Home Assistant HACS Latest release Downloads License

Home Assistant lets you use any MDI icon, but not every icon has an -off variant. As a result, a device may already be off while its icon still looks active. This plugin automatically adds an MDI-style slash to inactive entities when no native off icon is available.

🚫 MDI Off Fallback for Home Assistant

Plugin function visualized

The plugin is designed so that the added slash looks like a native part of Home Assistant:

  • works with standard Tile cards without replacing them, preserving their native appearance, behavior, colors, sizes, and interactions;
  • also supports 🍄 Mushroom Template Card; the card must have an entity configured so the plugin can determine its state;
  • modifies only icons that have already been rendered and only when no native -off variant is available;
  • can optionally add a faint circular background when the native background is missing;
  • does not change entity states or interfere with device operation.

📦 Installation

🛍 Installation via HACS

ℹ️ What is HACS and how do I install it?

🚀 Try adding the repository using this link. If this mode is supported in your HA and it works, click Add in the window that opens, then click Download in the bottom-right corner. If everything works, installation is complete and you can skip the remaining installation steps. Go directly to Configuration.

1. Add this repository to HACS

It may take months for the plugin to be added to the default HACS catalog (we are waiting), so first add this repository to HACS manually:

  1. Open HACS.
  2. Open the menu in the upper-right corner and select Custom repositories.
  3. Add this repository:
https://github.com/LanKing/ha-mdi-off-fallback
  1. Select Dashboard as the type and click Add.

Adding a repository under Custom repositories only makes the plugin available in HACS. The plugin itself is installed separately with the Download button.

2. Install the plugin

  1. Search HACS for: MDI Off Fallback and open it.
  2. Click Download and confirm the installation.
  3. When the download is complete, reload Home Assistant while clearing the browser cache.

🧑‍💻 Manual installation (without HACS)

  1. Download ha-mdi-off-fallback.js.
  2. Copy the file to /config/www/ha-mdi-off-fallback.js.
  3. Open Resources or navigate there manually in Home Assistant: Settings → Dashboards → ⋮ → Resources.
  4. Click Add resource.
  5. Enter /local/ha-mdi-off-fallback.js in the URL field.
  6. Select JavaScript Module and click Create.
  7. Reload Home Assistant while clearing the browser cache.

🔧 Configuration

Custom configuration is optional. Without a custom file, the plugin uses its built-in values:

Default configuration

By default, the following states are treated as inactive:

Entity domain Inactive states
light off
switch off
fan off
climate off
media_player off
cover closed
humidifier off
water_heater off
siren off

The following settings are also used:

{
  "faint_background_when_missing": false,
  "faint_background_opacity": 0.2,
  "debug": false
}

Custom configuration

To define your own rules, create this file:

/config/www/ha-mdi-off-fallback.config.json

Example:

{
  "states": {
    "light": ["off"],
    "switch": ["off"],
    "fan": ["off"],
    "climate": ["off"],
    "media_player": ["off"],
    "cover": ["closed"],
    "humidifier": ["off"],
    "water_heater": ["off"],
    "siren": ["off"],
    "remote": ["off"]
  },
  "faint_background_when_missing": false,
  "faint_background_opacity": 0.2,
  "debug": false
}

The configuration is stored separately from the plugin files managed by HACS, so plugin updates will not overwrite it.

How the states section works

When the custom configuration contains a states object, it completely replaces the built-in list. The plugin will only consider the explicitly listed domains and states.

{
  "states": {
    "light": ["off"],
    "cover": ["closed"]
  }
}

In this example, the slash will only be applied to light and cover. The built-in rules for switch, fan, climate, and all other domains will not be used.

To return to the built-in list, remove states from the configuration or delete the configuration file.

The other settings are independent: when a setting is omitted, its built-in value remains in effect.

Optional background for icons without a circle

Some MDI icons are visually off-center. After a slash is added, they can look unbalanced when there is no circular background to frame them.

This bothered my sense of visual order, so the plugin includes an optional setting that draws a faint circle behind inactive icons when Home Assistant does not provide one.

This option is disabled by default because the circle has a meaning in the Home Assistant interface: on a Tile card, it normally indicates that clicking the icon performs a separate action from clicking the rest of the card. Adding a circle purely for visual alignment therefore changes that visual semantics.

You can still enable the background if you prefer the more balanced appearance:

{
  "faint_background_when_missing": true
}

When enabled, the plugin only adds the background where Home Assistant does not already render one.

You can also adjust its opacity:

{
  "faint_background_opacity": 0.2
}

Choose whichever behavior matters more for your dashboard: preserving Home Assistant's native interaction cues or keeping slashed icons visually centered.

Temporary configuration from the console

haMdiOffFallback.configure() follows the same rules.

A supplied states object completely replaces the current list:

haMdiOffFallback.configure({
  states: {
    light: ["off"],
    cover: ["closed"],
    remote: ["off"]
  },
  debug: true
})

When states is omitted, the current list remains unchanged:

haMdiOffFallback.configure({
  debug: true
})

Settings applied through configure() remain active only in the current tab until the page is reloaded. Use the JSON file for persistent configuration.

Reloading the configuration

After editing the JSON file, reload the configuration without reloading the page:

haMdiOffFallback.reloadConfig()

View the active configuration:

haMdiOffFallback.getConfig()

📄 License

MIT — contributions are welcome.

🏠 More cool stuff

Explore my other Home Assistant tools

About

🚫 Adds an MDI-style slash to inactive HA entity icons that don’t have a built-in -off variant.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages