跳转到内容

Dallas 温度传感器

dallas_temp 组件允许您使用 DS18B20 (数据手册) 和类似的 1-Wire 温度传感器。需要在配置中设置 1-Wire 总线 才能使此传感器工作。

# 示例配置条目
sensor:
# 只有一个设备
- platform: dallas_temp
name: 温度
update_interval: 120s
# 特定地址
- platform: dallas_temp
address: 0x1234567812345628
name: 温度2
# 第二个设备
- platform: dallas_temp
index: 1
name: 温度1
  • address (可选, 整数): 传感器的地址。如果总线上有多个设备且未指定索引,则为必需。

  • index (可选, 字节): 传感器的索引(从 0 开始)。如果总线上有多个设备且未指定地址,则为必需。 请注意,此索引基于传感器的硬件地址,如果更改、添加或删除传感器,顺序可能会改变。

  • resolution (可选, 整数): 可选的分辨率,从 9 到 12。数值越高意味着越精确。 默认为大多数 Dallas 温度传感器的最大值:12。

  • update_interval (可选, 时间): 检查传感器的时间间隔。 默认为 60 秒。

  • one_wire_id (可选, One Wire): 要使用的 1-Wire 总线的 ID。 如果有多个总线,则为必需。

  • 传感器的所有其他选项。