Default function of the onboard LED when not blinking for errors or connecting to WiFi etc is:
Relay on = LED on
Relay off = LED off
The led actually shines through my wall switch making it glow nicely.
I’d like to change the led function to either:
If relay is off then led light is on. This will allow me to find the light switch in the dark when the lights are off.
Or
Control the led via home assistant. This will allow me to do the above or the other option would be to have the led off during the day and on at night when it’s dark.
Doors anyone know of you can change the led function. I didn’t find anything useful in the console wiki for tasmota.
Pardon me if I’m misunderstanding, but I don’t see how that resolves the question? LedState 2 appears to flash the LED when the MQTT message is received. The request is to have the LED be turned on whenever the relay is turned off, or to control the LED via HomeAssistant… unless I misunderstand how this is implemented, the only way LedState 2 would accomplish this would be if you send constant messages to the MQTT topic that the sonoff is subscribed to in order to make the LED flash constantly while it was dark.
Well, I wanted to have the LED “reversed” as well, and I was able to figure out a way to do so, it wasn’t quite as simple as just having an LedState option, but it is easy enough to do using just the web interface.
Go to “Configuration” menu
Go to “Configure Module” screen
Change “Module type” dropdown and change it from “01 Sonoff Basic” to “18 Generic” (it should be at the very bottom of the list)
Click “Save” and it will restart with the new module type
Go back to the “Configuration” > “Configure Module” screen
Set the following values (any that aren’t listed should be left as “00 None”):
“GPIO0” to “17 Button1”
“GPIO1” to “71 SerBr Tx”
“GPIO3” to “72 SerBr Rx”
"GPIO12: to “21 Relay1”
“GPIO13” to “52 Led1”
“GPIO14” to “09 Switch1”
Click “Save” to save values and restart module
The unit should now work as it normally does, except the LED status should now be reversed from the power relay status.
Basically what we just did was set it as a “Generic” Sonoff instead of the “Sonoff Basic”, and then set all the “standard” values for the Sonoff Basic, except “GPIO13” is now set as “52 Led1” instead of “56 Led1i”. Led1i is “LED Inverted”, so Led1 is the opposite of that, which means the LED is off when the power relay is on, and the LED is on when the power relay is off.
I just pointed the OP to the part of the wiki he said couldn’t find which lists LED related commands exactly as he requested above. He never acknowledged that so we couldn’t continue the conversation and work towards an answer for his situation.
Happens all the time on here, people ask questions, someone goes to the trouble of trying to help and the poster either never comes back or, as the OP has now shown, just too rude to respond.
For my own curiosity, I just had a quick look myself and the complete solution is actually in that list of commands, this is the important one…
LedState 1 / on Show power state on led (inverted for Sonoff Touch)
So, simply change the device to be a Sonoff Touch, set LedState to 1, job done!
Hah, right you are, that does the trick. I had seen the note about it being inverted for the Sonoff Touch, but for some reason I took that to mean the touch hardware was inverted, not that the configured behavior for the LED was reversed. Well, that’s much simpler to configure than my approach
Hi, is this still working with Tasmota 7.1.1? I just tried it and doesn’t seem to be working: on LedState 1 the top LED ( one showing if wifi is connected ) stays ON as soon as wifi is locked in, but the witness LED is OFF.
LE: I forgot to mention: testing on a Sonoff T1 EU