网格卡片

网格卡片允许您以网格的形式显示多个卡片。它将首先填充列,并根据需要自动添加新行。

网格卡片的截图 网格卡片的截图。

要将 网格卡片 添加到您的用户界面:

  1. 在屏幕右上角,选择编辑 按钮。
    • 如果这是您第一次编辑仪表板,将会出现 编辑仪表板 对话框。
      • 通过编辑仪表板,您将接管此仪表板的控制。
      • 这意味着当新的仪表板元素可用时,它将不再自动更新。
      • 一旦您接管控制,就无法将此特定仪表板恢复为自动更新状态。但是,您可以创建一个新的默认仪表板。
      • 要继续,请在对话框中选择三点菜单 ,然后选择 接管控制
  2. 添加卡片并自定义操作和功能 到您的仪表板。

此卡片的所有选项都可以通过用户界面进行配置。

YAML 配置

在您使用 YAML 模式或仅在 UI 的代码编辑器中更喜欢使用 YAML 时,可以使用以下 YAML 选项。

Configuration Variables

type string Required

grid

title string (Optional)

网格的标题。

square boolean (Optional, default: true)

卡片是否应以正方形显示。

columns integer (Optional, default: 3)

网格中的列数。

cards list Required

卡片列表。

示例

基本示例:

type: grid
cards:
  - type: picture-entity
    entity: camera.demo_camera
    show_info: false
  - type: entities
    entities:
      - binary_sensor.movement_backyard

定义列并禁用正方形选项:

type: grid
title: 后院
columns: 2
square: false
cards:
  - type: picture-entity
    entity: group.all_lights
    image: /local/house.png
  - type: horizontal-stack
    cards:
      - type: picture-entity
        entity: light.ceiling_lights
        image: /local/bed_1.png
      - type: picture-entity
        entity: light.bed_light
        image: /local/bed_2.png