This tutorial will introduce how to integrate the Unit ToF high-precision laser ranging sensor into Home Assistant to achieve non-contact distance monitoring.

The I²C component needs to be enabled in the ESPHome configuration:
# Example configuration entry for ESP32
i2c:
sda: GPIOXX
scl: GPIOXX
scan: true The GPIO pins here will vary depending on the main controller used. For example, using Atom Lite as the main controller:
# I2C Bus on Grove Port (HY2.0-4P)
i2c:
sda: GPIO26
scl: GPIO32 Unit ToF configuration example:
sensor:
- platform: vl53l0x
name: "VL53L0x Distance"
address: 0x29
update_interval: 60s
long_range: trueAfter saving the configuration file, compiling, and uploading the firmware, the device can be added to the Home Assistant integration.