TheDocumentation 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.
wifi: component connects your ESPHome device to a wireless access point. It is one of the two supported network transports (the other being Ethernet) and must be present in every configuration that needs network access — ESPHome will fail validation if neither wifi: nor ethernet: is configured. You cannot use both simultaneously. For best performance and fastest reconnection times, assign a static IP address via manual_ip.
Minimal Example
Configuration Variables
The SSID (network name) of the access point to connect to. Omit this key when using the
networks: list for multi-network support.The WPA/WPA2/WPA3 password (PSK) for the network. Leave empty for open networks.
A list of access points to try. ESPHome connects to the one with the strongest signal. When this key is used, omit the top-level
ssid and password. Each entry supports: ssid, password, manual_ip, channel, bssid, hidden (boolean), priority (int, -128 to 127), and eap for enterprise auth.Assign a static IP address. Skips DHCP negotiation, significantly improving connection speed and OTA reliability.
- static_ip (Required, IPv4): The device’s static IP address.
- gateway (Required, IPv4): The router/gateway IP address.
- subnet (Required, IPv4): Subnet mask (e.g.
255.255.255.0). - dns1 (Optional, IPv4): Primary DNS server.
- dns2 (Optional, IPv4): Secondary DNS server.
Enable Access Point (fallback hotspot) mode. When both
ssid/password and ap: are configured, the AP only activates when the station connection fails. Useful for first-time provisioning via Captive Portal.- ssid (Optional, string): AP network name. Defaults to the device name.
- password (Optional, string): AP password. Leave empty for open AP.
- channel (Optional, int): Wi-Fi channel (1–14). Defaults to
1. - ap_timeout (Optional, Time): How long to try the station before enabling the AP. Set to
0sto disable automatic fallback. Defaults to90s.
Controls the radio power saving level.
NONE uses the most power but is most reliable. HIGH saves the most power but causes frequent disconnections. Defaults to LIGHT on ESP32, NONE on ESP8266.Options: NONE, LIGHT, HIGHSkip the full scan and connect directly to the first matching AP. Dramatically reduces connection time and power consumption. The last successfully connected BSSID is tried first. Defaults to
false.Minimum Wi-Fi security standard accepted.
WPA2 (recommended) rejects legacy WPA-only networks. WPA3 is ESP32-only. Defaults to WPA2 on ESP32, WPA on ESP8266.Options: WPA, WPA2, WPA3How long to wait without a Wi-Fi connection before rebooting. Set to
0s to disable automatic reboots. Defaults to 15min. Does not apply in AP-only mode.Transmit power in dBm (range: 8.5 dB to 20.5 dB). Default is 20 dB on ESP8266 — note that 20.5 dB may cause unexpected restarts on some modules.
mDNS domain suffix for OTA uploads. Defaults to
.local, producing <name>.local.Override the target IP/hostname used for OTA uploads. Useful when migrating from a dynamic IP to a static one — point to the old address during the transition flash.
ESP32 only. Enable 802.11v BSS Transition Management for native AP roaming. When enabled,
post_connect_roaming is automatically disabled.ESP32 only. Enable 802.11k Radio Resource Management for native AP selection guidance. When enabled,
post_connect_roaming is automatically disabled.After connecting, periodically scan for a better AP with the same SSID (up to 3 checks, every 5 minutes). Switches if a +10 dB improvement is found. Helps recover from suboptimal AP selection after power outages or AP reboots. Defaults to
true.Perform Wi-Fi scans passively (listen-only) rather than actively sending probe requests. Defaults to
false.ESP32-C5 only. Select the frequency band. Options:
AUTO, 2.4GHZ, 5GHZ. Defaults to AUTO.ESP8266 only. Pin the radio to a specific 802.11 PHY mode. Options:
AUTO, 11B, 11G, 11N. Defaults to AUTO. Use 11G to work around compatibility issues with some routers that have problems with ESP8266 devices in 802.11n mode.If
false, Wi-Fi is not started at boot. Use wifi.enable action to start it later. Defaults to true.Automation triggered when a Wi-Fi station connection is established.
Automation triggered when the Wi-Fi connection is dropped.
Advanced Example
Connecting to a Hidden Network
Enterprise (WPA2-EAP) Authentication
Be mindful of
reboot_timeout when using wifi.disable action. If Wi-Fi stays off longer than the timeout, the device will reboot. Set reboot_timeout: 0s to disable the watchdog if you intentionally power-cycle the radio.Wi-Fi Actions
Usewifi.disable and wifi.enable in automations to control the radio on demand:
wifi.configure to connect to a runtime-specified SSID: