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.
web_server component starts a lightweight HTTP server directly on your ESPHome device. Once enabled, you can open a browser to the device’s IP address (or <device-name>.local/) and interact with every entity — view sensor readings, toggle switches, adjust numbers, and tail live logs — without needing Home Assistant or any external service. The same server also exposes a REST API and a Server-Sent Events (SSE) stream for programmatic access.
Minimal Configuration
http://<device-ip>/ or http://<device-name>.local/ in your browser to open the interface.
Configuration Variables
The TCP port the web server listens on. Defaults to
80.UI version to serve. Options:
1, 2, or 3.- Version 1 — Simple table layout.
- Version 2 — Web components, richer functionality. Default.
- Version 3 — Home Assistant-style theming with entity grouping and sorting.
Show the live log panel in the web interface. Set to
false to hide it. Defaults to true.Set to
false to disable OTA firmware updates through the web interface. Only false is accepted here — to enable OTA via the web server, use the web_server OTA platform instead. Useful when captive_portal: is configured and you want OTA restricted to the captive portal context.When
true, all CSS and JS assets are embedded in the firmware and served from flash instead of loaded from the CDN at oi.esphome.io. Enables fully offline operation. Defaults to false.Compression algorithm for embedded assets when
local: true. Options: gzip (default) or br (Brotli). Brotli produces ~10% smaller binaries, but some browsers only support Brotli over HTTPS. Use gzip for maximum compatibility since ESPHome devices serve over HTTP.URL for the CSS stylesheet. Defaults to the hosted stylesheet at
oi.esphome.io. Set to "" to load no external CSS (useful with css_include).Path to a local CSS file to embed. The file is served as
/0.css. Useful for offline-capable AP mode deployments.URL for the JavaScript file. Defaults to the hosted script at
oi.esphome.io. Set to "" to load no external JS (useful with js_include).Path to a local JavaScript file to embed. The file is served as
/0.js. Useful for offline-capable AP mode deployments.Whether to display entities marked
internal: true in the web interface. Defaults to false.Enables support for the Private Network Access browser specification and its permission prompt. Defaults to
true.Version 3 only. Define named groups for organizing entities on the page.
Unique identifier for the group, referenced by entities via
sorting_group_id.Display name shown as the group header.
Groups with smaller weights appear first. Defaults to
50.Manually specify the component ID for code generation.
Configuration Examples
Authentication (Recommended)
Always protect the web interface with authentication to prevent unauthorized access on your local network.Version 3 with Entity Grouping
Fully Offline (Local Assets)
Embeds all web assets in firmware — no internet access required on client devices:Disable OTA with Captive Portal
When usingcaptive_portal:, OTA is automatically available through the portal. Set ota: false to prevent OTA through the regular web interface:
Version 1 with Fully Local Assets
Serve version 1 UI entirely from local files with no CDN dependency:Web Server Versions
Version 1
Simple table-based layout. Lowest memory footprint. Suitable for ESP8266 and resource-constrained devices.
Version 2
Web component architecture with richer controls. Supports sliders, dropdowns, and input fields. Default.
Version 3
Home Assistant-inspired styling. Adds entity grouping, sorting weights, sensor history graphs, and full-screen expand controls.
Version 3 Features
Entity Sorting
Assign asorting_weight to any entity. Lower values appear first. Defaults to 50 when unset:
Number Slider
Number entities render as sliders. Click and hold the displayed value to open a precise input popup where you can type an exact number and press Enter to confirm.Expand Controls and Logs
Double-click any group header to expand that group’s controls to full-screen. Double-click the log header to expand the log panel to full-screen. Double-click again to collapse.Sensor History Graph
Click on any sensor card to expand an inline history graph showing recent values over time.OTA Updates via the Web Interface
To enable OTA updates through the web server (in addition to or instead of the native API):The
captive_portal: component automatically loads the web_server OTA platform. You do not need to configure it separately if you use captive_portal.Security Considerations
- Use
!secretvalues forusernameandpasswordto keep credentials out of your YAML files. - Consider setting
ota: falseand managing OTA exclusively through the Home Assistant ESPHome add-on if you don’t need browser-based updates. - The
enable_private_network_accessflag (on by default) helps browsers enforce the Private Network Access specification, adding an extra layer of origin checks when accessing the device from web pages.
See Also
- REST API Reference
- Server-Sent Events API
- Web Server OTA Platform
- Prometheus Component
- Captive Portal Component