楼主目前是那个并不怎么好使的巴法云对接的小爱和天猫。。。
一直没怎么用小爱,昨天手机喊小爱准备把前几天改的用永速风扇调小点,结果直接把速度跳到了2。。。。。然后发现通过巴法过来的是四个挡位。1,2,3,4。。。然后ha就直接对应了速度值1,2,3,4.。。这样就很离谱。
然后我想了下,用了一条自动化来映射挡位和风速的关系。
but本来以为也能有四档。。。但我发现ha反馈过去的风速值会让小爱那边以为已经是4档了,
这样就不会重新发指令过来,最终就只有三档风速
自动化配置如下,其实就是检测风速,变1了调到30,2调到60,3调到100.
按喜好改对应值就好了
alias: 巴法云小爱控制风速对应
description: ""
trigger:
- platform: state
entity_id:
- fan.ys_fan
condition: []
action:
- if:
- condition: numeric_state
entity_id: fan.ys_fan
attribute: percentage
above: 0
below: 2
then:
- service: fan.set_percentage
target:
entity_id: fan.ys_fan
data:
percentage: 30
enabled: true
- if:
- condition: numeric_state
entity_id: fan.ys_fan
attribute: percentage
above: 1
below: 3
then:
- service: fan.set_percentage
target:
entity_id: fan.ys_fan
data:
percentage: 60
enabled: true
- if:
- condition: numeric_state
entity_id: fan.ys_fan
attribute: percentage
above: 2
below: 4
then:
- service: fan.set_percentage
target:
entity_id: fan.ys_fan
data:
percentage: 100
enabled: true
- if:
- condition: numeric_state
entity_id: fan.ys_fan
attribute: percentage
above: 3
below: 5
then:
- service: fan.set_percentage
target:
entity_id: fan.ys_fan
data:
percentage: 100
enabled: false
mode: single
|