alias: 单击旋钮打开风扇
description: ''
trigger:
- platform: state
entity_id: sensor.ble_dimmer_f82********
attribute: last packet id
condition:
- condition: and
conditions:
- condition: state
entity_id: sensor.ble_dimmer_f82*******
attribute: last type of press
state: short press
action:
- service: fan.toggle
entity_id: fan.xiaomi_smart_fan
mode: single
alias: '右旋转调高转速 '
description: ''
trigger:
- platform: state
entity_id: sensor.ble_dimmer_f82********
attribute: last packet id
condition:
- condition: and
conditions:
- condition: state
entity_id: sensor.ble_dimmer_f82******
attribute: last type of press
state: rotate right
action:
- service: fan.set_percentage
data_template:
entity_id: fan.xiaomi_smart_fan
percentage: '{{states.fan.xiaomi_smart_fan.attributes.percentage +5}}'
mode: single
alias: '按压左旋转减小风扇摆角 '
description: ''
trigger:
- platform: state
entity_id: sensor.ble_dimmer_f82*******
attribute: last packet id
condition:
- condition: and
conditions:
- condition: state
entity_id: sensor.ble_dimmer_f82*******
attribute: last type of press
state: rotate left (pressed)
action:
- service: xiaomi_miio_fan.fan_set_oscillation_angle
data_template:
entity_id: fan.xiaomi_smart_fan
angle: '{{((states.fan.xiaomi_smart_fan.attributes.angle)/30) |round*30 - 30}}'
mode: single