Unkown tuya chip

Thanks for the help!
Super, it works well!

Hi,

No problem the ESP-01 fit in there like a charm…

Go ahead…

Ok… so, after lots of trial and error I finished my transplant… I didn’t found anything around here so I’ll leave my contribution…

I used a ESP01 instead of an ESP12… I figured "if I only need 2 Gpio pins (0 for the button and an extra one to control the relay) I’m pretty good with Gpio 2… Turns out I’m not. The second I wired everything like you guys did the chip wouldn’t boot… turns out that if GPIO 2 is pulled down on boot the chip crashes… So, what I end up doing was:

  • Before doing anything I flashed tasmota into the ESP01.
  • Then tested if everything was properly working (instead of using a relay I used an LED with a 360Ohnm resistor) and I managed to get everything working fine
  • I proceeded to desolder the baby board off the main module.
  • Since ESP01 haves the male pin connectors I cutted a couple female jumper wires in half and soldered the wires into the Tuya module (this way I can add and remove my ESP01 from the module as I please if I need to debug something)
  • I connected every pin accordingly:
    3.3V -> Vbat
    GND -> GND
    EC -> 10k resistor -> 3.3V pin
    PWM0 -> GPIO0
    PWM4 -> GPIO2

Problem is that when I connected my device to mains the chip would crash when booting (blue LED on all the time). Like I previously said, if you pull down GPIO2 on boot it won’t boot… So I needed to do something to overcome that issue.

I searched all the GPIO pins behaviour on boot and the only one that is fine with being pulled down on boot is Serial RX pin (which is GPIO3)… So, I had to disable serial logging (I run “SerialLog Off” In tasmota console) connect the relay wire to GPIO3 instead of GPIO2 and change the config to

GPIO2 = Switch1
GPIO3 = Relay1

So, instead of using GPIO2 for the relay I ended up using GPIO3… everything is working fine, but I have a little problem with my external switch now… if it’s latched on when the device reboots it will prevent booting… So, I’m planning to use a pull-up pulsator button to avoid that issue… OFC if power runs out and someone is pressing that button when the power comes up again it will interrupt the boot sequence, but that’s pretty much impossible… so that’s my grain of sand. I hope it helps someone in the future… If you don’t want to deal with this issue you’re better of using an ESP12… but if you’re not planning to use a push button instead of a toggle for manual control then you’re good to go…

Thanks for all your contributions and a special shout to @raeppli since I follow his PDF guide for the entire process !

Cheers!

Hi again,

Sorry but with ESP01 you can´t put a switch working, because in boot you will have some problems with GIPIO 0, 2 and 1, better use ESP12,n attach the possible GIPIO’s to make your change in MINI SMART SWITCH with WB2S board:

WB2S - MINI SMART SWITCH PINOUT i

You can also use ESP-M3 or ESP-M2 which are even smaller than ESP-01. I get mine from this link which has a wide assortment of modules I use for transplants

1 Like

Thanks everyone for the great guides and information.
Using your input I recently did a transplant on Moes WS-US-RF 3 Gang Switch.
The steps are here: https://www.dropbox.com/s/aogeu8w2q4neipy/Moes%20WS-US-RF%20ESP12F.pdf?dl=0
The TL;DR of it is:

  1. Remove the WB2S board
  2. Solder and glue an ESP12 (or any other board you would like to use)
  3. In Tasmota configure the ESP to be a Tuya MCU device.
  4. In Tasmota console run Backlog TuyaMCU 11,1; TuyaMCU 12,2; TuyaMCU 13,3

Hope it helps someone

1 Like

This is how I configured my ESP01s in ESPHome:

switch:
  - platform: gpio
    pin: GPIO3
    name: $devicename Relay

  - platform: gpio
    pin: GPIO0
    inverted: yes
    name: $devicename LED
# Relay GPIO3
# LED GPIO0


binary_sensor:
  - platform: gpio
    pin:
      number: GPIO2
      mode: INPUT_PULLUP
      inverted: True
    name: $devicename Internal_SW
  - platform: gpio
    pin:
      number: GPIO1
      mode: INPUT_PULLUP
      inverted: True
    name: $devicename External_SW
# Internal SW GPIO2
# External SW GPIO1

Works like a charm - no crashes, no BOOT time relay flips.

