mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-26 17:27:47 +01:00
commit
171c38c103
2
Doxygen
2
Doxygen
@ -38,7 +38,7 @@ PROJECT_NAME = "ESPHome"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.16.0b4
|
||||
PROJECT_NUMBER = 1.16.0b5
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
||||
ESPHOME_PATH = ../esphome
|
||||
ESPHOME_REF = v1.16.0b4
|
||||
ESPHOME_REF = v1.16.0b5
|
||||
|
||||
.PHONY: html html-strict cleanhtml deploy help webserver Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png
|
||||
|
||||
|
@ -1 +1 @@
|
||||
1.16.0b4
|
||||
1.16.0b5
|
@ -258,3 +258,14 @@ All changes
|
||||
- docs: Add docs for pn532 NDEF functionality :docspr:`936` by :ghuser:`jesserockz`
|
||||
- esphome: Inkplate 6 support for ESPHome :esphomepr:`1283` by :ghuser:`davidzovko` (new-integration)
|
||||
- docs: Adding Inkplate 6 docs :docspr:`778` by :ghuser:`nitko12`
|
||||
- esphome: time sync notification :esphomepr:`1442` by :ghuser:`badbadc0ffee`
|
||||
- docs: update time (sync) documentation :docspr:`924` by :ghuser:`badbadc0ffee`
|
||||
- esphome: rename read/write to read/time/write_time :esphomepr:`1468` by :ghuser:`badbadc0ffee`
|
||||
- docs: Add directions for handling text strings :docspr:`955` by :ghuser:`poldim`
|
||||
- esphome: Improve ccs811 precision :esphomepr:`1428` by :ghuser:`TheNetAdmin`
|
||||
- esphome: make fade_to*, lighten, and darken const :esphomepr:`1450` by :ghuser:`toelke`
|
||||
- docs: fix typo 5062 => 6052 :docspr:`956` by :ghuser:`Scarbous`
|
||||
- docs: Fix of typo in documentation of SPS30 :docspr:`954` by :ghuser:`teffcz`
|
||||
- docs: Remove reference to measuring humidity :docspr:`953` by :ghuser:`tomlut`
|
||||
- docs: Fix human-readable uptime example so it compiles :docspr:`949` by :ghuser:`oddsockmachine`
|
||||
- esphome: SPI wasnt being disabled after display update :esphomepr:`1493` by :ghuser:`SenexCrenshaw`
|
||||
|
@ -277,7 +277,16 @@ arguments after the format string in the right order.
|
||||
// %% - literal % sign
|
||||
it.printf(0, 0, id(my_font), "Temperature: %.1f°C, Humidity: %.1f%%", id(temperature).state, id(humidity).state);
|
||||
|
||||
To display a text string from a ``text_sensor``, append ``.c_str()`` to the end of your variable.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
display:
|
||||
- platform: ...
|
||||
# ...
|
||||
lambda: |-
|
||||
it.printf(0, 0, id(my_font), "Text to follow: %s", id(template_text).state.c_str());
|
||||
|
||||
The last printf tip for use in displays I will discuss here is how to display binary sensor values. You
|
||||
*could* of course just check the state with an ``if`` statement as the first few lines in the example below, but if
|
||||
you want to be efficient you can use an *inline if* too. With the ``%s`` print specifier you can tell it to
|
||||
|
@ -118,7 +118,7 @@ Wiring:
|
||||
-------
|
||||
|
||||
The sensor has a 5 pin JST ZHR type connector, with a 1.5mm pitch. (`Matching connector housing <https://octopart.com/zhr-5-jst-279203>`__, `datasheet <http://www.farnell.com/datasheets/1393424.pdf>`__)
|
||||
To force the force the sensor into I²C mode, the SEL pin (Interface Select pin no.5) should be shorted to ground (pin no.4)
|
||||
To force the sensor into I²C mode, the SEL pin (Interface Select pin no.5) should be shorted to ground (pin no.4)
|
||||
|
||||
.. figure:: images/sps30-wiring.png
|
||||
:align: center
|
||||
|
@ -6,7 +6,7 @@ TMP117 Temperature Sensor
|
||||
:image: tmp117.jpg
|
||||
:keywords: TMP117
|
||||
|
||||
The TMP117 Temperature+Humidity sensor allows you to use your TMP117
|
||||
The TMP117 Temperature sensor allows you to use your TMP117
|
||||
(`datasheet <https://www.ti.com/lit/ds/symlink/tmp117.pdf>`__,
|
||||
`sparkfun <https://www.sparkfun.com/products/15805>`__)
|
||||
sensors with ESPHome.
|
||||
|
@ -58,7 +58,7 @@ with human readable output.
|
||||
return (
|
||||
(days ? String(days) + "d " : "") +
|
||||
(hours ? String(hours) + "h " : "") +
|
||||
(minutes ? String(minutes + "m " : "") +
|
||||
(minutes ? String(minutes) + "m " : "") +
|
||||
(String(seconds) + "s")
|
||||
).c_str();
|
||||
|
||||
|
@ -10,7 +10,192 @@ Time
|
||||
|
||||
The ``time`` component allows you to set up real time clock time sources for ESPHome.
|
||||
You can then get the current time in :ref:`lambdas <config-lambda>`.
|
||||
Currently only SNTP (internet-based), Home Assistant and GPS time sources are supported.
|
||||
|
||||
.. _base_time_config:
|
||||
|
||||
Base Time Configuration
|
||||
-----------------------
|
||||
|
||||
All time configuration schemas inherit these options.
|
||||
|
||||
Configuration variables:
|
||||
************************
|
||||
|
||||
- **id** (*Optional*, :ref:`config-id`): Specify the ID of the time for use in lambdas.
|
||||
- **timezone** (*Optional*, string): Manually tell ESPHome what time zone to use with `this format
|
||||
<https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html>`__ (warning: the format is quite complicated)
|
||||
or the simpler `TZ database name <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`__ in the form
|
||||
<Region>/<City>. ESPHome tries to automatically infer the time zone string based on the time zone of the computer
|
||||
that is running ESPHome, but this might not always be accurate.
|
||||
- **on_time** (*Optional*, :ref:`Automation <automation>`): Automation to run at specific intervals using
|
||||
a cron-like syntax. See :ref:`time-on_time`.
|
||||
- **on_time_sync** (*Optional*, :ref:`Automation <automation>`): Automation to run when the time source
|
||||
could be (re-)synchronized.. See :ref:`time-on_time_sync`.
|
||||
|
||||
.. _time-has_time_condition:
|
||||
|
||||
``time.has_time`` Condition
|
||||
***************************
|
||||
|
||||
This :ref:`Condition <config-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!
|
||||
|
||||
.. _time-on_time:
|
||||
|
||||
``on_time`` Trigger
|
||||
*******************
|
||||
|
||||
This powerful automation can be used to run automations at specific intervals at
|
||||
specific times of day. The syntax is a subset of the `crontab <https://crontab.guru/>`__ syntax.
|
||||
|
||||
There are two ways to specify time intervals: Either with using the ``seconds:``, ``minutes:``, ...
|
||||
keys as seen below or using a cron expression like ``* /5 * * * *``.
|
||||
|
||||
Basically, the automation engine looks at your configured time schedule every second and
|
||||
evaluates if the automation should run.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
# ...
|
||||
on_time:
|
||||
# Every 5 minutes
|
||||
- seconds: 0
|
||||
minutes: /5
|
||||
then:
|
||||
- switch.toggle: my_switch
|
||||
|
||||
# Every morning on weekdays
|
||||
- seconds: 0
|
||||
minutes: 30
|
||||
hours: 7
|
||||
days_of_week: MON-FRI
|
||||
then:
|
||||
- light.turn_on: my_light
|
||||
|
||||
# Cron syntax, trigger every 5 minutes
|
||||
- cron: '* /5 * * * *'
|
||||
then:
|
||||
- switch.toggle: my_switch
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **seconds** (*Optional*, string): Specify for which seconds of the minute the automation will trigger.
|
||||
Defaults to ``*`` (all seconds). Range is from 0 to 59.
|
||||
- **minutes** (*Optional*, string): Specify for which minutes of the hour the automation will trigger.
|
||||
Defaults to ``*`` (all minutes). Range is from 0 to 59.
|
||||
- **hours** (*Optional*, string): Specify for which hours of the day the automation will trigger.
|
||||
Defaults to ``*`` (all hours). Range is from 0 to 23.
|
||||
- **days_of_month** (*Optional*, string): Specify for which days of the month the automation will trigger.
|
||||
Defaults to ``*`` (all days). Range is from 1 to 31.
|
||||
- **months** (*Optional*, string): Specify for which months of the year to trigger.
|
||||
Defaults to ``*`` (all months). The month names JAN to DEC are automatically substituted.
|
||||
Range is from 1 (January) to 12 (December).
|
||||
- **days_of_week** (*Optional*, string): Specify for which days of the week to trigger.
|
||||
Defaults to ``*`` (all days). The names SUN to SAT are automatically substituted.
|
||||
Range is from 1 (Sunday) to 7 (Saturday).
|
||||
- **cron** (*Optional*, string): Alternatively, you can specify a whole cron expression like
|
||||
``* /5 * * * *``. Please note years and some special characters like ``L``, ``#`` are currently not supported.
|
||||
|
||||
- See :ref:`Automation <automation>`.
|
||||
|
||||
In the ``seconds:``, ``minutes:``, ... fields you can use the following operators:
|
||||
|
||||
- .. code-block:: yaml
|
||||
|
||||
seconds: 0
|
||||
|
||||
An integer like ``0`` or ``30`` will make the automation only trigger if the current
|
||||
second is **exactly** 0 or 30, respectively.
|
||||
- .. code-block:: yaml
|
||||
|
||||
seconds: 0,30,45
|
||||
|
||||
You can combine multiple expressions with the ``,`` operator. This operator makes it so that
|
||||
if either one of the expressions separated by a comma holds true, the automation will trigger.
|
||||
For example ``0,30,45`` will trigger if the current second is either ``0`` or ``30`` or ``45``.
|
||||
- .. code-block:: yaml
|
||||
|
||||
days_of_week: 2-6
|
||||
# same as
|
||||
days_of_week: MON-FRI
|
||||
# same as
|
||||
days_of_week: 2,3,4,5,6
|
||||
# same as
|
||||
days_of_week: MON,TUE,WED,THU,FRI
|
||||
|
||||
The ``-`` (hyphen) operator can be used to create a range of values and is shorthand for listing all
|
||||
values with the ``,`` operator.
|
||||
- .. code-block:: yaml
|
||||
|
||||
# every 5 minutes
|
||||
seconds: 0
|
||||
minutes: /5
|
||||
|
||||
# every timestamp where the minute is 5,15,25,...
|
||||
seconds: 0
|
||||
minutes: 5/10
|
||||
|
||||
The ``/`` operator can be used to create a step value. For example ``/5`` for ``minutes:`` makes an
|
||||
automation trigger only when the minute of the hour is 0, or 5, 10, 15, ... The value in front of the
|
||||
``/`` specifies the offset with which the step is applied.
|
||||
|
||||
- .. code-block:: yaml
|
||||
|
||||
# Every minute
|
||||
seconds: 0
|
||||
minutes: '*'
|
||||
|
||||
Lastly, the ``*`` operator matches every number. In the example above, ``*`` could for example be substituted
|
||||
with ``0-59``.
|
||||
|
||||
.. warning::
|
||||
|
||||
Please note the following automation would trigger for each second in the minutes 0,5,10,15 and not
|
||||
once per 5 minutes as the seconds variable is not set:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
# ...
|
||||
on_time:
|
||||
- minutes: /5
|
||||
then:
|
||||
- switch.toggle: my_switch
|
||||
|
||||
.. _time-on_time_sync:
|
||||
|
||||
``on_time_sync`` Trigger
|
||||
************************
|
||||
|
||||
This automation is triggered after a time source successfully retrieves the current time.
|
||||
See the :ref:`DS1307 configuration example <ds1307-config_example>` for a scenario
|
||||
where a network time synchronization from a home assistant server trigger a write
|
||||
to an external hardware real time clock chip.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
on_time_sync:
|
||||
then:
|
||||
- logger.log: "Synchronized system clock"
|
||||
|
||||
.. note::
|
||||
|
||||
Components should trigger ``on_time_sync`` when they update the system clock. However, not all real time components
|
||||
behave exactly the same. Components could e.g. decide to trigger only when a significant time change has been
|
||||
observed, others could trigger whenever their time sync mechanism runs - even if that didn't effectively change
|
||||
the system time. Some (such as SNTP) could even trigger when another real time component is responsible for the
|
||||
change in time.
|
||||
|
||||
Home Assistant Time Source
|
||||
--------------------------
|
||||
@ -28,14 +213,7 @@ to Home Assistant will be used to periodically synchronize the current time.
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **id** (*Optional*, :ref:`config-id`): Specify the ID of the time for use in lambdas.
|
||||
- **timezone** (*Optional*, string): Manually tell ESPHome what time zone to use with `this format
|
||||
<https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html>`__ (warning: the format is quite complicated)
|
||||
or the simpler `TZ database name <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`__ in the form
|
||||
<Region>/<City>. ESPHome tries to automatically infer the time zone string based on the time zone of the computer
|
||||
that is running ESPHome, but this might not always be accurate.
|
||||
- **on_time** (*Optional*, :ref:`Automation <automation>`): Automation to run at specific intervals using
|
||||
a cron-like syntax. See :ref:`time-on_time`.
|
||||
- All other from :ref:`base_time_config`.
|
||||
|
||||
SNTP Configuration
|
||||
------------------
|
||||
@ -49,22 +227,21 @@ SNTP Configuration
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **id** (*Optional*, :ref:`config-id`): Specify the ID of the time for use in lambdas.
|
||||
- **timezone** (*Optional*, string): Manually tell ESPHome what time zone to use with `this format
|
||||
<https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html>`__ (warning: the
|
||||
format is quite complicated) or the simpler `TZ database name <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`__
|
||||
in the form <Region>/<City>.
|
||||
ESPHome tries to automatically infer the time zone string based on the time zone of the computer that is running
|
||||
ESPHome, but this might not always be accurate.
|
||||
- **servers** (*Optional*, list of strings): Choose up to 3 NTP servers that are used for the clock source.
|
||||
Defaults to ``0.pool.ntp.org``, ``1.pool.ntp.org`` and ``2.pool.ntp.org``
|
||||
- **on_time** (*Optional*, :ref:`Automation <automation>`): Automation to run at specific intervals using
|
||||
a cron-like syntax. See :ref:`time-on_time`.
|
||||
- All other options from :ref:`base_time_config`.
|
||||
|
||||
.. note::
|
||||
|
||||
If your are using :ref:`wifi-manual_ip` make sure to configure a DNS Server (dns1, dns2) or use only IP addresses for the NTP servers.
|
||||
|
||||
.. warning::
|
||||
|
||||
Due to limitations of the SNTP implementation, this component will trigger ``on_time_sync`` only once when it detects that the
|
||||
system clock has been set, even if the update was not done by the SNTP implementation!
|
||||
This must be taken into consideration when SNTP is used together with other real time componnents, where another time source could
|
||||
update the time before SNTP synchronizes.
|
||||
|
||||
GPS Time Source
|
||||
---------------
|
||||
|
||||
@ -79,14 +256,7 @@ You first need to set up the :doc:`GPS </components/gps>` component.
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **id** (*Optional*, :ref:`config-id`): Specify the ID of the time for use in lambdas.
|
||||
- **timezone** (*Optional*, string): Manually tell ESPHome what time zone to use with `this format
|
||||
<https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html>`__ (warning: the format is quite complicated)
|
||||
or the simpler `TZ database name <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`__ in the form
|
||||
<Region>/<City>. ESPHome tries to automatically infer the time zone string based on the time zone of the computer
|
||||
that is running ESPHome, but this might not always be accurate.
|
||||
- **on_time** (*Optional*, :ref:`Automation <automation>`): Automation to run at specific intervals using
|
||||
a cron-like syntax. See :ref:`time-on_time`.
|
||||
- All other from :ref:`base_time_config`.
|
||||
|
||||
DS1307 Time Source
|
||||
------------------
|
||||
@ -102,46 +272,33 @@ You first need to set up the :doc:`I2C </components/i2c>` component.
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **id** (*Optional*, :ref:`config-id`): Specify the ID of the time for use in lambdas.
|
||||
- **address** (*Optional*, int): Manually specify the I²C address of the RTC. Defaults to ``0x68``.
|
||||
- **timezone** (*Optional*, string): Manually tell ESPHome what time zone to use with `this format
|
||||
<https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html>`__ (warning: the format is quite complicated)
|
||||
or the simpler `TZ database name <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`__ in the form
|
||||
<Region>/<City>. ESPHome tries to automatically infer the time zone string based on the time zone of the computer
|
||||
that is running ESPHome, but this might not always be accurate.
|
||||
- **on_time** (*Optional*, :ref:`Automation <automation>`): Automation to run at specific intervals using
|
||||
a cron-like syntax. See :ref:`time-on_time`.
|
||||
- All other options from :ref:`base_time_config`.
|
||||
|
||||
DS1307 Actions
|
||||
--------------
|
||||
.. _ds1307-write_time_action:
|
||||
|
||||
The DS1307 component supports :ref:`actions <config-action>` that can be used to synchronize the RTC hardware and
|
||||
the system clock.
|
||||
|
||||
.. _ds1307-write_action:
|
||||
|
||||
``ds1307.write`` Action
|
||||
***********************
|
||||
``ds1307.write_time`` Action
|
||||
****************************
|
||||
|
||||
This :ref:`Action <config-action>` triggers a synchronization of the current system time to the RTC hardware.
|
||||
|
||||
.. note::
|
||||
|
||||
The DS1307 component will *not* write the RTC clock if not triggered *explicitely* by this action.
|
||||
The DS1307 component will *not* write the RTC clock if not triggered *explicitly* by this action.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
on_...:
|
||||
- ds1307.write
|
||||
- ds1307.write_time
|
||||
|
||||
# in case you need to specify the DS1307 id
|
||||
- ds1307.write:
|
||||
- ds1307.write_time:
|
||||
id: ds1307_time
|
||||
|
||||
.. _ds1307-read_action:
|
||||
.. _ds1307-read_time_action:
|
||||
|
||||
``ds1307.read`` Action
|
||||
**********************
|
||||
``ds1307.read_time`` Action
|
||||
***************************
|
||||
|
||||
This :ref:`Action <config-action>` triggers a synchronization of the current system time from the RTC hardware.
|
||||
|
||||
@ -154,12 +311,43 @@ This :ref:`Action <config-action>` triggers a synchronization of the current sys
|
||||
.. code-block:: yaml
|
||||
|
||||
on_...:
|
||||
- ds1307.read
|
||||
- ds1307.read_time
|
||||
|
||||
# in case you need to specify the DS1307 id
|
||||
- ds1307.read:
|
||||
- ds1307.read_time:
|
||||
id: ds1307_time
|
||||
|
||||
.. _ds1307-config_example:
|
||||
|
||||
Configuration Example
|
||||
*********************
|
||||
|
||||
In a typical setup, you will have at least one additional time source to synchronize the RTC with. Such an
|
||||
external time source might not always be available e.g. due to a limited network connection.
|
||||
In order to have a valid, reliable system time, the system should read the RTC once at start and then try to
|
||||
synchronize with an external reliable time source.
|
||||
When a synchronization to another time source was successfull, the RTC can be resynchronized.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
esphome:
|
||||
on_boot:
|
||||
then:
|
||||
# read the RTC time once when the system boots
|
||||
ds1307.read_time:
|
||||
|
||||
time:
|
||||
- platform: ds1307
|
||||
# repeated synchronization is not necessary unless the external RTC
|
||||
# is much more accurate than the internal clock
|
||||
update_interval: never
|
||||
- platform: homeassistant
|
||||
# instead try to synchronize via network repeatedly ...
|
||||
on_time_sync:
|
||||
then:
|
||||
# ... and update the RTC when the synchronization was successful
|
||||
ds1307.write_time:
|
||||
|
||||
Use In Lambdas
|
||||
--------------
|
||||
|
||||
@ -280,148 +468,6 @@ with the current time representation of that format option.
|
||||
``%%`` A literal ``%`` character %
|
||||
============= ============================================================== =========================
|
||||
|
||||
.. _time-on_time:
|
||||
|
||||
``on_time``
|
||||
-----------
|
||||
|
||||
This powerful automation can be used to run automations at specific intervals at
|
||||
specific times of day. The syntax is a subset of the `crontab <https://crontab.guru/>`__ syntax.
|
||||
|
||||
There are two ways to specify time intervals: Either with using the ``seconds:``, ``minutes:``, ...
|
||||
keys as seen below or using a cron expression like ``* /5 * * * *``.
|
||||
|
||||
Basically, the automation engine looks at your configured time schedule every second and
|
||||
evaluates if the automation should run.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
# ...
|
||||
on_time:
|
||||
# Every 5 minutes
|
||||
- seconds: 0
|
||||
minutes: /5
|
||||
then:
|
||||
- switch.toggle: my_switch
|
||||
|
||||
# Every morning on weekdays
|
||||
- seconds: 0
|
||||
minutes: 30
|
||||
hours: 7
|
||||
days_of_week: MON-FRI
|
||||
then:
|
||||
- light.turn_on: my_light
|
||||
|
||||
# Cron syntax, trigger every 5 minutes
|
||||
- cron: '* /5 * * * *'
|
||||
then:
|
||||
- switch.toggle: my_switch
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **seconds** (*Optional*, string): Specify for which seconds of the minute the automation will trigger.
|
||||
Defaults to ``*`` (all seconds). Range is from 0 to 59.
|
||||
- **minutes** (*Optional*, string): Specify for which minutes of the hour the automation will trigger.
|
||||
Defaults to ``*`` (all minutes). Range is from 0 to 59.
|
||||
- **hours** (*Optional*, string): Specify for which hours of the day the automation will trigger.
|
||||
Defaults to ``*`` (all hours). Range is from 0 to 23.
|
||||
- **days_of_month** (*Optional*, string): Specify for which days of the month the automation will trigger.
|
||||
Defaults to ``*`` (all days). Range is from 1 to 31.
|
||||
- **months** (*Optional*, string): Specify for which months of the year to trigger.
|
||||
Defaults to ``*`` (all months). The month names JAN to DEC are automatically substituted.
|
||||
Range is from 1 (January) to 12 (December).
|
||||
- **days_of_week** (*Optional*, string): Specify for which days of the week to trigger.
|
||||
Defaults to ``*`` (all days). The names SUN to SAT are automatically substituted.
|
||||
Range is from 1 (Sunday) to 7 (Saturday).
|
||||
- **cron** (*Optional*, string): Alternatively, you can specify a whole cron expression like
|
||||
``* /5 * * * *``. Please note years and some special characters like ``L``, ``#`` are currently not supported.
|
||||
|
||||
- See :ref:`Automation <automation>`.
|
||||
|
||||
In the ``seconds:``, ``minutes:``, ... fields you can use the following operators:
|
||||
|
||||
- .. code-block:: yaml
|
||||
|
||||
seconds: 0
|
||||
|
||||
An integer like ``0`` or ``30`` will make the automation only trigger if the current
|
||||
second is **exactly** 0 or 30, respectively.
|
||||
- .. code-block:: yaml
|
||||
|
||||
seconds: 0,30,45
|
||||
|
||||
You can combine multiple expressions with the ``,`` operator. This operator makes it so that
|
||||
if either one of the expressions separated by a comma holds true, the automation will trigger.
|
||||
For example ``0,30,45`` will trigger if the current second is either ``0`` or ``30`` or ``45``.
|
||||
- .. code-block:: yaml
|
||||
|
||||
days_of_week: 2-6
|
||||
# same as
|
||||
days_of_week: MON-FRI
|
||||
# same as
|
||||
days_of_week: 2,3,4,5,6
|
||||
# same as
|
||||
days_of_week: MON,TUE,WED,THU,FRI
|
||||
|
||||
The ``-`` (hyphen) operator can be used to create a range of values and is shorthand for listing all
|
||||
values with the ``,`` operator.
|
||||
- .. code-block:: yaml
|
||||
|
||||
# every 5 minutes
|
||||
seconds: 0
|
||||
minutes: /5
|
||||
|
||||
# every timestamp where the minute is 5,15,25,...
|
||||
seconds: 0
|
||||
minutes: 5/10
|
||||
|
||||
The ``/`` operator can be used to create a step value. For example ``/5`` for ``minutes:`` makes an
|
||||
automation trigger only when the minute of the hour is 0, or 5, 10, 15, ... The value in front of the
|
||||
``/`` specifies the offset with which the step is applied.
|
||||
|
||||
- .. code-block:: yaml
|
||||
|
||||
# Every minute
|
||||
seconds: 0
|
||||
minutes: '*'
|
||||
|
||||
Lastly, the ``*`` operator matches every number. In the example above, ``*`` could for example be substituted
|
||||
with ``0-59``.
|
||||
|
||||
|
||||
.. warning::
|
||||
|
||||
Please note the following automation would trigger for each second in the minutes 0,5,10,15 and not
|
||||
once per 5 minutes as the seconds variable is not set:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
# ...
|
||||
on_time:
|
||||
- minutes: /5
|
||||
then:
|
||||
- switch.toggle: my_switch
|
||||
|
||||
.. _time-has_time_condition:
|
||||
|
||||
``time.has_time`` Condition
|
||||
----------------------------
|
||||
|
||||
This :ref:`Condition <config-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
|
||||
--------
|
||||
|
||||
|
2
conf.py
2
conf.py
@ -72,7 +72,7 @@ author = 'Otto Winter'
|
||||
# The short X.Y version.
|
||||
version = '1.16'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '1.16.0b4'
|
||||
release = '1.16.0b5'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
@ -324,7 +324,7 @@ All Triggers
|
||||
- :ref:`esphome.on_boot <esphome-on_boot>` / :ref:`esphome.on_shutdown <esphome-on_shutdown>` / :ref:`esphome.on_loop <esphome-on_loop>`
|
||||
- :ref:`light.on_turn_on / light.on_turn_off <light-on_turn_on_off_trigger>`
|
||||
- :ref:`logger.on_message <logger-on_message>`
|
||||
- :ref:`time.on_time <time-on_time>`
|
||||
- :ref:`time.on_time <time-on_time>` / - :ref:`time.on_time_sync <time-on_time_sync>`
|
||||
- :ref:`mqtt.on_message <mqtt-on_message>` / :ref:`mqtt.on_json_message <mqtt-on_json_message>`
|
||||
- :ref:`pn532.on_tag <pn532-on_tag>` / :ref:`rdm6300.on_tag <rdm6300-on_tag>`
|
||||
- :ref:`interval.interval <interval>`
|
||||
@ -374,8 +374,7 @@ All Actions
|
||||
- :ref:`http_request.get <http_request-get_action>` / :ref:`http_request.post <http_request-post_action>` / :ref:`http_request.send <http_request-send_action>`
|
||||
- :ref:`rf_bridge.send_code <rf_bridge-send_code_action>`
|
||||
- :ref:`rf_bridge.learn <rf_bridge-learn_action>`
|
||||
- :ref:`ds1307.read <ds1307-read_action>`
|
||||
- :ref:`ds1307.write <ds1307-write_action>`
|
||||
- :ref:`ds1307.read_time <ds1307-read_time_action>` / :ref:`ds1307.write_time <ds1307-write_time_action>`
|
||||
|
||||
.. _config-condition:
|
||||
|
||||
|
@ -260,7 +260,7 @@ Command reference:
|
||||
# Warning: this command is currently not working with Docker on MacOS. (see note below)
|
||||
docker run --rm -v "${PWD}":/config --net=host -it esphome/esphome
|
||||
|
||||
# Start dashboard on port 5062 (MacOS specific command)
|
||||
# Start dashboard on port 6052 (MacOS specific command)
|
||||
docker run --rm -p 6052:6052 -e ESPHOME_DASHBOARD_USE_PING=true -v "${PWD}":/config -it esphome/esphome
|
||||
|
||||
# Setup a bash alias:
|
||||
|
@ -140,10 +140,10 @@ Contributors
|
||||
- `Achilleas Pipinellis (@axilleas) <https://github.com/axilleas>`__ - 1 contribution
|
||||
- `Kamil Trzciński (@ayufan) <https://github.com/ayufan>`__ - 7 contributions
|
||||
- `Nicholas Peters (@Azimath) <https://github.com/Azimath>`__ - 2 contributions
|
||||
- `Florian Mösch (@badbadc0ffee) <https://github.com/badbadc0ffee>`__ - 6 contributions
|
||||
- `Florian Mösch (@badbadc0ffee) <https://github.com/badbadc0ffee>`__ - 8 contributions
|
||||
- `balk77 (@balk77) <https://github.com/balk77>`__ - 2 contributions
|
||||
- `Paulus Schoutsen (@balloob) <https://github.com/balloob>`__ - 41 contributions
|
||||
- `Andrew Zaborowski (@balrog-kun) <https://github.com/balrog-kun>`__ - 7 contributions
|
||||
- `Andrew Zaborowski (@balrog-kun) <https://github.com/balrog-kun>`__ - 8 contributions
|
||||
- `Rutger Nijhuis (@BananaPukeh) <https://github.com/BananaPukeh>`__ - 1 contribution
|
||||
- `J. Nick Koston (@bdraco) <https://github.com/bdraco>`__ - 1 contribution
|
||||
- `Ben Suffolk (@bensuffolk) <https://github.com/bensuffolk>`__ - 1 contribution
|
||||
@ -230,10 +230,10 @@ Contributors
|
||||
- `Eric Hiller (@erichiller) <https://github.com/erichiller>`__ - 1 contribution
|
||||
- `Ernst Klamer (@Ernst79) <https://github.com/Ernst79>`__ - 1 contribution
|
||||
- `escoand (@escoand) <https://github.com/escoand>`__ - 7 contributions
|
||||
- `esphomebot (@esphomebot) <https://github.com/esphomebot>`__ - 8 contributions
|
||||
- `esphomebot (@esphomebot) <https://github.com/esphomebot>`__ - 9 contributions
|
||||
- `Evan Coleman (@evandcoleman) <https://github.com/evandcoleman>`__ - 3 contributions
|
||||
- `Malte Franken (@exxamalte) <https://github.com/exxamalte>`__ - 2 contributions
|
||||
- `Fabian Affolter (@fabaff) <https://github.com/fabaff>`__ - 28 contributions
|
||||
- `Fabian Affolter (@fabaff) <https://github.com/fabaff>`__ - 29 contributions
|
||||
- `C W (@fake-name) <https://github.com/fake-name>`__ - 2 contributions
|
||||
- `Christian Ferbar (@ferbar) <https://github.com/ferbar>`__ - 2 contributions
|
||||
- `foxsam21 (@foxsam21) <https://github.com/foxsam21>`__ - 1 contribution
|
||||
@ -254,10 +254,11 @@ Contributors
|
||||
- `Giovanni (@Gio-dot) <https://github.com/Gio-dot>`__ - 2 contributions
|
||||
- `gitolicious (@gitolicious) <https://github.com/gitolicious>`__ - 16 contributions
|
||||
- `The Gitter Badger (@gitter-badger) <https://github.com/gitter-badger>`__ - 1 contribution
|
||||
- `Guillermo Ruffino (@glmnet) <https://github.com/glmnet>`__ - 187 contributions
|
||||
- `Guillermo Ruffino (@glmnet) <https://github.com/glmnet>`__ - 189 contributions
|
||||
- `Giorgos Logiotatidis (@glogiotatidis) <https://github.com/glogiotatidis>`__ - 1 contribution
|
||||
- `Germain Masse (@gmasse) <https://github.com/gmasse>`__ - 2 contributions
|
||||
- `Jelle Raaijmakers (@GMTA) <https://github.com/GMTA>`__ - 1 contribution
|
||||
- `gordon-zhao (@gordon-zhao) <https://github.com/gordon-zhao>`__ - 1 contribution
|
||||
- `Antoine GRÉA (@grea09) <https://github.com/grea09>`__ - 4 contributions
|
||||
- `Guillaume DELVIT (@guiguid) <https://github.com/guiguid>`__ - 1 contribution
|
||||
- `guptamp (@guptamp) <https://github.com/guptamp>`__ - 1 contribution
|
||||
@ -396,6 +397,7 @@ Contributors
|
||||
- `Greg Johnson (@notgwj) <https://github.com/notgwj>`__ - 1 contribution
|
||||
- `Nuno Sousa (@nunofgs) <https://github.com/nunofgs>`__ - 1 contribution
|
||||
- `Chris Nussbaum (@nuttytree) <https://github.com/nuttytree>`__ - 1 contribution
|
||||
- `Dave Walker (@oddsockmachine) <https://github.com/oddsockmachine>`__ - 1 contribution
|
||||
- `Olivér Falvai (@ofalvai) <https://github.com/ofalvai>`__ - 1 contribution
|
||||
- `Omar Ghader (@omarghader) <https://github.com/omarghader>`__ - 1 contribution
|
||||
- `Oncleben31 (@oncleben31) <https://github.com/oncleben31>`__ - 1 contribution
|
||||
@ -416,7 +418,7 @@ Contributors
|
||||
- `Peter Kuehne (@pkuehne) <https://github.com/pkuehne>`__ - 5 contributions
|
||||
- `Plácido Revilla (@placidorevilla) <https://github.com/placidorevilla>`__ - 2 contributions
|
||||
- `Marcus Kempe (@plopp) <https://github.com/plopp>`__ - 1 contribution
|
||||
- `DK (@poldim) <https://github.com/poldim>`__ - 1 contribution
|
||||
- `DK (@poldim) <https://github.com/poldim>`__ - 2 contributions
|
||||
- `Iván Povedano (@pove) <https://github.com/pove>`__ - 1 contribution
|
||||
- `Peter Stuifzand (@pstuifzand) <https://github.com/pstuifzand>`__ - 1 contribution
|
||||
- `Peter Tatrai (@ptatrai) <https://github.com/ptatrai>`__ - 1 contribution
|
||||
@ -450,10 +452,11 @@ Contributors
|
||||
- `rudgr (@rudgr) <https://github.com/rudgr>`__ - 1 contribution
|
||||
- `ryanalden (@ryanalden) <https://github.com/ryanalden>`__ - 2 contributions
|
||||
- `Ryan Nazaretian (@ryannazaretian) <https://github.com/ryannazaretian>`__ - 1 contribution
|
||||
- `Sascha (@Scarbous) <https://github.com/Scarbous>`__ - 1 contribution
|
||||
- `Nils Schulte (@Schnilz) <https://github.com/Schnilz>`__ - 1 contribution
|
||||
- `Ville Skyttä (@scop) <https://github.com/scop>`__ - 5 contributions
|
||||
- `sekkr1 (@sekkr1) <https://github.com/sekkr1>`__ - 1 contribution
|
||||
- `SenexCrenshaw (@SenexCrenshaw) <https://github.com/SenexCrenshaw>`__ - 7 contributions
|
||||
- `SenexCrenshaw (@SenexCrenshaw) <https://github.com/SenexCrenshaw>`__ - 8 contributions
|
||||
- `Sergio (@sergio303) <https://github.com/sergio303>`__ - 2 contributions
|
||||
- `Sergio Mayoral Martínez (@sermayoral) <https://github.com/sermayoral>`__ - 2 contributions
|
||||
- `sethcohn (@sethcohn) <https://github.com/sethcohn>`__ - 1 contribution
|
||||
@ -480,6 +483,7 @@ Contributors
|
||||
- `Levente Tamas (@tamisoft) <https://github.com/tamisoft>`__ - 2 contributions
|
||||
- `TBobsin (@TBobsin) <https://github.com/TBobsin>`__ - 1 contribution
|
||||
- `Team Super Panda (@teamsuperpanda) <https://github.com/teamsuperpanda>`__ - 1 contribution
|
||||
- `teffcz (@teffcz) <https://github.com/teffcz>`__ - 1 contribution
|
||||
- `The Impaler (@the-impaler) <https://github.com/the-impaler>`__ - 1 contribution
|
||||
- `Nejc (@thedexboy) <https://github.com/thedexboy>`__ - 1 contribution
|
||||
- `Thomas Eckerstorfer (@TheEggi) <https://github.com/TheEggi>`__ - 5 contributions
|
||||
@ -489,6 +493,7 @@ Contributors
|
||||
- `Jozef Zuzelka (@TheKuko) <https://github.com/TheKuko>`__ - 2 contributions
|
||||
- `Mateusz Soszyński (@TheLastGimbus) <https://github.com/TheLastGimbus>`__ - 1 contribution
|
||||
- `Andrew Quested (@thenameiwantedwastaken) <https://github.com/thenameiwantedwastaken>`__ - 1 contribution
|
||||
- `Zixuan Wang (@TheNetAdmin) <https://github.com/TheNetAdmin>`__ - 1 contribution
|
||||
- `Florian Gareis (@TheZoker) <https://github.com/TheZoker>`__ - 8 contributions
|
||||
- `Thomas Klingbeil (@thomasklingbeil) <https://github.com/thomasklingbeil>`__ - 3 contributions
|
||||
- `Andrew Thompson (@thompsa) <https://github.com/thompsa>`__ - 2 contributions
|
||||
@ -497,10 +502,11 @@ Contributors
|
||||
- `Tijs-B (@Tijs-B) <https://github.com/Tijs-B>`__ - 1 contribution
|
||||
- `Tim P (@timpur) <https://github.com/timpur>`__ - 2 contributions
|
||||
- `Tim Savage (@timsavage) <https://github.com/timsavage>`__ - 6 contributions
|
||||
- `Philipp Tölke (@toelke) <https://github.com/toelke>`__ - 1 contribution
|
||||
- `Tom Brien (@TomBrien) <https://github.com/TomBrien>`__ - 1 contribution
|
||||
- `TomFahey (@TomFahey) <https://github.com/TomFahey>`__ - 2 contributions
|
||||
- `Tommy Kihlstrøm (@tomludd) <https://github.com/tomludd>`__ - 1 contribution
|
||||
- `tomlut (@tomlut) <https://github.com/tomlut>`__ - 2 contributions
|
||||
- `tomlut (@tomlut) <https://github.com/tomlut>`__ - 3 contributions
|
||||
- `Tom Price (@tomtom5152) <https://github.com/tomtom5152>`__ - 3 contributions
|
||||
- `Torwag (@torwag) <https://github.com/torwag>`__ - 1 contribution
|
||||
- `Felix Eckhofer (@tribut) <https://github.com/tribut>`__ - 1 contribution
|
||||
@ -538,4 +544,4 @@ Contributors
|
||||
- `ZabojnikM (@ZabojnikM) <https://github.com/ZabojnikM>`__ - 1 contribution
|
||||
- `San (@zhujunsan) <https://github.com/zhujunsan>`__ - 1 contribution
|
||||
|
||||
*This page was last updated January 17, 2021.*
|
||||
*This page was last updated January 26, 2021.*
|
||||
|
Loading…
Reference in New Issue
Block a user