如何快速上手Lovelace-auto-entities:5分钟搭建智能实体列表

【免费下载链接】lovelace-auto-entities 🔹Automatically populate the entities-list of lovelace cards 【免费下载链接】lovelace-auto-entities 项目地址: https://gitcode.com/gh_mirrors/lo/lovelace-auto-entities

Lovelace-auto-entities是一款能自动填充Lovelace卡片实体列表的实用工具,帮助用户轻松管理家庭自动化系统中的各种设备实体。通过简单配置,即可实现实体的自动筛选、排序和展示,让智能家居控制界面更智能、更个性化。

快速安装指南

要开始使用Lovelace-auto-entities,首先需要将项目克隆到本地。打开终端,执行以下命令:

git clone https://gitcode.com/gh_mirrors/lo/lovelace-auto-entities

克隆完成后,按照项目文档中的指引将插件添加到Home Assistant的Lovelace界面即可。整个安装过程简单快捷,无需复杂的技术知识。

基础配置步骤

Lovelace-auto-entities的核心配置文件为YAML格式,主要包含卡片类型、筛选条件和显示选项等部分。以下是一个基本的配置结构示例:

type: custom:auto-entities
card:
  type: glance  # 卡片类型
filter:
  include: []  # 包含的实体规则
  exclude: []  # 排除的实体规则

通过修改includeexclude部分的规则,可以精确控制哪些实体显示在卡片中。例如,要显示所有灯光设备,只需在include中添加- domain: light即可。

实用示例演示

示例1:显示所有开启的灯光

以下配置将创建一个标题为“Lights on”的glance卡片,只显示状态为“on”的灯光实体,并支持点击切换状态:

type: custom:auto-entities
show_empty: false
card:
  type: glance
  title: Lights on
filter:
  include:
    - domain: light
      state: "on"  # 注意:"on"和"off"在YAML中需要加引号
      options:
        tap_action:
          action: toggle

示例2:低电量设备提醒

这个示例会创建一个实体卡片,显示所有GPS设备追踪器中电池电量低于50%的设备,并显示最后更新时间:

type: custom:auto-entities
card:
  type: entities
  title: Battery warning
filter:
  include:
    - domain: device_tracker
      options:
        secondary_info: last-changed
      attributes:
        battery: "< 50"
        source_type: gps

示例3:排除特定实体

以下配置将显示除yahoo天气、组和区域之外的所有实体:

type: custom:auto-entities
card:
  type: glance
filter:
  include: [{}]
  exclude:
    - entity_id: "*yweather*"
    - domain: group
    - domain: zone

常见问题解决

如果在使用过程中遇到实体不显示的问题,首先检查筛选条件是否正确,确保includeexclude规则没有冲突。另外,注意YAML语法的正确性,特别是字符串引号的使用。如果需要更高级的筛选功能,可以参考项目中的test/lovelace/目录下的示例文件,里面包含了各种复杂场景的配置案例。

通过以上简单步骤,你已经可以快速上手Lovelace-auto-entities,打造属于自己的智能实体列表。随着对配置规则的深入了解,还可以实现更复杂的实体管理功能,让Home Assistant的界面更加个性化和高效。

【免费下载链接】lovelace-auto-entities 🔹Automatically populate the entities-list of lovelace cards 【免费下载链接】lovelace-auto-entities 项目地址: https://gitcode.com/gh_mirrors/lo/lovelace-auto-entities

Logo

openvela 操作系统专为 AIoT 领域量身定制,以轻量化、标准兼容、安全性和高度可扩展性为核心特点。openvela 以其卓越的技术优势,已成为众多物联网设备和 AI 硬件的技术首选,涵盖了智能手表、运动手环、智能音箱、耳机、智能家居设备以及机器人等多个领域。

更多推荐