2018-05-13 11:37:02 +02:00
|
|
|
Generic Output Switch
|
|
|
|
=====================
|
|
|
|
|
2018-11-14 22:12:27 +01:00
|
|
|
.. seo::
|
2019-02-16 23:25:23 +01:00
|
|
|
:description: Instructions for setting up generic output switches in ESPHome that control an output component.
|
2021-11-16 03:19:33 +01:00
|
|
|
:image: upload.svg
|
2018-11-14 22:12:27 +01:00
|
|
|
|
2018-05-13 11:37:02 +02:00
|
|
|
The ``output`` switch platform allows you to use any output component as a switch.
|
|
|
|
|
2018-06-01 18:10:00 +02:00
|
|
|
.. figure:: images/output-ui.png
|
|
|
|
:align: center
|
|
|
|
:width: 80.0%
|
2018-05-13 11:37:02 +02:00
|
|
|
|
2018-11-19 18:32:16 +01:00
|
|
|
.. code-block:: yaml
|
2018-05-13 11:37:02 +02:00
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
output:
|
|
|
|
- platform: gpio
|
|
|
|
pin: 25
|
|
|
|
id: 'generic_out'
|
|
|
|
switch:
|
|
|
|
- platform: output
|
|
|
|
name: "Generic Output"
|
|
|
|
output: 'generic_out'
|
|
|
|
|
|
|
|
Configuration variables:
|
2018-08-24 22:44:01 +02:00
|
|
|
------------------------
|
2018-05-13 11:37:02 +02:00
|
|
|
|
2018-06-01 18:10:00 +02:00
|
|
|
- **output** (**Required**, :ref:`config-id`): The ID of the output component to use.
|
|
|
|
- **name** (**Required**, string): The name for the switch.
|
|
|
|
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
2022-01-09 19:47:11 +01:00
|
|
|
|
2019-02-17 12:28:17 +01:00
|
|
|
- All other options from :ref:`Switch <config-switch>`.
|
2018-06-01 18:10:00 +02:00
|
|
|
|
|
|
|
See Also
|
2018-08-24 22:44:01 +02:00
|
|
|
--------
|
2018-06-01 18:10:00 +02:00
|
|
|
|
2019-02-07 13:54:45 +01:00
|
|
|
- :doc:`/components/output/index`
|
2019-05-12 22:44:59 +02:00
|
|
|
- :apiref:`output/switch/output_switch.h`
|
2019-02-07 13:54:45 +01:00
|
|
|
- :ghedit:`Edit`
|