Fan
Fan 集成允许您控制和监控风扇设备。
This fan is a building block integration that cannot be added to Home Assistant directly, but is used and provided by other integrations. A building block integration differs from a typical integration that connects to a device or service. Instead, other integrations use this fan building block to provide entities, actions, and other functionality that you can use in your automations or dashboards. If one of your integrations uses this building block, this page documents the functionality the fan building block offers.
风扇实体的状态
风扇实体的状态可以是 开 或 关。
此外,实体可以具有以下状态:
- 不可用:实体当前不可用。
- 未知:状态尚未知。
操作
风扇控制操作
可用操作:
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
并非所有风扇操作都可能适用于您的平台。您可以在 设置 > 开发者工具 > 操作 下检查您的风扇有哪些可用操作。
操作:设置百分比
fan.set_percentage 操作允许您为风扇设备设置速度百分比。
自动化示例
操作:设置预设模式
fan.set_preset_mode 操作允许您为风扇设备设置预设模式。可用的预设模式由向 Home Assistant 提供风扇实体的集成定义。例如,ESPHome Speed Fan 组件默认提供三种可用预设:Low、Medium 和 High。
自动化示例
操作:设置方向
fan.set_direction 操作允许您设置风扇设备的旋转方向。
自动化示例
操作:摆动
fan.oscillate 操作允许您设置风扇设备的摆动。
自动化示例
操作:打开
fan.turn_on 操作允许您打开风扇设备。这仅在风扇设备支持关闭时才支持。请参阅 fan.turn_off 下的类似示例。
操作:关闭
fan.turn_off 操作允许您关闭风扇设备。这仅在风扇设备支持打开时才支持。
自动化示例
操作 fan.increase_speed
增加风扇设备的速度。
自动化示例
操作 fan.decrease_speed
降低风扇设备的速度。

