ESPHome’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/esphome/esphome.io/llms.txt
Use this file to discover all available pages before exploring further.
fan domain exposes fan hardware as a Home Assistant fan entity. Fans can be switched on/off, set to a specific speed level, set to oscillate, reversed in direction, or placed in a named preset mode. Whether you’re controlling a simple relay-switched ceiling fan, a PWM-driven server fan, or a multi-speed bathroom exhaust fan, the fan domain provides the right abstraction.
Minimal Example
Base Fan Configuration
All fan platforms inherit these configuration variables.Manually specify the ID for code generation. At least one of
id and name must be specified.The name of the fan in Home Assistant. Set to
None to inherit the device’s friendly_name.Manually override the MDI icon shown in the frontend.
How the fan restores its state on boot:
ALWAYS_OFF(default) — always start off.ALWAYS_ON— always start on.RESTORE_DEFAULT_OFF— restore previous state, default to off.RESTORE_DEFAULT_ON— restore previous state, default to on.RESTORE_INVERTED_DEFAULT_OFF/RESTORE_INVERTED_DEFAULT_ON— restore inverted state.NO_RESTORE— do not restore any state.
If
true, the fan is not exposed to the frontend. Defaults to false.If
true, the entity is hidden in Home Assistant until manually enabled. Defaults to false.The entity category (
config, diagnostic). Set to "" to remove the default.Fan Actions
fan.turn_on
Turn the fan on, optionally setting speed, oscillation, and direction.
The fan to control.
Speed level (1 to
speed_count). Defaults to not changing the current speed.Enable or disable oscillation. Defaults to not changing the current state.
forward or reverse. Defaults to not changing the current direction.fan.turn_off
fan.toggle
fan.cycle_speed
Cycle through speed levels. If at maximum speed, turns the fan off (unless off_speed_cycle: false).
fan.is_on / fan.is_off Condition
Fan Triggers
Lambda Calls
Fan Platforms
Binary Fan
Simple on/off fan using a single binary output (relay). No speed control.
Speed Fan
Variable-speed fan driven by a float (PWM) output. Supports configurable speed levels.