### Basic example
Source: https://www.home-assistant.io/dashboards/light
A basic example of the light card configuration.
```yaml
type: light
entity: light.bedroom
```
--------------------------------
### View configuration example
Source: https://www.home-assistant.io/dashboards/views
Example of a view configuration with a title and path.
```yaml
- title: Living room
# the final path is /lovelace/living_room
path: living_room
```
--------------------------------
### Basic example
Source: https://www.home-assistant.io/dashboards/clock
A basic clock card example.
```yaml
type: clock
```
--------------------------------
### Simple subview example
Source: https://www.home-assistant.io/dashboards/views
Example of a simple subview configuration in YAML.
```yaml
- title: Map
subview: true
```
--------------------------------
### Basic example
Source: https://www.home-assistant.io/dashboards/media-control
A basic example of the media control card configuration in YAML.
```yaml
type: media-control
entity: media_player.lounge_room
```
--------------------------------
### Subview Configuration Example
Source: https://www.home-assistant.io/dashboards/views
Example of a subview configuration with path, back_path, and cards.
```yaml
- title: "Energieprijzen"
path: "energieprijzen"
subview: true
back_path: "/ui-data/climate"
cards:
- type: entities
entities:
- sensor.today_avg_price
```
--------------------------------
### View icon example
Source: https://www.home-assistant.io/dashboards/views
Example of a view configuration with a title and an icon.
```yaml
- title: Garden
icon: mdi:flower
```
--------------------------------
### Theme Example
Source: https://www.home-assistant.io/dashboards/views
Example of setting a separate theme for a view and its cards.
```yaml
- title: Home
theme: happy
```
--------------------------------
### View Configuration Example
Source: https://www.home-assistant.io/dashboards/views
Example of a view configuration including title, badges, and entities.
```yaml
- title: Living room
badges:
- device_tracker.demo_paulus
- entity: light.ceiling_lights
name: Ceiling Lights
icon: mdi:bulb
- entity: switch.decorative_lights
image: /local/lights.png
```
--------------------------------
### Thermostat card configuration example
Source: https://www.home-assistant.io/dashboards/thermostat
Example of how to configure a thermostat card using YAML.
```yaml
type: thermostat
entity: climate.nest
```
--------------------------------
### Basic Example
Source: https://www.home-assistant.io/dashboards/area
A basic example of the area card configuration.
```yaml
type: area
area: bedroom
```
--------------------------------
### Basic example
Source: https://www.home-assistant.io/dashboards/distribution
A basic example of the distribution card configuration with a list of entities.
```yaml
type: distribution
entities:
- sensor.grid_power
- sensor.solar_power
- sensor.home_battery_power
```
--------------------------------
### Statistic card example
Source: https://www.home-assistant.io/dashboards/statistic
An example of how to configure the statistic card using YAML.
```yaml
type: statistic
entity: sensor.energy_consumption
period:
calendar:
period: month
stat_type: change
```
--------------------------------
### View visibility example
Source: https://www.home-assistant.io/dashboards/views
Example of view configurations with user-specific visibility settings.
```yaml
views:
- title: Ian
visible:
- user: 581fca7fdc014b8b894519cc531f9a04
cards:
...
- title: Chelsea
visible:
- user: 6e690cc4e40242d2ab14cf38f1882ee6
cards:
...
- title: Admin
visible: db34e025e5c84b70968f6530823b117f
cards:
...
```
--------------------------------
### Heading card example
Source: https://www.home-assistant.io/dashboards/heading
Example of a basic Heading card configuration.
```yaml
type: heading
heading: Kitchen
icon: mdi:fridge
badges:
- type: entity
entity: sensor.kitchen_temperature
- type: entity
entity: sensor.kitchen_humidity
```
--------------------------------
### Confirmation and Perform Action Example
Source: https://www.home-assistant.io/dashboards/actions
Example demonstrating the use of 'perform-action' with confirmation and specific action details.
```yaml
double_tap_action:
action: perform-action
confirmation:
text: Are you sure you want to restart?
perform_action: script.restart
hold_action:
action: perform-action
confirmation: true
perform_action: script.do_other_thing
```
--------------------------------
### Markdown card configuration example
Source: https://www.home-assistant.io/dashboards/markdown
Example of how to configure a Markdown card in YAML mode.
```yaml
type: markdown
content: >
## Dashboards
Starting with Home Assistant 0.72, we're experimenting with a new way of defining your interface.
```
--------------------------------
### Title example
Source: https://www.home-assistant.io/dashboards/todo-list
Example of a to-do list card with a custom title.
```yaml
type: todo-list
entity: todo.todo_list
title: Todo List
```
--------------------------------
### Example View with Multiple Energy Collections
Source: https://www.home-assistant.io/dashboards/energy
This example demonstrates how to configure a dashboard with multiple energy collections. Use `collection_key` to link specific energy cards to different date selection controls. Cards without a `collection_key` default to the first `energy-date-selection` card.
```yaml
type: masonry
path: example
cards:
- type: energy-date-selection
- type: energy-date-selection
collection_key: energy_2
# This card is linked to the first (default) date selection
- type: energy-usage-graph
# This card is linked to the second date selection
- type: energy-usage-graph
collection_key: energy_2
```
--------------------------------
### YAML configuration example
Source: https://www.home-assistant.io/dashboards/humidifier
Example of how to configure the humidifier card using YAML.
```yaml
type: humidifier
entity: humidifier.bedroom
name: Bedroom Humidifier
```
--------------------------------
### Entity Card YAML Configuration Examples
Source: https://www.home-assistant.io/dashboards/entity
Examples demonstrating how to configure the entity card using YAML, including basic entity display, showing attributes with units, and customizing names and icons.
```yaml
- type: entity
entity: cover.kitchen_window
- type: entity
entity: light.bedroom
attribute: brightness
unit: "%"
- type: entity
entity: vacuum.downstairs
name: Vacuum
icon: "mdi:battery"
attribute: battery_level
unit: "%"
```
--------------------------------
### Activity Card Configuration Example
Source: https://www.home-assistant.io/dashboards/logbook
This is a basic example of configuring the Activity card to display logs for specific entities. It sets the card type, targets entities, and specifies the hours to show.
```yaml
type: logbook
target:
entity_id:
- fan.ceiling_fan
- fan.living_room_fan
- light.ceiling_lights
hours_to_show: 24
```
--------------------------------
### Basic Glance Card Configuration
Source: https://www.home-assistant.io/dashboards/glance
A simple example demonstrating how to configure a Glance card with a title and a list of entities.
```yaml
type: glance
title: Glance card sample
entities:
- binary_sensor.movement_backyard
- light.bed_light
- binary_sensor.basement_floor_wet
- sensor.outside_temperature
- light.ceiling_lights
- switch.ac
- lock.kitchen_door
```
--------------------------------
### View icon and title example
Source: https://www.home-assistant.io/dashboards/views
Example of a view configuration with a title, an icon, and the 'show_icon_and_title' option enabled.
```yaml
- title: Garden
icon: mdi:flower
show_icon_and_title: true
```
--------------------------------
### Example YAML for Dashboard Sections with Theming
Source: https://www.home-assistant.io/dashboards/sections
Demonstrates how to configure dashboard sections with specific themes for alerts and general information, while also showing theme inheritance.
```yaml
views:
- title: Home Status
theme: main_view
type: sections
sections:
# System alerts section with orange theme
- type: grid
title: System Alerts
theme: alert_section
cards:
- type: tile
entity: update.home_assistant_core_update
- type: tile
entity: sensor.processor_use
- type: tile
entity: sensor.memory_use_percent
# General info section inherits blue theme
- type: grid
title: Status & Info
cards:
- type: tile
entity: sun.sun
- type: tile
entity: weather.home
```
--------------------------------
### Overwriting names example
Source: https://www.home-assistant.io/dashboards/light
An example of overwriting the default name for the light card.
```yaml
type: light
entity: light.bedroom
name: Kids Bedroom
```
```yaml
type: light
entity: light.office
name: My Office
```
--------------------------------
### Shopping list card YAML configuration example
Source: https://www.home-assistant.io/dashboards/shopping-list
Example of how to configure the shopping list card using YAML, including a title.
```yaml
type: shopping-list
title: shopping list
```
--------------------------------
### Markdown card with template variables example
Source: https://www.home-assistant.io/dashboards/markdown
Example demonstrating the use of template variables 'config' and 'user' within the Markdown card's content.
```yaml
type: entity-filter
entities:
- light.bed_light
- light.ceiling_lights
- light.kitchen_lights
state_filter:
- 'on'
card:
type: markdown
content: |
The lights that are on are:
{% for l in config.entities %}
- {{ l.entity }}
{%- endfor %}
And the door is {% if is_state('binary_sensor.door', 'on') %} open {% else %} closed {% endif %}.
```
```yaml
type: markdown
content: |
Hello, {{user}}
```
--------------------------------
### Confirmation with Exemptions Example
Source: https://www.home-assistant.io/dashboards/actions
Example showing how to configure confirmation dialogs with user exemptions.
```yaml
double_tap_action:
action: perform-action
confirmation:
text: Are you sure you want to restart?
exemptions:
- user: x9405b8c64ee49bb88c42000e0a9dfa8
- user: 88bcfbdc39155d16c3b2d09cbf8b0367
perform_action: script.restart
```
--------------------------------
### Background theme variable example
Source: https://www.home-assistant.io/dashboards/views
Example configuration.yaml entry for styling the background of all views using a theme and the CSS variable 'lovelace-background'.
```yaml
# Example configuration.yaml entry
frontend:
themes:
example:
lovelace-background: center / cover no-repeat url("/local/background.png") fixed
```
--------------------------------
### Rolling window example
Source: https://www.home-assistant.io/dashboards/statistic
Example of configuring the statistic card with a rolling window period.
```yaml
type: statistic
entity: sensor.energy_consumption
period:
rolling_window:
duration:
hours: 1
minutes: 10
seconds: 5
offset:
hours: -2
minutes: -20
seconds: -10
stat_type: change
```
--------------------------------
### Sidebar View Configuration Example
Source: https://www.home-assistant.io/dashboards/sidebar
Example of how to configure a sidebar view with an entities card positioned in the sidebar.
```yaml
type: sidebar
cards:
- type: entities
entities:
- media_player.lounge_room
view_layout:
position: sidebar
```
--------------------------------
### Picture card configuration example with navigation
Source: https://www.home-assistant.io/dashboards/views
Example of a picture card configuration that uses navigation_path to link to another view.
```yaml
- type: picture
image: /local/living_room.png
tap_action:
action: navigate
navigation_path: /lovelace/living_room
```
--------------------------------
### Button badge example
Source: https://www.home-assistant.io/dashboards/heading
Example of a Button badge configuration within a Heading card.
```yaml
type: button
icon: mdi:lightbulb-off
text: Turn off lights
color: yellow
```
--------------------------------
### Basic sensor card
Source: https://www.home-assistant.io/dashboards/sensor
A basic example of a sensor card configuration.
```yaml
type: sensor
entity: sensor.illumination
name: Illumination
```
--------------------------------
### Subview with custom back path example
Source: https://www.home-assistant.io/dashboards/views
Example of a subview configuration in YAML with a custom back path defined.
```yaml
- title: Map
subview: true
back_path: /lovelace/home
```
--------------------------------
### Basic Button Card
Source: https://www.home-assistant.io/dashboards/button
A basic example of a button card.
```yaml
type: button
entity: light.living_room
```
--------------------------------
### Calendar card configuration
Source: https://www.home-assistant.io/dashboards/calendar
Example of how to configure the calendar card with entities.
```yaml
type: calendar
entities:
- calendar.calendar_1
- calendar.calendar_2
```
--------------------------------
### Glance Card with Custom Entity Names and Actions
Source: https://www.home-assistant.io/dashboards/glance
This example shows how to define entities as objects to provide custom names and configure tap actions for specific entities.
```yaml
type: glance
title: Better names
entities:
- entity: binary_sensor.movement_backyard
name: Movement?
- light.bed_light
- binary_sensor.basement_floor_wet
- sensor.outside_temperature
- light.ceiling_lights
- switch.ac
- lock.kitchen_door
- entity: switch.wall_plug_switch
tap_action:
action: toggle
```
--------------------------------
### Dynamic date selection example
Source: https://www.home-assistant.io/dashboards/statistic
Example of linking the statistic card to a dynamic date selection period.
```yaml
type: statistic
entity: sensor.energy_consumption
period: energy_date_selection
stat_type: change
```
--------------------------------
### Entity badge example
Source: https://www.home-assistant.io/dashboards/heading
Example of an Entity badge configuration within a Heading card.
```yaml
type: entity
entity: light.living_room
```
--------------------------------
### Basic Statistics Graph Card Configuration
Source: https://www.home-assistant.io/dashboards/statistics-graph
A simple example showing how to add the statistics graph card to a dashboard with a title and a list of entities.
```yaml
type: statistics-graph
title: 'My Graph'
entities:
- sensor.outside_temperature
- entity: sensor.inside_temperature
name: Inside
```
--------------------------------
### Markdown card with icons example
Source: https://www.home-assistant.io/dashboards/markdown
Example showing how to include Material Design Icons within the Markdown card's content.
```yaml
type: markdown
content: |
```
--------------------------------
### Tap and Hold Action Example
Source: https://www.home-assistant.io/dashboards/actions
Example of implementing tap and hold actions on an entity button card.
```yaml
type: button
tap_action:
action: toggle
hold_action:
action: more-info
```
--------------------------------
### Calendar configuration for due date period
Source: https://www.home-assistant.io/dashboards/todo-list
Example showing how to display all tasks due in the next 7 days.
```yaml
type: todo-list
entity: todo.todo_list
due_date_period:
calendar:
period: day
offset: 6
```
--------------------------------
### View-specific background settings example
Source: https://www.home-assistant.io/dashboards/views
Example background section in view YAML, demonstrating various customization options like image, opacity, size, alignment, repeat, and attachment.
```yaml
# Example background section in view yaml
background:
image: /local/background.png
opacity: 50 # any percentage between 0 and 100
size: auto # auto, cover, contain
alignment: center # top left, top center, top right, center left, center, center right, bottom left, bottom center, bottom right
repeat: no-repeat # repeat, no-repeat
attachment: scroll # scroll, fixed
```
--------------------------------
### Calendar configuration for due date period
Source: https://www.home-assistant.io/dashboards/todo-list
Example showing how to display all tasks due before the end of next week.
```yaml
type: todo-list
entity: todo.todo_list
due_date_period:
calendar:
period: week
offset: 1
```
--------------------------------
### Horizontal stack card example
Source: https://www.home-assistant.io/dashboards/horizontal-stack
Example of how to configure the horizontal stack card with a title and two picture-entity cards.
```yaml
type: horizontal-stack
title: Lights
cards:
- type: picture-entity
image: /local/bed_1.png
entity: light.ceiling_lights
- type: picture-entity
image: /local/bed_2.png
entity: light.bed_light
```
--------------------------------
### Calendar configuration for due date period
Source: https://www.home-assistant.io/dashboards/todo-list
Example showing how to display all tasks due before the end of the current month.
```yaml
type: todo-list
entity: todo.todo_list
due_date_period:
calendar:
period: month
```
--------------------------------
### Picture Elements Card with Various Elements
Source: https://www.home-assistant.io/dashboards/picture-elements
An example demonstrating the use of state-icon, state-label, and action-button elements within a Picture Elements card.
```yaml
type: picture-elements
image: /local/floorplan.png
elements:
- type: state-icon
tap_action:
action: toggle
entity: light.ceiling_lights
style:
top: 47%
left: 42%
- type: state-icon
tap_action:
action: toggle
entity: light.kitchen_lights
style:
top: 30%
left: 15%
- type: state-label
entity: sensor.outside_temperature
style:
top: 82%
left: 79%
- type: state-label
entity: climate.kitchen
attribute: current_temperature
suffix: "°C"
style:
top: 33%
left: 15%
- type: action-button
title: Turn lights off
style:
top: 95%
left: 60%
action: homeassistant.turn_off
target:
entity_id: light.home_lights
- type: icon
icon: mdi:home
tap_action:
action: navigate
navigation_path: /lovelace/0
style:
top: 10%
left: 10%
```
--------------------------------
### Combine Conditions with AND
Source: https://www.home-assistant.io/dashboards/badges
This example demonstrates using the 'and' condition to ensure that multiple sub-conditions (numeric state and user) must all be met for the entity to be displayed.
```yaml
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
```
--------------------------------
### Go to another view
Source: https://www.home-assistant.io/dashboards/picture
This example shows how to configure a picture card to navigate to another view when tapped.
```yaml
type: picture
image: /local/home.jpg
tap_action:
action: navigate
navigation_path: /lovelace/home
```
--------------------------------
### Show an image from a media directory
Source: https://www.home-assistant.io/dashboards/picture
This example shows how to display an image stored in a media directory using a picture card.
```yaml
type: picture
image: media-source://media_source/local/test.jpg
```
--------------------------------
### Presentation Table Example
Source: https://www.home-assistant.io/dashboards/markdown
An example of an HTML table with role="presentation" used for layout purposes, displaying status information.
```html
|
System Status Alert |
| Priority: High - Requires attention |
| Active since: 2024-01-22 14:30 |
```
--------------------------------
### Basic Grid Card Configuration
Source: https://www.home-assistant.io/dashboards/grid
A simple example of a grid card displaying a picture-entity and an entities card. This configuration is suitable for basic layouts.
```yaml
type: grid
cards:
- type: picture-entity
entity: camera.demo_camera
show_info: false
- type: entities
entities:
- binary_sensor.movement_backyard
```
--------------------------------
### With custom names and colors
Source: https://www.home-assistant.io/dashboards/distribution
An example of the distribution card configuration with custom names and colors for entities.
```yaml
type: distribution
title: Power distribution
entities:
- entity: sensor.grid_power
name: Grid
color: blue
- entity: sensor.solar_power
name: Solar
color: "#ff9800"
- entity: sensor.home_battery_power
name: Battery
color: "#4caf50"
```
--------------------------------
### Basic History Graph Card Configuration
Source: https://www.home-assistant.io/dashboards/history-graph
A basic example of a history graph card showing one entity and a custom named entity.
```yaml
type: history-graph
title: 'My Graph'
entities:
- sensor.outside_temperature
- entity: media_player.lounge_room
name: Main player
```
--------------------------------
### Basic Plant Status Card Configuration
Source: https://www.home-assistant.io/dashboards/plant-status
A basic example of how to configure the plant-status card in YAML mode.
```yaml
type: plant-status
entity: plant.bonsai
```
--------------------------------
### Combine Conditions with OR
Source: https://www.home-assistant.io/dashboards/badges
This example uses the 'or' condition, meaning the entity will be displayed if at least one of the specified sub-conditions (numeric state or user) is met.
```yaml
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
```
--------------------------------
### Activity Card Configuration with Multiple Targets
Source: https://www.home-assistant.io/dashboards/logbook
This example demonstrates configuring the Activity card with multiple target types, including areas, devices, entities, and labels. This allows for a comprehensive view of activity across different scopes.
```yaml
type: logbook
target:
area_id: living_room
device_id:
- ff22a1889a6149c5ab6327a8236ae704
- 52c050ca1a744e238ad94d170651f96b
entity_id:
- light.hallway
- light.landing
label_id:
- lights
```
--------------------------------
### Basic Alarm Panel Card Configuration
Source: https://www.home-assistant.io/dashboards/alarm-panel
A simple example of how to configure the alarm panel card with a name and entity.
```yaml
type: alarm-panel
name: House Alarm
entity: alarm_control_panel.alarm
```
--------------------------------
### Shortcut Badge to Perform Action with Custom Color
Source: https://www.home-assistant.io/dashboards/badges
This example shows how to create a shortcut badge that performs a specific action (e.g., running a script) and uses a custom color for its appearance.
```yaml
type: shortcut
text: "Good night"
color: indigo
tap_action:
action: perform-action
perform_action: script.good_night
```
--------------------------------
### Complex Example
Source: https://www.home-assistant.io/dashboards/area
A more complex example of the area card configuration with various options.
```yaml
type: area
area: bedroom
display_type: picture
tap_action:
action: navigate
navigation_path: /lovelace/my_bedroom
sensor_classes:
- temperature
- humidity
alert_classes:
- moisture
- motion
features:
- type: area-controls
```
--------------------------------
### Calendar period example
Source: https://www.home-assistant.io/dashboards/statistic
Example of configuring the statistic card with a calendar period and offset.
```yaml
type: statistic
entity: sensor.energy_consumption
period:
calendar:
period: month
offset: -1
stat_type: change
```
--------------------------------
### Fixed period example (all time)
Source: https://www.home-assistant.io/dashboards/statistic
Example of configuring the statistic card with a fixed period for all time.
```yaml
type: statistic
entity: sensor.energy_consumption
period:
fixed_period:
stat_type: change
```
--------------------------------
### Media Player Source Configuration
Source: https://www.home-assistant.io/dashboards/features
Configure a widget to display a dropdown for selecting media player sources. Optionally filter or reorder available sources.
```yaml
features:
- type: "media-player-source"
sources:
- "AirPlay"
- "SHIELD"
- "NET RADIO"
```
--------------------------------
### Fixed period example (year)
Source: https://www.home-assistant.io/dashboards/statistic
Example of configuring the statistic card with a fixed period for a specific year.
```yaml
type: statistic
entity: sensor.energy_consumption
period:
fixed_period:
start: 2022-01-01
end: 2022-12-31
stat_type: change
```
--------------------------------
### State filter example
Source: https://www.home-assistant.io/dashboards/picture-entity
This example demonstrates how to specify different CSS filters for different entity states.
```yaml
state_filter:
"on": brightness(110%) saturate(1.2)
"off": brightness(50%) hue-rotate(45deg)
```
--------------------------------
### Markdown card with ha-alert component example
Source: https://www.home-assistant.io/dashboards/markdown
Example demonstrating the use of the 'ha-alert' component within the Markdown card.
```yaml
type: markdown
content: |
This is an error alert — check it out!
This is a warning alert — check it out!
This is an info alert — check it out!
This is a success alert — check it out!
This is an alert with a title
```
--------------------------------
### Shortcut Badge to Launch Voice Assistant
Source: https://www.home-assistant.io/dashboards/badges
This snippet configures a shortcut badge to launch the Home Assistant voice assistant. No additional parameters are needed for this action.
```yaml
type: shortcut
tap_action:
action: assist
```
--------------------------------
### Basic picture entity card example
Source: https://www.home-assistant.io/dashboards/picture-entity
A simple example of a picture entity card displaying a light entity with a local image.
```yaml
type: picture-entity
entity: light.bed_light
image: /local/bed_light.png
```
--------------------------------
### QR Code Examples
Source: https://www.home-assistant.io/dashboards/markdown
Examples of how to use the ha-qr-code custom element within a Markdown card to generate QR codes with various parameters.
```yaml
type: markdown
content: >-
```
--------------------------------
### Picture Glance Card with Custom Entity Options
Source: https://www.home-assistant.io/dashboards/picture-glance
An example showcasing advanced entity configuration within a Picture Glance card. It uses attributes, prefixes, suffixes, and custom tap actions for entities.
```yaml
type: picture-glance
image: "/local/room.jpg"
entities:
- entity: sensor.living_room_temperature
attribute: temperature
prefix: "Temp: "
suffix: "°C"
tap_action:
action: more-info
- entity: vacuum.my_robot
icon: mdi:robot-vacuum
tap_action:
action: call-service
service: vacuum.return_to_base
service_data:
entity_id: vacuum.my_robot
```
--------------------------------
### Configure YAML Dashboards
Source: https://www.home-assistant.io/dashboards/dashboards
Add YAML dashboards by defining a `dashboards:` section under `lovelace:` in your `configuration.yaml`. Ensure `resource_mode` is set to `yaml` to load resources and dashboards from YAML files.
```yaml
lovelace:
# Use resource_mode to load resources from YAML
resource_mode: yaml
# Include external resources (requires resource_mode: yaml)
resources:
- url: /local/my-custom-card.js
type: module
- url: /local/my-webfont.css
type: css
# Add YAML dashboards
dashboards:
my-home: # Needs to contain a hyphen (-)
mode: yaml
filename: my-home.yaml
title: My home
icon: mdi:home-outline
show_in_sidebar: true
dashboard-hidden:
mode: yaml
filename: hidden.yaml
title: Hidden
show_in_sidebar: false
dashboard-admin:
mode: yaml
title: Admin
icon: mdi:tools
show_in_sidebar: true
require_admin: true
filename: admin.yaml
```
--------------------------------
### Tap action example
Source: https://www.home-assistant.io/dashboards/actions
Action that will be performed when an object on a card is tapped.
```yaml
tap_action:
action: toggle
```
--------------------------------
### Perform an action, with a custom color and a description
Source: https://www.home-assistant.io/dashboards/shortcut
Performs an action with a custom color and a description.
```yaml
type: shortcut
label: "Good night"
description: "Turn off all lights"
color: indigo
tap_action:
action: perform-action
perform_action: script.good_night
```
--------------------------------
### Temperature Forecast Widget Configuration
Source: https://www.home-assistant.io/dashboards/features
Set up the temperature-forecast widget to visualize upcoming temperature highs and lows. Supports daily, twice-daily, and hourly forecasts.
```yaml
features:
- type: "temperature-forecast"
forecast_type: daily
days_to_show: 7
```
--------------------------------
### Icon-only and text-only button badges
Source: https://www.home-assistant.io/dashboards/heading
Examples of icon-only and text-only Button badges.
```yaml
badges:
- type: button
icon: mdi:play
color: green
- type: button
text: Run automation
color: blue
```
--------------------------------
### Title and unit of measurement
Source: https://www.home-assistant.io/dashboards/gauge
Example of a gauge card with a title and unit of measurement.
```yaml
type: gauge
name: CPU Usage
unit: '%'
entity: sensor.cpu_usage
```
--------------------------------
### Double tap action example
Source: https://www.home-assistant.io/dashboards/actions
Action that will be performed when an object on a card is double-tapped.
```yaml
double_tap_action:
action: toggle
```
--------------------------------
### Multiple segments
Source: https://www.home-assistant.io/dashboards/gauge
Example of a gauge card with multiple segments, requiring 'needle' to be true.
```yaml
type: gauge
entity: sensor.kitchen_humidity
needle: true
min: 20
max: 80
segments:
- from: 0
color: '#db4437'
- from: 35
color: '#ffa600'
- from: 40
color: '#43a047'
- from: 60
color: '#ffa600'
- from: 65
color: '#db4437'
```
--------------------------------
### Valve Open/Close Widget Configuration
Source: https://www.home-assistant.io/dashboards/features
Set up a widget to display buttons for opening, closing, or stopping a valve. Uses the 'valve-open-close' type.
```yaml
features:
- type: "valve-open-close"
```
--------------------------------
### Picture Glance Card with State Image
Source: https://www.home-assistant.io/dashboards/picture-glance
This example demonstrates using `state_image` to change the background image based on an entity's state. It also shows how to use `state_filter` to apply CSS filters to the image based on the entity's state.
```yaml
type: picture-glance
image: "/local/default.jpg"
state_image:
"on": "/local/on.jpg"
"off": "/local/off.jpg"
state_filter:
"on": brightness(110%) saturate(1.2)
"off": brightness(50%) hue-rotate(45deg)
entity: switch.decorative_lights
```
--------------------------------
### Larger clock card for tablet dashboards
Source: https://www.home-assistant.io/dashboards/clock
Example of a larger clock card for tablet dashboards.
```yaml
type: clock
clock_size: large
time_format: "12"
show_seconds: true
```
--------------------------------
### Picture Glance Card Basic Configuration
Source: https://www.home-assistant.io/dashboards/picture-glance
A basic example of a Picture Glance card configuration using YAML. It sets a title, background image, and a list of entities with tap actions.
```yaml
type: picture-glance
title: "My Awesome Room"
image: "/local/room.jpg"
entities:
- entity: light.ceiling
tap_action:
action: toggle
- entity: switch.projector
tap_action:
action: toggle
- entity: camera.demo
tap_action:
action: more-info
- entity: sensor.temperature
tap_action:
action: more-info
```