本帖最后由 cosmo 于 2020-7-14 00:24 编辑
一、背景最近自己组了j3455黑群晖,所以重新弄了DOCKER版的HA(0.107.7),然后尴尬的是发现自己之前的空气净化器的配置凉凉了。
于是乎,原来是0.107.7的miio生成的服务名不一样了,特此更新给有需要的小伙伴。
二、成品展示
先晒晒成品,让大家有兴趣搞下去~
三、需要做啥
(一)通过HACS商店下载以下插件
card-mod、card-tools、vertical-stack-in-card、layout-card、slider-entity-row、fold-entity-row、secondaryinfo-entity-row
(二)把资源信息加入ui-lovelace文件
resources:
- url: /local/community/lovelace-card-mod/card-mod.js
type: module
- url: /local/community/lovelace-card-tools/card-tools.js
type: module
- url: /local/community/vertical-stack-in-card/vertical-stack-in-card.js
type: module
- url: /local/community/lovelace-layout-card/layout-card.js
type: module
- url: /local/community/lovelace-slider-entity-row/slider-entity-row.js
type: module
- url: /local/community/lovelace-fold-entity-row/fold-entity-row.js
type: module
- url: /local/community/secondaryinfo-entity-row/secondaryinfo-entity-row.js
type: module
(三)配置小米空净
在packages里新建一个yaml文件:
xiaomi2s.yaml
(3.95 KB, 下载次数: 433)
(四)配置ui-lovelace卡片
- type: custom:vertical-stack-in-card
cards:
- type: markdown
title: 空净
style: |
ha-card {
--paper-item-icon-color: Gainsboro;
--primary-text-color: ##104E8B;
--secondary-text-color: #B3E5FC;
background:rgba(255,255,255,0);
}
.card-header{
background: url(/local/images/card/ha-card-kj1.jpg);
color: white;
}
content: |
<br>
- type: entities
show_header_toggle: false
style: |
ha-card {
--paper-item-icon-color: Gainsboro;
--primary-text-color: black;
--secondary-text-color: gray;
background:rgba(255,255,255,0);
}
}
entities:
- entity: fan.xiaomi_air_purifier_2s
type: 'custom:secondaryinfo-entity-row'
secondary_info: >-
滤芯已用:[[ fan.xiaomi_air_purifier_2s.attributes.filter_hours_used ]]小时,剩余:[[ fan.xiaomi_air_purifier_2s.attributes.filter_life_remaining ]]%
- type: custom:slider-entity-row
entity: input_select.xiaomi_ap_mode
icon: mdi:air-conditioner
name: 模式
- type: glance
show_state: false
style: |
ha-card {
--paper-item-icon-color: Black;
background:rgba(255,255,255,0);
}
aspect_ratio: 492:232
entities:
- entity: switch.xiaomi_ap_buzzer
tap_action:
action: toggle
- entity: switch.xiaomi_ap_light
tap_action:
action: toggle
- entity: switch.xiaomi_ap_childlock
tap_action:
action: toggle
- type: glance
style: |
ha-card {
--paper-item-icon-color: Black;
background:rgba(255,255,255,0);
}
aspect_ratio: 492:232
entities:
- sensor.xiaomi_ap_aqi
- sensor.xiaomi_ap_temp
- sensor.xiaomi_ap_humid
(五)完事重启运行。
最后2020.7.14更新,前段时间忙着结婚哈哈。忘了给评论里的兄dei们放附件了。把hacs里涉及的插件和顶图都传上来了哦。
|