Animated Lovelace badge to draw attention to critical alerts (smoke, water leaks, storms, alarms).
kb-alert-loop-01.mp4
KB Alert Badge is a custom Home Assistant Dashboard badge that animates to highlight critical or time-sensitive conditions.
- Type:
custom:kb-alert-badge - Works with any entity
- Activation: when state indicates an alert (e.g. "on", "alarm", or a problem state)
- Minimum Home Assistant version: 2024.12
- Visual editor for all main options
- Multiple animations: flashing, police, water, storm, shake, washing-machine
- Color and icon customization
- Animation speed control
KB Alert Badge can be installed via HACS.
- Install HACS if you don't have it already.
- Open HACS in Home Assistant → Frontend.
- Search for "KB Alert Badge" (or add as a custom repository if not listed yet).
- Download/Install.
- Add a Dashboard resource:
- URL:
/hacsfiles/kb-alert-badge/kb-alert-badge.js - Type:
module
- URL:
- Download
kb-alert-badge.jsfrom the latest release. - Copy it to your
config/wwwdirectory. - Add a Dashboard resource:
- URL:
/local/kb-alert-badge.js - Type:
module
- URL:
type: custom:kb-alert-badge
entity: binary_sensor.smoke_alarm
animation: police # flashing | police | water | storm | shake | washing-machine
color: red
icon: mdi:smoke-detector
speed: 900entity: Entity to monitoranimation: One offlashing,police,water,storm,shake,washing-machinecolor: Any valid CSS coloricon: MDI icon (e.g.mdi:smoke-detector) or templatespeed: Animation speed in milliseconds
- General: When active, the badge icon color is driven by
--kb-alert-color(yourcolor).speedmaps to--kb-alert-speed. - flashing: Uses
colorfor the pulse background and outer glow; text becomes white for contrast. - police: Right side uses your
color; left side auto-uses its complementary hue. Ifcoloris not set, defaults are blue/right and red/left. - water: Both wave layers use your
color(the back wave is a darker mix), rendered under the content. - storm: Uses your
coloras the base lightning/rain highlight color; lighter/darker flashes are derived automatically. - shake: Only motion is applied;
colorjust colors the icon. - washing-machine: Spinner artwork does not use
color; onlyspeedinfluences door/rotation.
If your setup allows styling custom elements (e.g., via card-mod), you can override the CSS variables used by the badge:
--kb-alert-color: base alert color--kb-alert-speed: animation speed--kb-police-right/--kb-police-left: police side colors (override the auto-computed/complementary pair)--kb-storm-color: base storm flash/rain highlight color
Example (with card-mod):
type: custom:kb-alert-badge
entity: binary_sensor.alarm
animation: police
card_mod:
style: |
kb-alert-badge {
--kb-alert-color: #00aaff;
--kb-police-right: #00aaff; # force right
--kb-police-left: #ff0033; # force left
--kb-alert-speed: 800ms;
}A visual editor is provided with controls for entity, animation, color, icon, and speed.
- Ensure Home Assistant is up to date (some features may require newer versions).
- Confirm the resource is loaded (check browser devtools console for errors).
- If you used HACS, verify you have the latest version installed.
- Clear your cache and force reload:
- Remove the resource (https://my.home-assistant.io/redirect/lovelace_resources/)
- Uninstall from HACS
- Reinstall from HACS
- Heavily inspired by the structure and UX of Mushroom.
- Washing machine animation based on CodePen by qxuken.
- Storm animation based on CodePen by mephysto.
- Police animation based on CodePen by drew_mc.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind are welcome!
Contributions are welcome! Please open an issue or pull request. This project uses Conventional Commits and semantic-release.
MIT © kibibit
If you like this project, consider starring the repo and checking out other work from the kibibit organization.