I purchased a couple of Lyasi wall switches from amazon.com for $24.99 USD. There are several versions (GresaTek, Jesiya, NewRice, etc) available through amazon, ebay and various other web outlets, however they appear to be very similar with only minor differences. After disassembly and a cursory inspection, I determined a few specifics about how they operate.
To disassemble the switch, remove the 4 screws holding the face plate to the body. On several of my devices, these screws were extremely tight and required careful use of an appropriately matched/sized screwdriver to prevent damaging the screw heads. This will expose the underlying PCB. The PCB is held in place by 3 additional screws. The switch plate is also connected via a 2-wire JST style connector which can be wiggled apart. Be careful, the connector-to-board solder joint on my device was weak and could have easily been damaged.
The device incorporate an Espressif Systems ESP-8285 Wifi SOC chip (datasheet), which is great news because this chip is virtually the same as the well-liked ESP-8266 used in the highly popular Sonoff line of products. The primary differences being the 8285 has 1 Meg of built-in memory. This is more than enough for programming simple IoT projects. However, if you need more memory, consider the un-populated chip outline (U2) on the PCB appears to have the appropriate traces running to add an auxiliary SD memory chip.
My PCB was labelled “DLX Control Solutions” along with a “KS-602” part number which corresponded to the cardboard packaging part number. However, a web search turned up nothing under the text of “DLX Control Solutions”.
The backside of the board incorporates an SGL-8022 proximity sensing chip which operates the touch sense face-plate. The PCB has componentry for producing the necessary ESP-8285 (3.3V) power and also includes a blue status LED and SRA05 20A relay for AC power switching. There are a few poorly-accomplished routered slots between the high voltage PCB traces for circuit isolation and arc-over protection, but BEWARE, my device didn’t have any indications of being UL approved.
Regardless, the good news is that the ESP-8285 GROUND, VCC, RXD and TXD pins are brought out to an un-populated four-hole connector, labelled J1 on my board. I highlighted this J1 connector in red on the picture below. However, on some of my boards these were already filled with solder. So, I fired up my trusty de-solder station and was able to remove the solder from 3 of the holes, but the boxed ground hole was filled with something more akin to cement than solder. I was never able to extract whatever that was, so instead, I simply soldered a 4-pin male 90-degree header in place, neglecting to use the holes. That worked well.
On my device the pins were connected in this order, left to right on the “J1” label side of the PCB: VCC, TXD, RXD and GROUND (individual box label). Remember to connect the TX output from your FTDI programmer to the J1 RXD pin.
The final hurdle to re-programming would be grounding the ESP-8285 GPIO0 pin on power-up, in order to get the chip into flash mode. Since the GPIO0 pin is NOT brought out to the J1 connector, an alternate method is required. I read online where someone was able to jump the opposite edges of the R6 resister and C15 capacitor together using small tweezers and get the chip into boot mode. The R6 resistor is directly connected to the ESP-8285 GPIO0 pin. I tried this method several times, but was unable to get it to work. My method was to solder a length of wire to the ESP-8285 chip side R6 resistor (see the picture), and ground this wire on power-up. This worked first time like a charm.
I used the Arduino IDE for programming, setting the board to “generic ESP8285 module”, and selected “1M (64K SPIFFS)”. My Sparkfun 3.3V FTDI VCC out was sufficient to power the device for re-programming. I used virtually the same program from this post to allow my switch to respond to a Blynk application and amazon Echo/Alexa voice commands.
Just like the Sonoff Wifi power switches, this device uses the same ESP-8285 connections. The blue status LED is controlled by GPIO13. This LED is on when the GPIO is low. The relay is controlled by GPIO12 and makes contact when the GPIO is high. The proximity (touch sensing) switch is connected to GPIO0 and the GPIO goes low when sensed. A majority of the other ESP-8285 GPIOs are not used.
I have since noticed that some of the manufactured PCB boards have two front-side test-points labelled, RES and SW. I wonder if these connections are for placing the ESP-8285 into programming mode? Some of my boards did not have these test-points.
It’s just as I thought. Further investigation has shown that the lower test point on the above picture, the one I labeled ‘A’ is connected to GPIO0. The upper test point, the one labeled ‘B’ is connected to the ESP-8285 pin 33 and ground. Connecting these points together should place the chip into boot mode for programming.