Home Assistant界面优化必装插件:fold-entity-row安装与使用指南
【免费下载链接】lovelace-fold-entity-row🔹 A foldable row for entities card, containing other rows项目地址: https://gitcode.com/gh_mirrors/lo/lovelace-fold-entity-row
fold-entity-row是一款专为Home Assistant设计的界面优化插件,它能够帮助用户在lovelace entities卡片中折叠和隐藏行,让界面更加整洁有序。本文将为你详细介绍fold-entity-row的安装方法和使用技巧,让你轻松打造个性化的Home Assistant控制面板。
为什么选择fold-entity-row?
在使用Home Assistant的过程中,随着设备和实体的增多,entities卡片往往会变得冗长杂乱,难以快速找到需要的控制项。fold-entity-row的出现解决了这一问题,它允许你将相关的实体行进行折叠,只在需要时展开查看,极大地提升了界面的可读性和操作效率。
图:fold-entity-row折叠与展开状态对比,左侧为折叠状态,右侧为展开状态
快速安装fold-entity-row
通过HACS安装(推荐)
HACS(Home Assistant Community Store)是Home Assistant的社区商店,提供了便捷的插件管理功能。如果你已经安装了HACS,可以按照以下步骤安装fold-entity-row:
- 打开Home Assistant的Web界面,进入HACS
- 点击左侧导航栏的“插件”选项
- 点击右下角的“+”按钮,搜索“fold-entity-row”
- 找到对应的插件后,点击“安装”按钮
- 安装完成后,重启Home Assistant
手动安装
如果你没有使用HACS,可以通过手动方式安装:
- 克隆仓库:
git clone https://gitcode.com/gh_mirrors/lo/lovelace-fold-entity-row - 将克隆得到的
fold-entity-row.js文件复制到Home Assistant的www/custom-lovelace/fold-entity-row/目录下 - 在Home Assistant的lovelace配置中添加资源:
resources: - url: /local/custom-lovelace/fold-entity-row/fold-entity-row.js type: module- 重启Home Assistant
基础使用方法
fold-entity-row的使用非常简单,只需在entities卡片中添加相应的配置即可。
基本折叠行配置
type: entities entities: - light.bed_light - type: custom:fold-entity-row head: light.bed_light entities: - light.bed_light - light.ceiling_lights - light.kitchen_lights在这个例子中,我们创建了一个折叠行,头部为light.bed_light实体,点击头部的箭头图标可以展开或折叠包含的实体行。
自定义头部样式
你可以像自定义普通entities卡片行一样自定义折叠行的头部:
type: entities entities: - type: custom:fold-entity-row head: type: section label: 灯光控制 entities: - light.bed_light - entity: light.ceiling_lights name: 天花板灯 - light.kitchen_lights这里我们使用了section类型作为头部,并设置了标签为“灯光控制”,使界面更加清晰。
高级功能与技巧
应用组配置
通过group_config选项,你可以为折叠行中的所有实体应用相同的配置:
type: entities entities: - type: custom:fold-entity-row head: type: section label: 所有灯光 group_config: secondary_info: last-changed icon: mdi:lamp entities: - light.bed_light - light.ceiling_lights - light.kitchen_lights这个配置会为折叠行中的所有灯光实体添加“最后更改时间”的次要信息,并统一使用“mdi:lamp”图标。
默认展开状态
设置open: true可以让折叠行默认处于展开状态:
type: entities entities: - type: custom:fold-entity-row head: type: section label: 常用设备 open: true entities: - light.bed_light - switch.living_room_tv - climate.thermostat嵌套折叠
fold-entity-row支持嵌套使用,你可以在一个折叠行中包含另一个折叠行:
type: entities entities: - type: custom:fold-entity-row head: type: section label: 房间控制 entities: - type: custom:fold-entity-row head: 卧室 entities: - light.bed_light - climate.bedroom - type: custom:fold-entity-row head: 客厅 entities: - light.living_room - switch.tv常见问题解答
fold-entity-row可以在哪些卡片中使用?
fold-entity-row只能在entities卡片中使用,不能在其他类型的卡片中单独使用。
如何调整折叠行的缩进距离?
可以通过padding参数调整折叠行的左侧缩进距离,单位为像素:
type: entities entities: - type: custom:fold-entity-row head: type: section label: 缩进示例 padding: 10 entities: - light.bed_light能否将折叠行与自动实体卡片结合使用?
可以,你可以使用auto-entities等插件来自动填充折叠行中的实体:
type: entities entities: - type: custom:auto-entities filter: include: - domain: sensor card: type: custom:fold-entity-row head: type: section label: 所有传感器总结
fold-entity-row是一款简单而强大的Home Assistant界面优化插件,它能够帮助你有效地组织和管理entities卡片中的实体行,让你的控制面板更加整洁、易用。通过本文介绍的安装方法和使用技巧,相信你已经能够轻松上手fold-entity-row,并打造出更加个性化的Home Assistant界面。
如果你想查看更多使用示例,可以参考项目中的test/views目录,那里包含了各种场景的测试用例。
【免费下载链接】lovelace-fold-entity-row🔹 A foldable row for entities card, containing other rows项目地址: https://gitcode.com/gh_mirrors/lo/lovelace-fold-entity-row
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考