首页
/ Home Assistant房间摘要卡片(Room Summary Card)配置详解

Home Assistant房间摘要卡片(Room Summary Card)配置详解

2025-06-20 02:02:44作者:何将鹤

项目概述

Room Summary Card是Home Assistant平台上一款功能强大的自定义卡片组件,专门用于展示房间或区域的智能设备状态摘要。该卡片能够直观地呈现房间内的设备状态、环境传感器数据,并提供美观的视觉布局选项,是构建智能家居控制面板的理想选择。

基础配置

基本房间配置

最简单的配置只需要指定区域ID即可:

type: custom:room-summary-card
area: living_room

这个配置会自动显示客厅(living_room)区域内的所有设备状态。

自定义区域名称

如果你想显示更友好的区域名称,可以使用area_name参数:

type: custom:room-summary-card
area: living_room
area_name: '家庭客厅'

视觉增强配置

背景图片设置

为卡片添加背景图片可以显著提升视觉效果:

type: custom:room-summary-card
area: living_room
background:
  image: /local/images/living-room.jpg
  opacity: 30

opacity参数控制背景透明度(0-100),数值越小越透明。

动态背景

更高级的用法是使用实体状态作为背景源:

type: custom:room-summary-card
area: bedroom
background:
  image_entity: person.john
  opacity: 40

这会将"person.john"实体的图片属性作为背景。

设备控制配置

自定义主控实体

你可以指定一个主控实体,通常用于控制房间的主要设备:

type: custom:room-summary-card
area: living_room
entity:
  entity_id: light.living_room_main
  icon: mdi:ceiling-light
  tap_action:
    action: toggle

tap_action定义了点击时的动作,这里设置为切换开关状态。

传感器数据展示

展示房间环境传感器数据是常见需求:

type: custom:room-summary-card
area: living_room
sensors:
  - sensor.living_room_temperature
  - sensor.living_room_humidity
  - sensor.living_room_co2
  - sensor.living_room_light_level
sensor_layout: bottom

sensor_layout参数控制传感器数据显示位置,可选bottomright

高级功能配置

阈值告警

设置环境参数阈值,超出时卡片边框会变色提示:

type: custom:room-summary-card
area: garage
thresholds:
  temperature: 85  # 温度超过85°F显示红色边框
  humidity: 70     # 湿度超过70%显示蓝色边框

自定义实体列表

默认显示区域内所有实体,但你可以精确控制显示哪些:

type: custom:room-summary-card
area: office
features:
  - exclude_default_entities
entities:
  - entity_id: light.office_desk
    icon: mdi:desk-lamp
  - entity_id: switch.office_computer
    icon: mdi:desktop-tower

exclude_default_entities特性会禁用自动显示区域实体功能。

问题实体检测

卡片可以自动检测并统计标记为"problem"的问题设备:

  1. 在Home Assistant中进入设置 → 区域与标签
  2. 创建或编辑标签
  3. 为相关实体添加"problem"标签
  4. 卡片会自动检测并显示问题数量

完整配置示例

type: custom:room-summary-card
area: living_room
area_name: '客厅'
entity:
  entity_id: light.living_room_main
  icon: mdi:ceiling-light
  tap_action:
    action: toggle
  hold_action:
    action: more-info
entities:
  - entity_id: switch.living_room_tv
    icon: mdi:television
  - light.living_room_lamp
  - switch.living_room_fan
sensors:
  - sensor.living_room_temperature
  - sensor.living_room_humidity
  - sensor.living_room_co2
sensor_layout: bottom
background:
  image: /local/images/living-room.jpg
  opacity: 25
thresholds:
  temperature: 75
  humidity: 55
features:
  - hide_area_stats
  - hide_sensor_icons
navigate: /lovelace/living-room

样式定制

基础颜色定制

styles:
  title:
    color: '#4CAF50'
    font-weight: bold
  entities:
    background: blue
  stats:
    color: '#FFC107'
  sensors:
    color: '#2196F3'

现代玻璃效果

styles:
  card:
    background: 'rgba(255, 255, 255, 0.1)'
    border: '1px solid rgba(255, 255, 255, 0.2)'
    border-radius: 20px
    backdrop-filter: 'blur(10px)'
  title:
    color: '#ffffff'
    font-weight: 300
    letter-spacing: 2px
  stats:
    color: 'rgba(255, 255, 255, 0.7)'
  sensors:
    color: 'rgba(255, 255, 255, 0.8)'

使用建议

  1. 渐进式配置:从简单配置开始,逐步添加功能
  2. 合理分组:按房间功能组织实体,保持卡片整洁
  3. 视觉层次:利用背景和样式突出重要信息
  4. 响应式设计:在不同设备上测试显示效果
  5. 性能考虑:避免在卡片中加载过多实体影响性能

Room Summary Card通过灵活的配置选项,能够满足从简单到复杂的各种房间摘要展示需求,是构建智能家居控制中心的理想组件。

登录后查看全文
热门项目推荐

热门内容推荐

最新内容推荐

项目优选

收起
ohos_react_nativeohos_react_native
React Native鸿蒙化仓库
C++
176
261
RuoYi-Vue3RuoYi-Vue3
🎉 (RuoYi)官方仓库 基于SpringBoot,Spring Security,JWT,Vue3 & Vite、Element Plus 的前后端分离权限管理系统
Vue
860
511
ShopXO开源商城ShopXO开源商城
🔥🔥🔥ShopXO企业级免费开源商城系统,可视化DIY拖拽装修、包含PC、H5、多端小程序(微信+支付宝+百度+头条&抖音+QQ+快手)、APP、多仓库、多商户、多门店、IM客服、进销存,遵循MIT开源协议发布、基于ThinkPHP8框架研发
JavaScript
93
15
openGauss-serveropenGauss-server
openGauss kernel ~ openGauss is an open source relational database management system
C++
129
182
openHiTLSopenHiTLS
旨在打造算法先进、性能卓越、高效敏捷、安全可靠的密码套件,通过轻量级、可剪裁的软件技术架构满足各行业不同场景的多样化要求,让密码技术应用更简单,同时探索后量子等先进算法创新实践,构建密码前沿技术底座!
C
259
300
kernelkernel
deepin linux kernel
C
22
5
cherry-studiocherry-studio
🍒 Cherry Studio 是一款支持多个 LLM 提供商的桌面客户端
TypeScript
596
57
CangjieCommunityCangjieCommunity
为仓颉编程语言开发者打造活跃、开放、高质量的社区环境
Markdown
1.07 K
0
HarmonyOS-ExamplesHarmonyOS-Examples
本仓将收集和展示仓颉鸿蒙应用示例代码,欢迎大家投稿,在仓颉鸿蒙社区展现你的妙趣设计!
Cangjie
398
371
Cangjie-ExamplesCangjie-Examples
本仓将收集和展示高质量的仓颉示例代码,欢迎大家投稿,让全世界看到您的妙趣设计,也让更多人通过您的编码理解和喜爱仓颉语言。
Cangjie
332
1.08 K