pdf-icon

Unit DLight 传感器 Home Assistant 集成

本章节介绍将 Unit DLight 数字环境光检测传感器集成至 Home Assistant 的配置方法与实操步骤。

注意事项

Unit DLight 是单独的传感器平台,需要额外的主控设备(如 Atom 系列、Stamp 系列, Stick 系列,Core/Basic 系列等)才能集成至 Home Assistant。

准备工作

  1. 查阅 BH1750FVI 传感器数据手册:BH1750FVI 数据手册
  2. 参考 ESPHome 官方最新配置说明:ESPHome BH1750 配置
  3. 准备兼容的主控设备(如 Atom 系列、Stamp 系列、Stick 系列、Core/Basic 系列等)。
  4. 确认主控设备的 I2C 引脚定义(不同主控引脚不同)。

配置传感器

  1. 需要在 ESPHome 配置中启用 I²C 组件:
# Example configuration entry for ESP32
i2c:
  sda: GPIOXX
  scl: GPIOXX
  scan: true

这里的 GPIO 引脚会因为使用的主控设备不一而不同。比如使用 Atom Lite 作为主控:

# I2C Bus on Grove Port (HY2.0-4P)
i2c:
  sda: GPIO26
  scl: GPIO32

以下是sensor配置范例:

yaml
1 2 3 4 5
sensor:
  - platform: bh1750
    name: "Unit DLight Illuminance"
    address: 0x23
    update_interval: 60s

Dashboard 示例

完成添加至 Home Assistant 后:

相关视频

On This Page