diff --git a/components/time.rst b/components/time.rst index f3999055b..643ebfe4a 100644 --- a/components/time.rst +++ b/components/time.rst @@ -334,6 +334,21 @@ In the ``seconds:``, ``minutes:``, ... fields you can use the following operator then: - switch.toggle: my_switch +.. _time-has_time_condition: + +``time.has_time`` Condition +---------------------------- + +This :ref:`Condition ` checks if time has been set and is valid. + +.. code-block:: yaml + + on_...: + if: + condition: + time.has_time: + then: + - logger.log: Time has been set and is valid! See Also -------- diff --git a/guides/automations.rst b/guides/automations.rst index ae3b4cc84..754debf3f 100644 --- a/guides/automations.rst +++ b/guides/automations.rst @@ -387,6 +387,7 @@ All Conditions - :ref:`sensor.in_range ` - :ref:`wifi.connected ` / :ref:`api.connected ` / :ref:`mqtt.connected ` +- :ref:`time.has_time ` - :ref:`script.is_running ` - :ref:`sun.is_above_horizon / sun.is_below_horizon ` - :ref:`text_sensor.state `