mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-26 17:27:47 +01:00
Merge branch 'current' into beta
This commit is contained in:
commit
9887bc52ec
@ -573,7 +573,27 @@ You can then switch between these with three different actions:
|
|||||||
then:
|
then:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
.. _display-on_page_change-trigger:
|
||||||
|
|
||||||
|
**on_page_change**: This automation will be triggered when the page that is shown changes.
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
display:
|
||||||
|
- platform: ...
|
||||||
|
# ...
|
||||||
|
on_page_change:
|
||||||
|
- from: page1
|
||||||
|
to: page2
|
||||||
|
then:
|
||||||
|
lambda: |-
|
||||||
|
ESP_LOGD("display", "Page changed from 1 to 2");
|
||||||
|
|
||||||
|
- **from** (*Optional*, :ref:`config-id`): A page id. If set the automation is only triggered if changing from this page. Defaults to all pages.
|
||||||
|
- **to** (*Optional*, :ref:`config-id`): A page id. If set the automation is only triggered if changing to this page. Defaults to all pages.
|
||||||
|
|
||||||
|
Additionally the old page will be given as the variable ``from`` and the new one as the variable ``to``.
|
||||||
|
|
||||||
See Also
|
See Also
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ To create an active-low switch (one that is turned off by default), use the :ref
|
|||||||
- platform: gpio
|
- platform: gpio
|
||||||
pin:
|
pin:
|
||||||
number: 25
|
number: 25
|
||||||
inverted: yes
|
inverted: true
|
||||||
|
|
||||||
Momentary Switch
|
Momentary Switch
|
||||||
----------------
|
----------------
|
||||||
|
@ -337,6 +337,7 @@ All Triggers
|
|||||||
- :ref:`ota.on_begin <ota-on_begin>` / :ref:`ota.on_progress <ota-on_progress>` /
|
- :ref:`ota.on_begin <ota-on_begin>` / :ref:`ota.on_progress <ota-on_progress>` /
|
||||||
:ref:`ota.on_end <ota-on_end>` / :ref:`ota.on_error <ota-on_error>` /
|
:ref:`ota.on_end <ota-on_end>` / :ref:`ota.on_error <ota-on_error>` /
|
||||||
:ref:`ota.on_state_change <ota-on_state_change>`
|
:ref:`ota.on_state_change <ota-on_state_change>`
|
||||||
|
- :ref:`display.on_page_change <display-on_page_change-trigger>`
|
||||||
|
|
||||||
All Actions
|
All Actions
|
||||||
-----------
|
-----------
|
||||||
|
@ -6,7 +6,7 @@ Web Server API
|
|||||||
:image: espeasy.png
|
:image: espeasy.png
|
||||||
|
|
||||||
Since version 1.3, ESPHome includes a built-in web server that can be used to view states
|
Since version 1.3, ESPHome includes a built-in web server that can be used to view states
|
||||||
and send commands. In addition to visible the web-frontend available under the root index of the
|
and send commands. In addition to the web-frontend available under the root index of the
|
||||||
web server, there's also two other features the web server currently offers: A real time event
|
web server, there's also two other features the web server currently offers: A real time event
|
||||||
source and REST API.
|
source and REST API.
|
||||||
|
|
||||||
@ -213,3 +213,39 @@ and ``/fan/<id>/toggle``. Turn on additionally supports these optional parameter
|
|||||||
|
|
||||||
- **speed_level**: The new speed level of the fan. Values as above.
|
- **speed_level**: The new speed level of the fan. Values as above.
|
||||||
- **oscillation**: The new oscillation setting of the fan. Values as above.
|
- **oscillation**: The new oscillation setting of the fan. Values as above.
|
||||||
|
|
||||||
|
Cover
|
||||||
|
*****
|
||||||
|
|
||||||
|
Covers are again similar to switches whose two possible states are ``OPEN`` and ``CLOSED``. They
|
||||||
|
can however be in an intermediate position, anywhere between **0.0** (fully closed) to **1.0**
|
||||||
|
(fully open). They usually take some time to move from one position to another and can also be
|
||||||
|
stopped midway. An example GET request for ``/cover/front_window_blinds`` might return:
|
||||||
|
|
||||||
|
.. code-block:: json
|
||||||
|
|
||||||
|
{
|
||||||
|
"id": "cover-front_window_blinds",
|
||||||
|
"state": "OPEN",
|
||||||
|
"value": 0.8,
|
||||||
|
"current_operation": "IDLE",
|
||||||
|
"tilt": 0.5
|
||||||
|
}
|
||||||
|
|
||||||
|
- **id**: The ID of the cover, prefixed with ``cover-``.
|
||||||
|
- **state**: ``OPEN`` or ``CLOSED``. Any position other than 0.0 is considered open.
|
||||||
|
- **value**: Current cover position as a float number.
|
||||||
|
- **current_operation**: ``OPENING``, ``CLOSING`` or ``IDLE``.
|
||||||
|
- **tilt**: (only if supported by this cover component) tilt angle from 0.0 to 1.0.
|
||||||
|
|
||||||
|
POST requests on the other hand allow performing actions on the cover, the available
|
||||||
|
methods being ``open``, ``close``, ``stop`` and ``set``. The following parameters
|
||||||
|
can be used:
|
||||||
|
|
||||||
|
- **position**: The target position for a ``set`` call. The ``open`` method implies
|
||||||
|
a target position of 1.0, ``close`` implies a target position of 0.0.
|
||||||
|
- **tilt**: The tilt angle to set, if supported.
|
||||||
|
|
||||||
|
Creating a POST request to ``/cover/front_window_blinds/set?position=0.1&tilt=0.3`` will
|
||||||
|
start moving the blinds towards an almost completely closed position and a new tilt
|
||||||
|
angle.
|
||||||
|
Loading…
Reference in New Issue
Block a user