本帖最后由 dscao 于 2021-4-20 00:39 编辑
效果:
三个按钮的功能:
1:打开关闭某个自动化
2:20%风速
3:80%风速
暂时搞不定滑块功能的代码,只能用两个固定风速的按钮凑合用了。 需要风速调整就要点一下右上角的三个点进入系统默认的详情页吧。其实打开第一个按钮,设置好自动化就可以不用管了,自动工作。
其它与原卡片一致,修改或增加了一点代码,多余的代码没有处理,还是凑合用吧,所以不能与原卡片同时使用。
hacs中安装 小米空气净化器
将修改的文件替换到 "config\www\community\lovelace-air-filter-card" 中同名文件
刷新后,填写实体和传感器,选项保持默认不能改。
A1刷的是zA1固件,现在支持无极调速。https://github.com/a2633063/zA1/ ... t%E6%8E%A5%E5%85%A5
M1刷的是zM1固件
自动化参考:
alias: 卧室空气净化器自动工作
description: 当甲醛高于0.3或PM2.5高于150时全速运行;高于0.2或100,50%风速;高于0.1或75,20%风速;低于0.06或60关闭。
trigger:
- platform: time_pattern
seconds: /15
condition: []
action:
- choose:
- conditions:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.zm1_b0f89328f611_hcho
above: '0.3'
- condition: numeric_state
entity_id: sensor.zm1_b0f89328f611_pm25
above: '150'
- condition: state
entity_id: fan.za1_b0f8932fd174
state: 'on'
sequence:
- service: fan.set_percentage
data:
percentage: 100
target:
entity_id: fan.za1_b0f8932fd174
- conditions:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.zm1_b0f89328f611_hcho
above: '0.2'
below: '0.3'
- condition: numeric_state
entity_id: sensor.zm1_b0f89328f611_pm25
above: '100'
below: '150'
- condition: state
entity_id: fan.za1_b0f8932fd174
state: 'on'
sequence:
- service: fan.set_percentage
target:
entity_id: fan.za1_b0f8932fd174
data:
percentage: 60
- conditions:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.zm1_b0f89328f611_hcho
above: '0.1'
below: '0.2'
- condition: numeric_state
entity_id: sensor.zm1_b0f89328f611_pm25
above: '75'
below: '100'
- condition: state
entity_id: fan.za1_b0f8932fd174
state: 'on'
sequence:
- service: fan.set_percentage
target:
entity_id: fan.za1_b0f8932fd174
data:
percentage: 30
- conditions:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.zm1_b0f89328f611_hcho
above: '0.1'
- condition: numeric_state
entity_id: sensor.zm1_b0f89328f611_pm25
above: '75'
- condition: state
entity_id: fan.za1_b0f8932fd174
state: 'off'
sequence:
- service: fan.turn_on
data: {}
entity_id: fan.za1_b0f8932fd174
default:
- condition: state
entity_id: fan.za1_b0f8932fd174
state: 'on'
- condition: numeric_state
entity_id: sensor.zm1_b0f89328f611_pm25
below: '60'
- condition: numeric_state
entity_id: sensor.zm1_b0f89328f611_hcho
below: '0.06'
- service: fan.turn_off
target:
entity_id: fan.za1_b0f8932fd174
mode: single
|