esphome-docs/components/status_led.rst

54 lines
1.7 KiB
ReStructuredText
Raw Normal View History

2018-06-13 22:38:49 +02:00
Status LED
==========
2018-11-14 22:12:27 +01:00
.. seo::
2019-02-16 23:25:23 +01:00
:description: Instructions for setting up status LEDs in ESPHome to monitor the status of an ESP.
:image: led-on.svg
2018-11-14 22:12:27 +01:00
2019-02-16 23:25:23 +01:00
The ``status_led`` hooks into all ESPHome components and can indicate the status of
2018-06-13 22:38:49 +02:00
the device. Specifically, it will:
- Blink slowly (about every second) when a **warning** is active. Warnings are active when for
example reading a sensor value fails temporarily, the WiFi/MQTT connections are disrupted, or
if the native API component is included but no client is connected.
2018-06-13 22:38:49 +02:00
- Blink quickly (multiple times per second) when an **error** is active. Errors indicate that
2019-02-16 23:25:23 +01:00
ESPHome has found an error while setting up. In most cases, ESPHome will still try to
2018-06-13 22:38:49 +02:00
recover from the error and continue with all other operations.
- Stay off otherwise.
.. code-block:: yaml
2018-06-13 22:38:49 +02:00
# Example configuration entry
status_led:
pin: GPIOXX
2018-06-13 22:38:49 +02:00
2021-08-10 09:55:37 +02:00
.. note::
2021-09-09 00:15:06 +02:00
If your device has a single LED that needs to be shared use :doc:`status_led light platform </components/light/status_led>` instead.
2021-08-10 09:55:37 +02:00
2018-06-13 22:38:49 +02:00
Configuration variables:
------------------------
- **pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The
GPIO pin to operate the status LED on.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
.. note::
If your LED is in an active-LOW mode (when it's on if the output is enabled), use the
``inverted`` option of the :ref:`Pin Schema <config-pin_schema>`:
.. code-block:: yaml
2018-06-13 22:38:49 +02:00
status_led:
pin:
number: GPIOXX
inverted: true
2018-06-13 22:38:49 +02:00
See Also
--------
2021-08-10 09:55:37 +02:00
- :doc:`/components/light/status_led`
2019-05-12 22:44:59 +02:00
- :apiref:`status_led/status_led.h`
- :ghedit:`Edit`