Date/Time

The Date/Time integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more] is built for the controlling and monitoring of timestamps on devices.

Note

构建模块集成

这个 date/time 是一个构建模块集成,无法直接添加到你的 Home Assistant 中,但可以被其他集成使用和提供。

构建模块集成不同于典型的与设备或服务连接的集成。相反,其他将设备或服务集成到 Home Assistant 中的集成使用这个 date/time 构建模块来提供实体、服务和其他你可以在自动化或仪表板中使用的功能。

如果你的某个集成具有这个构建模块,这个页面记录了 date/time 构建模块所提供的功能。

If you are looking for a way to create a Date/Time entity, please take a look at the Date/Time helper.

The state of a date/time entity

The state of a date/time entity is the actual date and time value.

Screenshot showing the state of a date/time entity in the developer tools Screenshot showing the state of a date/time entity in the developer tools. In the example shown, the state is January 1, 2020 at 12:00 in the format YYYY-MM-DD T HH:MM:SS.

In addition, the entity can have the following states:

  • Unavailable: The entity is currently unavailable.
  • Unknown: The state is not yet known.

Actions

datetime actions

Available actions动作在 Home Assistant 的多个地方使用。作为脚本或自动化的一部分,动作定义了触发器被激活后将发生的事情。在脚本中,动作被称为序列 [Learn more]: datetime.set_value

Action datetime.set_value

Set a new value for the datetime entity实体表示 Home Assistant 中的传感器、执行器或功能。实体用于监控物理属性或控制其他实体。实体通常是设备或服务的一部分。 [Learn more].

Data attribute Optional Description
entity_id no String or list of strings that point at entity_id’s of datetimes to control.
datetime no New datetime value to set. If timezone is not included, the Home Assistant instance’s timezone will be used.