Skip to content

Commit 3327997

Browse files
committed
Add interval docs
1 parent d6b9026 commit 3327997

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

esphomeyaml/guides/automations.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ All Triggers
317317
- :ref:`binary_sensor.on_click <binary_sensor-on_click>` / :ref:`binary_sensor.on_double_click <binary_sensor-on_double_click>` / :ref:`binary_sensor.on_multi_click <binary_sensor-on_multi_click>`
318318
- :ref:`esphomeyaml.on_boot <esphomeyaml-on_boot>` / :ref:`esphomeyaml.on_shutdown <esphomeyaml-on_shutdown>` / :ref:`esphomeyaml.on_loop <esphomeyaml-on_loop>`
319319
- :ref:`pn532.on_tag <pn532-on_tag>`
320+
- :ref:`time.on_time <time-on_time>`
321+
- :ref:`interval.interval <interval>`
320322

321323
All Actions
322324
-----------
@@ -555,6 +557,29 @@ Please note this is only useful right now if your script contains a ``delay`` ac
555557
then:
556558
- script.stop: my_script
557559
560+
.. _interval:
561+
562+
``interval``
563+
------------
564+
565+
This component allows you to run actions periodically with a fixed interval.
566+
For example if you want to toggle a switch every minute, you can use this component.
567+
Please note that this certain cases are also possible with the :ref:`time.on_time <time-on_time>`
568+
trigger, but this one is more light-weight and user-friendly.
569+
570+
.. code-block:: yaml
571+
572+
# Example configuration entry
573+
interval:
574+
- interval: 1min
575+
then:
576+
- switch.toggle: relay_1
577+
578+
Configuration options:
579+
580+
- **interval** (**Required**, :ref:`config-time`): The interval to execute the action with.
581+
- **then** (**Required**, :ref:`config-action`): The action to perform.
582+
558583
See Also
559584
--------
560585

0 commit comments

Comments
 (0)