DISCLAIMER: I will take no responsibility for any of your actions or damage that may occur. This relay is powered by 5V, which is not harmfull at all, but if you decide to connect high voltage to relay terminals, do it on your own risk and be sure that you know what you’re doing.
Few months ago I had idea to control my central heating and hot water boiler with little WiFi relay, which I found on AliExpress for ~3€ (~$4) each (URL). The product name is LC Technology ESP8266 Relay, which, for my dissapointment, was not what I was looking for, because this relay is controlled via serial interface or crappy Android APP, also with no MQTT. Before throwing it out to trash can, I made a little research, and found out that with little soldering iron it can be converted to fully functioning WiFi relay and with MQTT support. Yayyy!! So, if you have the same model as I do - don’t throw it out yet (or go and pick it up from trash can). This is what you need to do. Conversion is as easy as urinating on two fingers (I’m bad at metaphors…). So let’s come on. Here are the steps.
- Remove ESP8266 module and put it aside, you’ll need it later.
- Grab tweezers and soldering iron, some fine wire (I used a thread from UTP cable) and 10kOhm resistor (can be found almost in any electronics, I found mine in old PIR sensor, colors are brown, black, orange, gold).
- Using soldering iron, gently remove chip named U4 and resistor R4 (See picture below).
- Solder piece of wire on resistor R3. You want it to solder it on pin, closer to capacitor C2. (See picture below).
- Now, other part of that wire we need to solder to ESP8266 GPIO0 pin. (See picture below)
- Last step is to solder 10kOhm resistor on VCC and GPIO0 pins. (See picture below)
VCC and GPIO0 pins:
Hardware part is over. Lets begin with software part. For software part, I uploaded Sonoff-Tasmota firmware using PlatformIO. You can find information on how to compile and upload firmware on Sonoff-Tasmota Wiki. To get ESP8266 into flash mode, you need to short GPIO0 to GND, see example below:
After flashing is done, put ESP8266 back where it belongs, power on 5 volts to this bad boy and connect to your relay using web browser. Now basically what you want to do is to send signals (HIGH/LOW) to GPIO0 to control the relay. By default (almost?) all Sonoff devices uses GPIO0 for button. Luckily, you can find Wemos D1 mini in configuration list, where you can choose your GPIO0 device. So, configure your device as Wemos D1 mini, select D3 GPIO0 Button1 as 17 Relay1:
Save configuration and after relay reboot this masterpiece should work as expected. Configure MQTT and other settings according to your network and use it where you want it I integrated one relay to my sound amplifier, so HA will power it when my TV is turned on.
Here is example HA configuration as switch:
- - platform: mqtt
I will gladly answer questions if you have any. Do not forget to triple check connections if you decide to use this relay on high voltage.