The idea is to use the two colour internal led to show the status of the relay in the front panel of the switch box.
On = green / Off = red.
The red led helps to locate the switch button in the dark.
The green led helps to know if the circuit is energized. The light bulb could be broken or burned out and the circuit is still energized. It works as a beacon.
I did nothing but put the pieces together. Credits are for the people that I mention in this post.
WARNING AND DISCLAIMER: Don’t mess with electricity unless you know what you are doing. Do it at your own risk.
Having said that, let’s have a bit of fun
This is a fork of @DrZzs’s post:
I recommend to view it and later on came back here.
Sonoff basic devices have a dual color led. Green and Red.
The red one is supposed to be used for the RF circuit which is usually missing.
In the link below I saw someone who managed to turn the red LED on when the green is off and vice versa without much hassle.
I used that idea for my project.
Steps:
- Bridge the terminals of R7. Just a jumper (0 Ohm).
- In order to take the led to the outer of the switch box you need to cut the led leaving approximately 1 cm length on the legs to the board (as in picture).
The central pin is ground. Solder the led to 3 long wires and put a dupont connector on the tip. I used a molex connector because it was what I had available.
- Connect the push button or the rocker switch.
Basic R2/R3 have internal pull up resistors. There is not need add one. If you experience issues with the relay turning on or off randomly then add 4.7K Ohm pull up resistor. That could do the trick. It should look like this:
- Drill a tiny hole of the led diameter (3mm) in the faceplate of switch box. The led emits a lot of light. Consider that when you mount it. You may like to level the head of the led with the faceplate surface of the switch box to dim it a bit and avoid much light in the room.
- Open your Tasmota webpage.
- Go to Configuration → Configure Logging → Set Serial Log Level to none (we don’t want to mess with RX pin). Can also be done via console:
SerialLog Off
. - Go to Configuration → Configure Template → Based on Basic(1) change GPIO13 from Led1i (56) to Led1 (52). Not inverted. This way Green is Light On, Red is Light Off.
- Go to Configuration → Configure Module → Load the template you created in step 7. Change GPIO3 Serial In from None (0) to Switch1 (9).
- If you use a rocker switch you can skip this step. If you use a push button then type the following command in your console:
SwitchMode1 4
.
That should do the trick. Enjoy.