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.
|
2021-11-16 03:19:33 +01:00
|
|
|
: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
|
2024-05-07 07:40:12 +02:00
|
|
|
example reading a sensor value fails temporarily, the WiFi/MQTT connections are disrupted, or
|
2024-04-18 07:04:42 +02:00
|
|
|
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.
|
|
|
|
|
2018-11-19 18:32:16 +01:00
|
|
|
.. code-block:: yaml
|
2018-06-13 22:38:49 +02:00
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
status_led:
|
2024-05-07 07:40:12 +02:00
|
|
|
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>`:
|
|
|
|
|
2018-11-19 18:32:16 +01:00
|
|
|
.. code-block:: yaml
|
2018-06-13 22:38:49 +02:00
|
|
|
|
|
|
|
status_led:
|
|
|
|
pin:
|
2024-05-07 07:40:12 +02:00
|
|
|
number: GPIOXX
|
2021-07-28 23:56:11 +02:00
|
|
|
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`
|
2019-02-07 13:54:45 +01:00
|
|
|
- :ghedit:`Edit`
|