23
302
1982
论坛技术达人
并没有隐藏内容,如果觉得有用回复下帮忙顶贴。
效果图
hf_weather
{HA配置目录}/custom_components/
# 配置 configuration.yaml # {{}}符号为标示变量 weather: - platform: hf_weather name: {{test}} # 必填,自定义实体名称,生成实体的entityId为weather.{{test}},后续配置需要用到 city: {{YOUR_CITY_CODE}} # 必填,城市代码,支持城市中英文名称、ID和IP地址,例如city=北京,city=beijing,city=CN101010100,city= 60.194.130.1,建议使用ID appkey: {{YOUR_API_KEY}} # 必填,京东万象api平台申请的key
INFO:重复即可增加多个实体。
# 配置 configuration.yaml sun:
DEBUG:用于提供卡片的日出日落数据。
下载文件,hf_weather-card目录放置在{HA配置目录}/www/custom-lovelace/下。
hf_weather-card
{HA配置目录}/www/custom-lovelace/
INO:该路径可自定义,只要保证在www目录里即可。
lovelace启用天气卡片
# 配置lovelace(使用UI的原始编辑器编辑即可) # 引入自定义卡片hf_weather-card resources: - type: module url: /local/custom-lovelace/hf_weather-card/hf_weather-card.js - type: module url: /local/custom-lovelace/hf_weather-card/hf_weather-more-info.js # 在view里面的cards节点,增加天气卡片类型 views: - path: default_view title: Home cards: - type: 'custom:hf_weather-card' # card类型 entity: weather.test # entityid mode: daily # hourly按小时天气预报、daily按天天气预报,不设置则同时显示 title: 天气 # 标题,不设置则使用entity的friendly_name icons: /local/custom-lovelace/hf_weather-card/icons/animated/ # 图标路径,不设置则采用cdn,结尾要有"/"
WARN:lovelace配置里面路径,/local/实际映射{HA配置目录}/www/,保证放置文件的子路径设置对。
/local/
{HA配置目录}/www/
custom_ui_more_info
查看全部评分
使用道具 举报
7
1845
4827
论坛元老
流水无味
1
109
325
中级会员
0
119
505
高级会员
52
1346
4385
288
672
2343
金牌会员
4
274
895
46
252
论坛分享达人
41
148
注册会员
本版积分规则 发表回复 回帖后跳转到最后一页
经常参与各类话题的讨论,发帖内容较有主见
教程高产大神,简直就是为了教程而生~
经常在论坛发帖,且发帖量较大
Archiver|手机版|小黑屋|Hassbian
GMT+8, 2019-12-10 01:38 , Processed in 0.079804 second(s), 25 queries .
Powered by Discuz! X3.4
© 2001-2017 Comsenz Inc.