Lovelace Badges


Badges are widgets that sit at the top of a Lovelace panel, above all the cards.

State Label Badge

The State Label badge allows you to display a state badge. This badge supports actions.

type: state-label
entity: light.living_room

Configuration Variables

type string Required

entity-button

entity string Required

Home Assistant entity ID.

name string (Optional, default: Name of Entity)

Overwrites friendly name.

icon string (Optional, default: Entity Domain Icon)

Overwrites icon or entity picture.

image string (Optional)

The URL of an image.

show_name boolean (Optional, default: true)

Show name.

show_icon boolean (Optional, default: true)

Show icon.

Entity Filter Badge

This badge allows you to define a list of entities that you want to track only when in a certain state. Very useful for showing lights that you forgot to turn off or show a list of people only when they’re at home.

Configuration Variables

type string Required

entity-filter

entities list Required

A list of entity IDs or entity objects, see below.

state_filter list Required

List of strings representing states or filter objects, see below.

Options For Entities

If you define entities as objects instead of strings (by adding entity: before entity ID), you can add more customization and configurations:

Configuration Variables

type string (Optional)

Sets a custom badge type: custom:my-custom-badge

entity string Required

Home Assistant entity ID.

name string (Optional)

Overwrites friendly name.

icon string (Optional)

Overwrites icon or entity picture.

image string (Optional)

The URL of an image.

state_filter list (Optional)

List of strings representing states or filter objects, see below.

Options For state_filter

If you define state_filter as objects instead of strings (by adding value: before your state value), you can add more customization to your filter:

Configuration Variables

value string Required

String representing the state.

operator string (Optional)

Operator to use in the comparison. Can be ==, <=, <, >=, >, != or regex.

attribute string (Optional)

Attribute of the entity to use instead of the state.

Examples

Show only active switches or lights in the house

type: entity-filter
entities:
  - entity: light.bed_light
    name: Bed
  - light.kitchen_lights
  - light.ceiling_lights
state_filter:
  - "on"

Specify filter for a single entity

type: entity-filter
state_filter:
  - "on"
  - operator: ">"
    value: 90
entities:
  - sensor.water_leak
  - sensor.outside_temp
  - entity: sensor.humidity_and_temp
    state_filter:
      - operator: ">"
        value: 50
        attribute: humidity