The perfect replacement for the WB2S is the TYWE2S, I got some from aliexpress here: https://de.aliexpress.com/item/1005001878249378.html?spm=a2g0s.9042311.0.0.5f574c4dCiXkcr

Its a mechanically plug an play replacement. Unsoldering the WB2S is done in seconds with a fire lighter under the pads.

I had to flash the new chips before soldering in place, tuyaconvert was also failing on them. But no problem with serial wires.

replace-esp-wb2s-tywe2s

2 Likes

So DETA makes a range of smart devices, their “GRID” range.

Previously, they used ESP8266 based chipsets, but it seems their latest ones use the WB2S (BK7231) chip.

I got one of their powerboards, and took some photographs of the chip:

I assume this is the chip that needs to be swapped out for the TYWE2S, correct?

@he-so You mention that you flashed it beforehand with serial wires - can you provide some more details about that? Did you just use Tasmotizer for that? How did you secure the serial wires to the chip?

And afterwards, how would you configure all the features like switching, and power monitoring in Tasmota?

1 Like

Yes, that’s the chip to replace. For flashing, you can use esp-tool or any other serial flashing software with a usb2serial converter (ftdi, etc.). You need to wire GND, VCC(Bat.), RX and TX. And GPIO0 needs to be grounded.

I used these DuPont test clamps:

Because soldering wires to the pads makes them too thick to insert the chip into the slot in the main board afterwards, so using the clamps was advantageous in this point of view. No excess lead.

Regarding the tasmota config, that highly depends on the features of your board. See the tasmota manual.

Hi Daniel, I cannot open the link with the steps.
Can you re-share?
How did you desolder the WB2S from the glass PCB?

Thanks!

Sorry, I didn’t realize that filebin links are not permanent.
Here is a new link to the PDF: https://www.dropbox.com/s/aogeu8w2q4neipy/Moes%20WS-US-RF%20ESP12F.pdf?dl=0
Let me know if you still have issues with it.
I removed the WB2S with a heat gun, but you need to be very careful not to lift any pads. If I understand correctly there is adhesive under the WB2S, so perhaps using IPA can soften the adhesive and make the removal of the soldered connections easier and quicker. Ping me with any questions you have.

@he-so Oh, those leads look neat.

I’m trying to work out from the photos how they work.

I found a similar item from Amazon (US):

https://www.amazon.com/DAOKI-Electronic-Experiment-Dupont-Female/dp/B081VFHBMS/

From what I can tell - it’s just a loop, right? How do you secure that onto the tracks at the bottom of the TYWE2S?

Hi, when you push it, the two clamps come out of the housing. When you release it, they grab whatever is in between.

See the photo. The tywe boards have 5 pads on the one side and 6 on the other. So, when you carefully place them, there is not short circuit.

!

And, yes, its a bit tricky to connect all of them plus the GPIO0 for flash mode. See the bottom side here:

1 Like

Hi guys, lets agree, relay boards are easy to hack :wink:
Next step: dimmers. I have the S1-B (WT) dimmer - which seems to be the only leading/trailing edge dimmer with Wifi afaik. It works with the TUYA app.
Anyway this one has also got the WB2S. I tried to replace it with ESP but I couldn’t communicate with it (Tasmota->TuyaMCU and so on). It uses 5 pins: GND, Vcc, Rx,Tx, and CEN (which is equal to RES).! Does anyone have a clue which steps to follow, to get the right commands to make it dim or do anything? Plan B would be to not communicate with the STM but rather directly trigger the Mosfets like in this tutorial https://www.instructables.com/DIY-Trailing-Edge-Dimmer/

Since I’m new here, another post for the second pic. I did some homework…

1 Like

Hello! I bought few switches MS-101 from Moes. I found WA2 in them. Replacing to another module I didn’t want to do. And found a way to connect them to the homeassistant, and it works without the Internet and Tuya’s cloud servers.
localtuya is good solution. But first you need to know DeviceID and LocalKey of each device

2 Likes

Agreed, after researching about this chip, the easiest option for me has been to use Local Tuya on HA. Now it works flawlessly!

Hi did you have any advance on converting thi UFO-R2-RF device?
It is the only one I’v found to work with IR and RF 433 and RF315 at the same time and in a very small form factor.

Its just what I need, but would be perfect if it could be converted.