Fan
The Fan integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more] allows you to control and monitor fan devices.
构建模块集成
这个 fan 是一个构建模块集成,无法直接添加到你的 Home Assistant 中,但可以被其他集成使用和提供。
构建模块集成不同于典型的与设备或服务连接的集成。相反,其他将设备或服务集成到 Home Assistant 中的集成使用这个 fan 构建模块来提供实体、服务和其他你可以在自动化或仪表板中使用的功能。
如果你的某个集成具有这个构建模块,这个页面记录了 fan 构建模块所提供的功能。
The state of a fan entity
The state of a fan entity can be either On or Off.
In addition, the entity can have the following states:
- Unavailable: The entity is currently unavailable.
- Unknown: The state is not yet known.
Actions
Fan control actions
Available actions:
fan.set_percentage
, fan.set_preset_mode
, fan.set_direction
, fan.oscillate
, fan.turn_on
, fan.turn_off
, fan.toggle
, fan.increase_speed
, fan.decrease_speed
Not all fan actions may be available for your platform. You can check which actions are available for your fan(s) under Developer Tools > Actions.
Action fan.set_percentage
Sets the speed percentage for fan device.
Data attribute | Optional | Description |
---|---|---|
entity_id |
yes | String or list of strings that define the entity ID(s) of fan device(s) to control. To target all fan devices, use all . |
percentage |
no | Percentage speed setting |
Automation example
automation:
triggers:
- trigger: time
at: "07:15:00"
actions:
- action: fan.set_percentage
target:
entity_id: fan.kitchen
data:
percentage: 33
Action fan.set_preset_mode
Sets a preset mode for the fan device. Available preset modes are defined by the integration that supplies the fan entity to Home Assistant. For example, the ESPHome Speed FanLow
, Medium
, and High
.
Data attribute | Optional | Description |
---|---|---|
entity_id |
yes | String or list of strings that define the entity ID(s) of fan device(s) to control. To target all fan devices, use all . |
preset_mode |
no | The preset mode |
Automation example
automation:
triggers:
- trigger: time
at: "07:15:00"
actions:
- action: fan.set_preset_mode
target:
entity_id: fan.kitchen
data:
preset_mode: auto
Action fan.set_direction
Sets the rotation for fan device.
Data attribute | Optional | Description |
---|---|---|
entity_id |
yes | String or list of strings that define the entity ID(s) of fan device(s) to control. To target all fan devices, use all . |
direction |
no | The direction to rotate. Either forward or reverse
|
Automation example
automation:
triggers:
- trigger: time
at: "07:15:00"
actions:
- action: fan.set_direction
target:
entity_id: fan.kitchen
data:
direction: forward
Action fan.oscillate
Sets the oscillation for fan device.
Data attribute | Optional | Description |
---|---|---|
entity_id |
yes | String or list of strings that define the entity ID(s) of fan device(s) to control. To target all fan devices, use all . |
oscillating |
no | Flag to turn on/off oscillation. Either True or False . |
Automation example
automation:
triggers:
- trigger: time
at: "07:15:00"
actions:
- action: fan.oscillate
target:
entity_id: fan.kitchen
data:
oscillating: True
Action fan.turn_on
Turn fan device on. This is only supported if the fan device supports being turned off. See a similar example under fan.turn_off
.
Data attribute | Optional | Description |
---|---|---|
entity_id |
yes | String or list of strings that define the entity ID(s) of fan device(s) to control. To target all fan devices, use all . |
percentage |
yes | Percentage speed setting |
preset_mode |
yes | The preset mode |
Action fan.turn_off
Turn fan device off. This is only supported if the fan device supports being turned on.
Data attribute | Optional | Description |
---|---|---|
entity_id |
yes | String or list of strings that define the entity ID(s) of fan device(s) to control. To target all fan devices, use all . |
Automation example
automation:
triggers:
- trigger: time
at: "07:15:00"
actions:
- action: fan.turn_off
target:
entity_id: fan.kitchen
data:
speed: low
Action fan.increase_speed
Increases the speed of the fan device.
Data attribute | Optional | Description |
---|---|---|
entity_id |
yes | String or list of strings that define the entity ID(s) of fan device(s) to control. To target all fan devices, use all . |
percentage_step |
yes | Increase speed by a percentage. Should be between 0..100. |
Automation example
automation:
triggers:
- trigger: device
device_id: 097cd9f706a86e9163acb64ba7d630da
domain: lutron_caseta
type: press
subtype: raise
actions:
- action: fan.increase_speed
target:
entity_id: fan.dining_room_fan_by_front_door
Action fan.decrease_speed
Decreases the speed of the fan device.
Data attribute | Optional | Description |
---|---|---|
entity_id |
yes | String or list of strings that define the entity ID(s) of fan device(s) to control. To target all fan devices, use all . |
percentage_step |
yes | Decrease speed by a percentage. Should be between 0..100. |
Automation example
automation:
triggers:
- trigger: device
device_id: 097cd9f706a86e9163acb64ba7d630da
domain: lutron_caseta
type: press
subtype: lower
actions:
- action: fan.decrease_speed
target:
entity_id: fan.dining_room_fan_by_front_door