Loading...
Loading...
Compare original and translation side by side
Configure Lovelace dashboards, cards, views, and themes for Home Assistant.
配置Home Assistant的Lovelace仪表盘、卡片、视图和主题。
| Metric | Without Skill | With Skill |
|---|---|---|
| Setup Time | 30+ min | 10 min |
| Common Errors | 5 | 0 |
| Token Usage | ~8000 | ~4800 |
| 指标 | 未使用技能 | 使用技能 |
|---|---|---|
| 设置时间 | 30+ 分钟 | 10 分钟 |
| 常见错误 | 5 | 0 |
| 令牌使用 | ~8000 | ~4800 |
domain.entity_nameentitydomain.entity_nameentityundefinedundefined
**Why this matters:** YAML mode gives full control over dashboard configuration and enables version control.
**为什么这很重要:** YAML模式让你完全掌控仪表盘配置并支持版本控制。undefinedundefined
**Why this matters:** This minimal structure validates your YAML setup before adding complexity.
**为什么这很重要:** 这个极简结构可在添加复杂配置前验证你的YAML设置是否正确。views:
- title: Living Room
path: living-room
cards:
- type: entities
title: Lights
entities:
- light.living_room
- light.kitchen
- type: weather-forecast
entity: weather.home
forecast_type: dailyviews:
- title: Living Room
path: living-room
cards:
- type: entities
title: Lights
entities:
- light.living_room
- light.kitchen
- type: weather-forecast
entity: weather.home
forecast_type: dailydomain.entity_namelight.living_roomtap_actiondomain.entity_namelight.living_roomtap_actionforecast_typeforecast_typetype: button
entity:light.living_room
tap_action:
action: toggletype: button
entity: light.living_room
tap_action:
action: toggletype: button
entity:light.living_room
tap_action:
action: toggletype: button
entity: light.living_room
tap_action:
action: toggle| Issue | Root Cause | Solution |
|---|---|---|
| "Unknown card type" | Missing custom card resource | Add to |
| Cards not updating | Browser cache | Hard refresh (Ctrl+Shift+R) |
| Theme not applying | Wrong variable name | Check theme variable spelling |
| Blank dashboard | YAML syntax error | Validate YAML, check logs |
| Entity unavailable | Wrong entity ID | Check entity in Developer Tools > States |
| 问题 | 根本原因 | 解决方案 |
|---|---|---|
| "Unknown card type"(未知卡片类型) | 缺少自定义卡片资源 | 添加至 |
| 卡片不更新 | 浏览器缓存 | 强制刷新(Ctrl+Shift+R) |
| 主题不生效 | 变量名称错误 | 检查主题变量拼写 |
| 仪表盘空白 | YAML语法错误 | 验证YAML,查看日志 |
| 实体不可用 | 实体ID错误 | 在开发者工具 > 状态中检查实体 |
lovelace:
mode: yaml # or 'storage' for UI mode
resources:
- url: /local/card.js # Custom card resources
type: module
dashboards:
lovelace-custom:
mode: yaml
title: Custom
icon: mdi:view-dashboard
show_in_sidebar: true
filename: custom-dashboard.yamlmodeyamlstorageresourcesdashboardslovelace:
mode: yaml # or 'storage' for UI mode
resources:
- url: /local/card.js # Custom card resources
type: module
dashboards:
lovelace-custom:
mode: yaml
title: Custom
icon: mdi:view-dashboard
show_in_sidebar: true
filename: custom-dashboard.yamlmodeyamlstorageresourcesdashboardsviews:
- title: View Name # Tab title
path: view-path # URL path (/lovelace/view-path)
icon: mdi:home # Tab icon (optional)
type: masonry # masonry, panel, sections, sidebar
theme: dark-mode # Apply specific theme
subview: false # Hide from navigation
cards: [] # Card listviews:
- title: View Name # Tab title
path: view-path # URL path (/lovelace/view-path)
icon: mdi:home # Tab icon (optional)
type: masonry # masonry, panel, sections, sidebar
theme: dark-mode # Apply specific theme
subview: false # Hide from navigation
cards: [] # Card listtype: horizontal-stack
cards:
- type: button
entity: light.living_room
name: Living
tap_action:
action: toggle
- type: button
entity: light.bedroom
name: Bedroom
tap_action:
action: toggletype: horizontal-stack
cards:
- type: button
entity: light.living_room
name: Living
tap_action:
action: toggle
- type: button
entity: light.bedroom
name: Bedroom
tap_action:
action: toggletype: conditional
conditions:
- condition: state
entity: binary_sensor.home_occupied
state: "on"
card:
type: entities
title: Home Controls
entities:
- light.living_room
- climate.thermostattype: conditional
conditions:
- condition: state
entity: binary_sensor.home_occupied
state: "on"
card:
type: entities
title: "Home Controls"
entities:
- light.living_room
- climate.thermostatreferences/card-reference.mdview-types.mdtheme-variables.mdcommon-patterns.mdNote: For deep dives on specific topics, see the reference files above.
references/card-reference.mdview-types.mdtheme-variables.mdcommon-patterns.md注意: 如需深入了解特定主题,请查看上述参考文件。
assets/dashboard-template.yamlcard-snippets.yamlassets/dashboard-template.yamlcard-snippets.yaml| Library ID | Purpose |
|---|---|
| User docs - dashboards, cards, views, themes |
| Developer docs - custom card development |
| HACS frontend cards |
| 库ID | 用途 |
|---|---|
| 用户文档 - 仪表盘、卡片、视图、主题 |
| 开发者文档 - 自定义卡片开发 |
| HACS前端卡片 |
undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined