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.
sensor domain is the backbone of physical measurement: it reads numeric values from hardware — temperature, humidity, pressure, CO₂, distance, power, and hundreds more — then publishes those values to Home Assistant (or MQTT) in real time. Every sensor platform shares a common base configuration that handles naming, units, filtering, and automation triggers, so once you understand the base, you understand every sensor in ESPHome.
Base Sensor Configuration
All sensors inherit these configuration variables. You only need to supply the ones you want to override — sensible defaults are chosen automatically.Manually specify the ID used for code generation. At least one of
id and name must be specified.The name for the sensor as it appears in Home Assistant. Set to
None to inherit the device’s friendly_name.Manually set the unit of measurement advertised to Home Assistant (e.g.
"°C", "hPa", "W"). Does not perform unit conversion.The Home Assistant device class for the sensor (e.g.
temperature, humidity, power). Set to "" to remove a default device class.The Home Assistant state class (
measurement, total, total_increasing). Set to "" to remove the default.Manually override the MDI icon shown in the Home Assistant frontend (e.g.
"mdi:thermometer").Number of digits after the decimal point reported to Home Assistant. Controls display precision; does not change the raw value.
A list of sensor filters applied in sequence before the value is published.
If
true, the sensor will not be exposed to the frontend. Setting only an id without a name implicitly sets this to true. Defaults to false.If
true, Home Assistant creates a state-changed event even when the value stays the same. Useful for Grafana but increases database size. Defaults to false.If
true, the entity is added to Home Assistant but hidden until the user manually enables it. Defaults to false.The entity category (
config, diagnostic). Set to "" to remove the default.MQTT only. Time after which the sensor value is marked as expired/unknown if no new update is received.
Automation Triggers
Triggered each time a new filtered value is published. The value is available as
x.Triggered when the published value transitions from outside to inside a defined range (
above/below).Triggered when a raw value is received, before any filters are applied. The raw value is available as
x.Sensor Filters
Filters let you pre-process sensor values before they are published. Define them in afilters: block; they are applied in order.
Converting Celsius to Fahrenheit
Sensor Automations
on_value
Fired after filters pass a new value. Use x for the value.
on_value_range
Fired when the value crosses into a defined range. Ideal for threshold-based automation.
sensor.in_range Condition
Lambda Calls
Popular Sensor Platforms
DHT Temperature & Humidity
Classic DHT11/DHT22 sensors on a single GPIO pin. Simple, low-cost, and widely available.
BME280 / BME680
Bosch I²C sensors delivering temperature, humidity, pressure — and air quality on the 680.
AHT10 / AHT20
High-accuracy I²C temperature and humidity sensors popular in many IoT boards.
Dallas DS18B20
One-Wire temperature probe. Supports multiple sensors on a single pin with unique addresses.
ADC (Analog to Digital)
Read raw voltages on ADC-capable GPIO pins. Useful for resistive sensors and voltage dividers.
Pulse Counter
Count pulses on a GPIO — ideal for water meters, gas meters, and power meters with S0 output.
INA219 / INA3221
I²C current/power monitor IC. Measure voltage, current, and power on DC circuits up to 26 V.
VL53L0X / VL53L1X
Time-of-flight distance sensors that measure range from 1 cm to 4 m over I²C.
ESPHome supports 200+ sensor platforms. For the full list, visit the ESPHome sensor component documentation.