Status LED - seurat-atreides/Sonoff-Tasmota GitHub Wiki

Status LEDs are the LEDs on the device that display its state.

Those LEDs are defined in a template or module using Led1, Led2, Led3 or Led4 (or Led1i, Led2i, Led3i or Led4i) and additionally (starting in version 6.5.0.12) using LedLink (or LedLinki). It is not recommended to assign Led and Ledi with the same number.

By default Tasmota uses the first defined Led(i) as a device status LED. Next defined LED is the power status LED which displays the status of any Relay (or other power output). When only Led1(i) is defined it serves both purposes.

It is possible to wire in your own LED and assign it as any of the above mentioned but that's outside the scope of this article.

Link status LED

Link status LED shows the network state, more specifically the Wi-Fi and MQTT connection status.

It blinks if the device is not connected to your Wi-Fi AP and MQTT broker. You can change this behaviour with LedState or turn it off with SetOption31.

As an example: On a Sonoff Basic the green LED is defined as Ledi and is used as the link status LED.

Power status LED

Power status LED shows the status of components (commonly relays). It is turned off by default when the relay is OFF and turned on when the relay switches ON.

Depending on the device design, some LEDs are connected to the same GPIO as the relay. Those cannot be independently controlled since they have to follow the relay state.

If you have more than one LED wired independently and you want it to show the relay state you need to assign LedLink.

Using LedLink

Since version 6.5.0.12, a new component, LedLink (or LedLinki) is used to assign the link status LED. When LedLink(i) is assigned other LEDs are automatically linked to their corresponding relay and serve as that relay's power status LED.

  • Led1(i) links to Relay(i)1
  • Led2(i) links to Relay(i)2
  • Led3(i) links to Relay(i)3
  • Led4(i) links to Relay(i)4

LedPower command

When you use LedPower you take over control of that particular LED and it stops being linked to its corresponding relay and being its power status LED.