Badges
Badges are widgets that sit at the top of a panel, above all the cards.
Badges at the top of a panel.
Adding a badge to your dashboard
-
Go to Settings > Dashboards.
-
If you have multiple views, open the view to which you want to add a badge.
-
In the top right of the screen, select the edit
button. -
To add a badge, select the plus
button. -
Select the entity for which you want to display a badge.
-
Configure your badge.
- The available options depend on the entity.
- Add the states you want to see.
- If you want, add a Name.
-
Under Interactions, you can define the tap behavior.
-
If you want this badge to be visible only to specific users or under a certain condition, open the Visibility tab to define those conditions.
-
Select Save.
Adding a badge to a dashboard.
Entity badge
The Entity badge allows you to display the state of an entity on a badge. This badge supports actions.
type: entity
entity: light.living_room
Configuration Variables
Set the color when the entity is active. By default, the color is based on state
, domain
, and device_class
of your entity. It accepts color token or hex color code.
If your entity has a picture, it will replace the icon.
Content to display for the state. Can be state
, last_changed
, last_updated
, or any attribute of the entity. Can be either a string with a single item, or a list of string items. Default depends on the entity domain.
Action taken on card tap. See action documentation. By default, it will show the “more-info” dialog.
Action taken on tap-and-hold. See action documentation.
Action taken on double tap. See action documentation.
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
List of conditions to check. See available conditions.*
(legacy) List of strings representing states or filters to check. See available legacy filters.*
*one is required (conditions
or state_filter
)
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
Overwrites icon or entity picture. You can use any icon from Material Design Iconsmdi:
, ie mdi:home
.
List of conditions to check. See available conditions.*
(legacy) List of strings representing states or filters to check. See available legacy filters.*
*only one filter will be applied: conditions
or state_filter
if conditions
is not present
You may also add any additional configuration options to an entity which are supported by the chosen badge type (Entity
badge type if no type is chosen).
Conditions options
You can specify multiple conditions
, in which case the entity will be displayed if it matches all conditions.
State
Tests if an entity has a specified state.
type: entity-filter
entities:
- climate.thermostat_living_room
- climate.thermostat_bed_room
conditions:
- condition: state
state: heat
type: entity-filter
entities:
- climate.thermostat_living_room
- climate.thermostat_bed_room
conditions:
- condition: state
state_not: "off"
type: entity-filter
entities:
- sensor.gas_station_1
- sensor.gas_station_2
- sensor.gas_station_3
conditions:
- condition: state
state: sensor.gas_station_lowest_price
*one is required (state
or state_not
)
Numeric state
Tests if an entity state matches the thresholds.
type: entity-filter
entities:
- sensor.outside_temperature
- sensor.living_room_temperature
- sensor.bed_room_temperature
conditions:
- condition: numeric_state
above: 10
below: 20
*at least one is required (above
or below
), both are also possible for values between.
Screen
Specify the visibility of the entity per screen size. Some screen size presets are available in the UI but you can use any CSS media query you want in YAML.
type: entity-filter
entities:
- sensor.outside_temperature
- sensor.living_room_temperature
- sensor.bed_room_temperature
conditions:
- condition: screen
media_query: "(min-width: 1280px)"
User
Specify the visibility of the entity per user.
type: entity-filter
entities:
- sensor.outside_temperature
- sensor.living_room_temperature
- sensor.bed_room_temperature
conditions:
- condition: user
users:
- 581fca7fdc014b8b894519cc531f9a04
And
Specify that both conditions must be met.
type: entity-filter
entities:
- sensor.outside_temperature
- sensor.living_room_temperature
- sensor.bed_room_temperature
conditions:
- condition: and
conditions:
- condition: numeric_state
above: 0
- condition: user
users:
- 581fca7fdc014b8b894519cc531f9a04
Configuration Variables
List of conditions to check. See available conditions.
Or
Specify that at least one of the conditions must be met.
type: entity-filter
entities:
- sensor.outside_temperature
- sensor.living_room_temperature
- sensor.bed_room_temperature
conditions:
- condition: or
conditions:
- condition: numeric_state
above: 0
- condition: user
users:
- 581fca7fdc014b8b894519cc531f9a04
Configuration Variables
List of conditions to check. See available conditions.
Legacy state filters
String filter
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"
You can also specify multiple state_filter
conditions, in which case the entity will be displayed if it matches any condition.
If you define state_filter
as objects instead of strings, you can add more customization to your filter, as described below.
Operator filter
Tests if an entity state correspond to the applied operator
.
Examples
Displays everyone who is at home or at work.
type: entity-filter
entities:
- device_tracker.demo_paulus
- device_tracker.demo_anne_therese
- device_tracker.demo_home_boy
state_filter:
- operator: "=="
value: home
- operator: "=="
value: work
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
Use a regex filter against entity attributes. This regex filter below looks for expressions that are 1 digit in length and where the number is between 0-7 (so show holidays today or in the next 7 days) and displays those holidays as entities in the Entity Filter badge.
type: entity-filter
state_filter:
- operator: regex
value: "^([0-7]{1})$"
attribute: eta
entities:
- entity: sensor.upcoming_ical_holidays_0
- entity: sensor.upcoming_ical_holidays_1
- entity: sensor.upcoming_ical_holidays_2
- entity: sensor.upcoming_ical_holidays_3
- entity: sensor.upcoming_ical_holidays_4
show_empty: false