Entities card: Tweaks, buttons screenshot + attribute example (#16126)

This commit is contained in:
Philip Allgaier 2021-01-08 13:26:08 +01:00 committed by GitHub
parent aba50ac2c4
commit e4c17bc965
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 17 deletions

View File

@ -4,9 +4,9 @@ sidebar_label: Entities
description: "The Entities card is the most common type of card. It groups items together into lists." description: "The Entities card is the most common type of card. It groups items together into lists."
--- ---
The Entities card is the most common type of card. It groups items together into lists. The Entities card is the most common type of card. It groups items together into lists. It can be used to display an entity's state or attribute, but also contain buttons, web links, etc.
To add the Entities card to your user interface, click the Lovelace menu (three dots at the top right of the screen) and then **Edit Dashboard**. Click the plus button in the bottom right corner and select **Entities** from the card picker. To add the Entities card to your user interface, click the Lovelace menu (three dots at the top right of the screen) and then **Edit Dashboard**. Click the "Add Card" button in the bottom right corner and select **Entities** from the card picker.
{% configuration %} {% configuration %}
type: type:
@ -15,7 +15,7 @@ type:
type: string type: string
entities: entities:
required: true required: true
description: "A list of entity IDs or `entity` objects, see below." description: "A list of entity IDs or `entity` objects or special row objects (see below)."
type: list type: list
title: title:
required: false required: false
@ -56,7 +56,7 @@ If you define entities as objects instead of strings (by adding `entity:` before
{% configuration %} {% configuration %}
entity: entity:
required: true required: true
description: Home Assistant entity ID. description: Entity ID.
type: string type: string
type: type:
required: false required: false
@ -115,12 +115,14 @@ double_tap_action:
## Special Row Elements ## Special Row Elements
Rather than only displaying an entity's state as a text output, the Entities card supports multiple special rows for buttons, attributes, web links, dividers and sections, etc.
### Button ### Button
{% configuration %} {% configuration %}
type: type:
required: true required: true
description: button description: "`button`"
type: string type: string
name: name:
required: true required: true
@ -156,7 +158,7 @@ Special row to start Home Assistant Cast.
{% configuration %} {% configuration %}
type: type:
required: true required: true
description: cast description: "`cast`"
type: string type: string
dashboard: dashboard:
required: false required: false
@ -190,7 +192,7 @@ Special row that displays based on entity states.
{% configuration %} {% configuration %}
type: type:
required: true required: true
description: conditional description: "`conditional`"
type: string type: string
conditions: conditions:
required: true required: true
@ -199,7 +201,7 @@ conditions:
keys: keys:
entity: entity:
required: true required: true
description: HA entity ID. description: Entity ID.
type: string type: string
state: state:
required: false required: false
@ -224,7 +226,7 @@ Note: Conditions with more than one entity are treated as an 'and' condition. Th
{% configuration %} {% configuration %}
type: type:
required: true required: true
description: divider description: "`divider`"
type: string type: string
style: style:
required: false required: false
@ -238,7 +240,7 @@ style:
{% configuration %} {% configuration %}
type: type:
required: true required: true
description: section description: "`section`"
type: string type: string
label: label:
required: false required: false
@ -251,7 +253,7 @@ label:
{% configuration %} {% configuration %}
type: type:
required: true required: true
description: weblink description: "`weblink`"
type: string type: string
url: url:
required: true required: true
@ -271,10 +273,12 @@ icon:
### Buttons ### Buttons
Multiple buttons displayed in a single row next to each other. See examples further below.
{% configuration %} {% configuration %}
type: type:
required: true required: true
description: buttons description: "`buttons`"
type: string type: string
entities: entities:
required: true required: true
@ -283,7 +287,7 @@ entities:
keys: keys:
entity: entity:
required: true required: true
description: The entity to render. description: Entity ID
type: string type: string
icon: icon:
required: false required: false
@ -304,11 +308,11 @@ entities:
{% configuration %} {% configuration %}
type: type:
required: true required: true
description: attribute description: "`attribute`"
type: string type: string
entity: entity:
required: true required: true
description: Home Assistant entity ID. description: Entity ID
type: string type: string
attribute: attribute:
required: true required: true
@ -328,7 +332,7 @@ name:
type: string type: string
{% endconfiguration %} {% endconfiguration %}
## Example ## Examples
Entity rows: Entity rows:
@ -348,7 +352,30 @@ entities:
- group.all_locks - group.all_locks
``` ```
Special rows: Buttons row:
Above the divider are regular entity rows, below one of type `buttons`. Note that regular entity rows automatically show the entity name, whereas for buttons you have to explicitely specify a label / name.
<p class='img'>
<img src='/images/lovelace/lovelace_entity_row_buttons.jpg' alt='Screenshot of buttons row'>
Screenshot of buttons row.
</p>
```yaml
type: entities
entities:
- entity: light.office_ceiling
- entity: light.dining_ceiling
- type: divider
- type: buttons
entities:
- entity: light.office_ceiling
name: Office Ceiling
- entity: light.dining_ceiling
name: Dining Ceiling
```
Other special rows:
```yaml ```yaml
type: entities type: entities
@ -363,6 +390,10 @@ entities:
service_data: service_data:
entity_id: light.bed_light entity_id: light.bed_light
- type: divider - type: divider
- type: attribute
entity: sun.sun
attribute: elevation
name: Elevation
- type: weblink - type: weblink
name: Home Assistant name: Home Assistant
url: https://www.home-assistant.io/ url: https://www.home-assistant.io/

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB