Using Sonoff basic R2's two color internal led in the Switch Box

Tags: #<Tag:0x00007f7398ef3f68> #<Tag:0x00007f7398ef3db0>

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:

  1. Bridge the terminals of R7. Just a jumper (0 Ohm).
  2. 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.
  3. Connect the push button or the rocker switch.
    Capture3
    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:
    Capture
  4. 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.
  5. Open your Tasmota webpage.
  6. 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.
  7. 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.
  8. Go to Configuration -> Configure Module -> Load the template you created in step 7. Change GPIO3 Serial In from None (0) to Switch1 (9).
  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.

1 Like

Thanks for the share :point_up: