diff --git a/components/binary_sensor/switch.rst b/components/binary_sensor/switch.rst new file mode 100644 index 000000000..7691502fa --- /dev/null +++ b/components/binary_sensor/switch.rst @@ -0,0 +1,36 @@ +.. _switch-binary-sensor: + +Switch Binary Sensor +==================== + +.. seo:: + :description: Instructions for setting up switch binary sensors with ESPHome. + +The Switch Binary Sensor platform allows you to view the state of any switch component as a +read-only binary sensor. + +.. code-block:: yaml + + # Example configuration entry + binary_sensor: + - platform: switch + name: "Output state" + source_id: relay1 + + switch: + - platform: gpio + id: relay1 + pin: GPIOXX + +Configuration variables: +------------------------ + +- **source_id** (**Required**, :ref:`config-id`): The source switch to observe. +- All other options from :ref:`Binary Sensor `. + +See Also +-------- + +- :doc:`/components/binary_sensor/index` +- :apiref:`switch/binary_sensor/switch_binary_sensor.h` +- :ghedit:`Edit` diff --git a/index.rst b/index.rst index 74c4cf6d8..0c28dbf7d 100644 --- a/index.rst +++ b/index.rst @@ -637,6 +637,7 @@ Core GPIO, components/binary_sensor/gpio, gpio.svg Home Assistant, components/binary_sensor/homeassistant, home-assistant.svg, dark-invert Status, components/binary_sensor/status, server-network.svg, dark-invert + Switch, components/binary_sensor/switch, electric-switch.svg, dark-invert Capacitive Touch ****************