docs for new switch binary sensor (#4465)

Co-authored-by: Samuel Sieb <samuel@sieb.net>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Samuel Sieb 2024-11-24 22:40:50 -10:00 committed by GitHub
parent 4a4d0ae752
commit 8a8e1edbd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 0 deletions

View File

@ -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 <config-binary_sensor>`.
See Also
--------
- :doc:`/components/binary_sensor/index`
- :apiref:`switch/binary_sensor/switch_binary_sensor.h`
- :ghedit:`Edit`

View File

@ -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
****************