2022-04-03 09:30:25 +02:00
|
|
|
Time Based Cover
|
2019-05-12 22:44:59 +02:00
|
|
|
================
|
|
|
|
|
|
|
|
.. seo::
|
|
|
|
:description: Instructions for setting up time-based covers in ESPHome.
|
2021-11-16 03:19:33 +01:00
|
|
|
:image: timer.svg
|
2019-05-12 22:44:59 +02:00
|
|
|
|
|
|
|
The ``time_based`` cover platform allows you to create covers with position control that do not
|
|
|
|
have any position feedback. The state of the cover is thus always an assumed one, the current
|
|
|
|
position is approximated with the time the cover has been moving in a direction.
|
|
|
|
|
|
|
|
.. figure:: images/more-info-ui.png
|
|
|
|
:align: center
|
|
|
|
:width: 75.0%
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
cover:
|
|
|
|
- platform: time_based
|
|
|
|
name: "Time-Based Cover"
|
|
|
|
|
|
|
|
open_action:
|
|
|
|
- switch.turn_on: open_cover_switch
|
|
|
|
open_duration: 2.1min
|
|
|
|
|
|
|
|
close_action:
|
|
|
|
- switch.turn_on: close_cover_switch
|
|
|
|
close_duration: 2min
|
|
|
|
|
|
|
|
stop_action:
|
|
|
|
- switch.turn_off: open_cover_switch
|
|
|
|
- switch.turn_off: close_cover_switch
|
|
|
|
|
|
|
|
|
|
|
|
Configuration variables:
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
- **name** (**Required**, string): The name of the cover.
|
|
|
|
- **open_action** (**Required**, :ref:`Action <config-action>`): The action that should
|
|
|
|
be performed when the remote requests the cover to be opened.
|
|
|
|
- **open_duration** (**Required**, :ref:`config-time`): The amount of time it takes the cover
|
|
|
|
to open up from the fully-closed state.
|
|
|
|
- **close_action** (*Optional*, :ref:`Action <config-action>`): The action that should
|
|
|
|
be performed when the remote requests the cover to be closed.
|
|
|
|
- **close_duration** (**Required**, :ref:`config-time`): The amount of time it takes the cover
|
|
|
|
to close from the fully-open state.
|
|
|
|
- **stop_action** (**Required**, :ref:`Action <config-action>`): The action that should
|
2019-08-31 19:53:15 +02:00
|
|
|
be performed to stop the cover when the remote requests the cover to be stopped or
|
|
|
|
when the cover has been opening/closing for the given durations.
|
|
|
|
- **has_built_in_endstop** (*Optional*, boolean): Indicates that the cover has built in end stop
|
2020-05-10 21:27:59 +02:00
|
|
|
detectors. In this configuration the ``stop_action`` is not performed when the open or close
|
2019-08-31 19:53:15 +02:00
|
|
|
time is completed and if the cover is commanded to open or close the corresponding actions
|
2021-07-28 23:56:11 +02:00
|
|
|
will be performed without checking current state. Defaults to ``false``.
|
2023-04-12 23:53:37 +02:00
|
|
|
- **manual_control** (*Optional*, boolean): For covers with manual external controls. With this
|
|
|
|
configuration if the cover is commanded to open or close the corresponding actions will be
|
|
|
|
performed even if the current state fully open or fully closed matches desired state, then
|
|
|
|
``stop_action`` will be called after the full duration of the action elapses.
|
|
|
|
The current state will then be relearned upon completion.
|
|
|
|
It's recommended to set ``assumed_state`` to true so the cover control button aren't disabled
|
|
|
|
in the interface. Defaults to ``false``.
|
2020-03-12 14:09:07 +01:00
|
|
|
- **assumed_state** (*Optional*, boolean): Whether the true state of the cover is not known.
|
|
|
|
This will make the Home Assistant frontend show buttons for both OPEN and CLOSE actions, instead
|
2021-07-28 23:56:11 +02:00
|
|
|
of hiding or disabling one of them. Defaults to ``true``.
|
2019-05-12 22:44:59 +02:00
|
|
|
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
|
|
|
- All other options from :ref:`Cover <config-cover>`.
|
|
|
|
|
2019-08-31 19:53:15 +02:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
The stop button on the UI is always enabled even when the cover is stopped and each press
|
|
|
|
on the button will cause the ``stop_action`` to be performed.
|
|
|
|
|
2022-09-27 17:04:13 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
The state of the cover can be restored from flash after a node reboot, with
|
|
|
|
``esp8266_restore_from_flash: true`` option set.
|
|
|
|
See :doc:`esp8266_restore_from_flash </components/esphome>` for details.
|
|
|
|
|
|
|
|
|
2019-08-31 19:53:15 +02:00
|
|
|
|
2019-05-12 22:44:59 +02:00
|
|
|
See Also
|
|
|
|
--------
|
|
|
|
|
|
|
|
- :doc:`index`
|
|
|
|
- :ref:`automation`
|
|
|
|
- :apiref:`time_based/time_based_cover.h`
|
|
|
|
- :ghedit:`Edit`
|