跳转到内容

Home Assistant 时间源

在 ESPHome 中获取时间的首选方式是使用 Home Assistant。 使用 homeassistant 时间平台,到 Home Assistant 的 native API 连接将用于定期同步当前时间。

NOTE

虽然你可能不计划从节点导出状态,也不需要 Home Assistant 中该节点的实体, 此组件仍然要求你将节点注册到 Home Assistant 下。请参见: 将设备连接到 Home Assistant。

# 配置示例
time:
- platform: homeassistant
id: homeassistant_time

如果此组件未配置 timezone,则初始时区将从构建主机推断,但 在运行时,时区将在时间同步时从 Home Assistant 更新。 显式配置的时区将阻止时区从 Home Assistant 更新。