ESPHome uses a consistent set of configuration variable types across all its components. Understanding these types helps you read component documentation, avoid common errors, and write correct YAML configurations the first time. This page documents every built-in type you will encounter in the ESPHome reference.Documentation 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.
ID
IDs are the primary way ESPHome connects components defined in different parts of your configuration. For example, you define alight component with an id, then reference that same ID in an automation or script to control it at runtime.
Naming rules — IDs are converted into C++ variable names, so they must follow C++ identifier conventions:
- Must start with a letter and can end with numbers
- Must not have a space in the name
- Cannot have special characters except the underscore (
_) - Must not be a C++ reserved keyword (e.g.,
int,class,return) - Must be unique within the configuration file
ESPHome IDs are internal to the firmware and are not the same as Home Assistant entity IDs. Renaming an ESPHome ID does not affect how the entity appears in Home Assistant.
Pin
ESPHome always uses the chip’s internal GPIO numbers. These are integers that can optionally be prefixed withGPIO.
D0 through D8 that map to internal GPIO numbers. Either form is accepted in configuration:
esphome: or esp8266: / esp32: section. Refer to the specific board’s datasheet or the ESPHome board definitions for the full mapping.
Pin Schema
When a component needs more control over a pin beyond just its number, it accepts a pin schema — an expanded mapping that configures direction, pull resistors, inversion, and other electrical characteristics.Configuration Variables
number (Required, Pin)
The GPIO number of the pin, in any form accepted by the Pin type.
inverted (Optional, boolean, default: false)
When true, all read and write values are logically inverted. Useful when a circuit is wired active-low.
mode (Optional, string or mapping)
Configures the pin’s electrical direction and internal resistors. Accepts either a shorthand string or an explicit mapping.
Shorthand strings:
| String | Equivalent mapping |
|---|---|
INPUT | input: true |
OUTPUT | output: true |
OUTPUT_OPEN_DRAIN | output: true, open_drain: true |
INPUT_PULLUP | input: true, pullup: true |
INPUT_PULLDOWN | input: true, pulldown: true |
ANALOG | (platform-specific analog mode) |
INPUT_OUTPUT_OPEN_DRAIN | input: true, output: true, open_drain: true |
input— Configure the pin as a digital input.output— Configure the pin as a digital output.pullup— Enable the internal pull-up resistor.pulldown— Enable the internal pull-down resistor.open_drain— Use open-drain drive mode instead of push-pull.
allow_other_uses (Optional, boolean, default: false)
By default, ESPHome raises an error if the same pin number appears in multiple component configurations. Set to true to suppress that error in the rare cases where a pin is intentionally shared between components.
ignore_strapping_warning (Optional, boolean, default: false)
Certain ESP32 pins are strapping pins sampled at boot to configure initial chip state (e.g., boot mode selection). ESPHome warns when you configure I/O on these pins. If you have verified that your specific circuit will not cause boot issues, set this to true to suppress the warning.
drive_strength (Optional, string, default: 20mA)
(ESP32 with ESP-IDF framework only)
Sets the maximum current the pad can source or sink. Options: 5mA, 10mA, 20mA, 40mA.
ignore_pin_validation_error (Optional, boolean, default: false)
Some GPIO numbers are reserved for internal ESP32 functions (e.g., flash memory on GPIO 6–11). ESPHome raises an error if you try to use them. If your specific board routes these pins differently and you have confirmed they are safe to use, set this to true.
Time
Time values are used throughout ESPHome forupdate_interval, debounce durations, automation delays, and more. Several formats are supported:
update_interval specifically, two special values are also accepted: