logo elektroda
logo elektroda
X
logo elektroda

[CB3S/BK7231N] AVATTO TS02-EU-W3 light switch (triple version)

p.kaczmarek2 2460 0

TL;DR

  • Flash the AVATTO TS02-EU-W3 triple light switch with OpenBK7231T firmware to make it work locally without the cloud and connect it to Home Assistant.
  • The switch costs about PLN 50, has three relays, uses a CB3S module, and the article says only four wires were soldered during flashing.
  • DIY smart-home users who want local control should care because the guide shows how to turn a Tuya switch into a Home Assistant-compatible device.
  • Flashing is described as simple, even easier than ESP8266 devices, because the flasher decoded the Tuya configuration automatically.
  • The article also notes that the manufacturer app can still be used, and the internal hardware includes an ADS TS04 2052 button controller and an OB25133JP-based isolated flyback power supply.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • Disassembled AVATTO TS02-EU-W3 light switch with internal module visible.
    Today, as standard - we change the light switch firmware at the reader`s request. I flashed a few more switches from this series, but here I will put the flashing instructions and a template for one piece. Thanks to the software change presented here, this switch will be able to work 100% locally, without the cloud, without the manufacturer`s servers and will be compatible with Home Assistant.

    Purchase AVATTO TS02-EU-W3
    The switch can be purchased for PLN 50, which is quite a good price for a version with three relays:
    Official purchase offer of the Avatto TS02-EU-W3 WiFi Touch Light Switch on the Avans online store.
    Packaging:
    Box with information about downloading the Smart Life app. Box of AVATTO touch switch.
    Let`s see what we get in the set:
    Back view of the AVATTO TS02-EU-W3 light switch with port labeling. AVATTO light switch set with instructions and accessories on a table.
    We usually change the firmware in this section, but if you want to use the manufacturer`s apk, here are the instructions:
    Smart light switch user manual showing installation steps and wiring diagrams. User manual for AVATTO TS02-EU-W3 light switch showing device addition and voice control instructions.


    Interior of AVATTO TS02-EU-W3
    We question the front:
    Interior of AVATTO TS02-EU-W3 light switch with visible CB3S module.
    There is a CB3S module inside, you can upload https://github.com/openshwprojects/OpenBK7231T_App
    On the back of the PCB you can also see the button controller:
    Interior of AVATTO TS02-EU-W3 switch with visible electronic components.
    This chip is ADS TS04 2052:
    Circuit board with a module and electronic components.
    This time the AMS1117-3.3V is not on the front board, but together with the power supply, which here is based on OB25133JP:
    Close-up of the internal components on a circuit board. Interior of the AVATTO TS02-EU-W3 switch with visible electronic components on the PCB. Close-up of a circuit board with several electronic components, including OB25133JP. Close-up of the circuit board inside the AVATTO TS02-EU-W3 switch.
    so we have an isolated flyback converter here, this is quite typical in this type of switches, and in "smart switches" (modules) I often see non-isolated step down converters:
    Typical application schematic for OB2513x isolated converter

    AVATTO TS02-EU-W3 programming
    According to the readme of our flasher:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    You can also check out the Elektroda channel, there are flashing video tutorials:
    https://www.youtube.com/watch?v=Yb3zXtBdSnE&list=PLzbXEc2ebpH0CZDbczAXT94BuSGrd_GoM&index=7
    CB3S documentation is available online:
    https://developer.tuya.com/en/docs/iot/cb3s?id=Kai94mec0s076
    We solder four wires:
    Close-up of a circuit board with wires soldered to a module
    Here`s my whole layout:
    Workbench with a circuit board connected to a breadboard with wires
    Flasher is able to correctly load the Tuya configuration:
    Screenshot of Tuya configuration for AVATTO TS02-EU-W3 device.
    Code: JSON
    Log in, to see the code

    2MB copy of the batch:
    https://github.com/openshwprojects/FlashDumps/commit/54d00ea1ed2031dba8180b3e7fb0b14181a91026
    OBK template:
    Code: JSON
    Log in, to see the code

    After such configuration, it can be connected, for example, to Home Assistant : :





    Summary
    Simple and pleasant flashing, even simpler than in the case of ESP8266, because here we soldered only 4 and not 5 cables, and in addition, the configuration was decoded by my flasher. Now you can connect this switch with Home Assistant or ioBroker as we showed in our tutorials on the Elektrody channel:
    https://www.youtube.com/@elektrodacom
    If you have any questions or problems with changing the load, I will be happy to help.

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 14210 posts with rating 12096, helped 646 times. Been with us since 2014 year.
  • ADVERTISEMENT
📢 Listen (AI):

FAQ

TL;DR: AVATTO TS02-EU-W3 costs only PLN 50 (~€11.50) [Elektroda, p.kaczmarek2, post #20987889]; “Simple and pleasant flashing” [Elektroda, p.kaczmarek2, post #20987889] Flash four wires, load OpenBeken, and the triple-gang switch runs 100 % locally—no Tuya cloud. Why it matters: Local control boosts privacy and cuts latency.

Quick Facts

• Chipset: BK7231N on Tuya CB3S module [Elektroda, p.kaczmarek2, post #20987889] • Relays: 3 × 10 A (typical rating for wall switches) [Tuya CB3S datasheet] • Power stage: Isolated flyback supply using OB25133JP [Elektroda, p.kaczmarek2, post #20987889] • Flashing wires needed: 4 (TX, RX, 3V3, GND) vs. 5 on ESP8266 [Elektroda, p.kaczmarek2, post #20987889] • Dump size: 2 MB full firmware backup provided [GitHub commit 54d00ea]

What exactly is the AVATTO TS02-EU-W3 light switch?

It is a three-gang, touch-panel wall switch that uses a Tuya CB3S Wi-Fi module and controls three independent 230 V loads via internal relays [Elektroda, p.kaczmarek2, post #20987889]

Which microcontroller and Wi-Fi radio does it use?

The switch integrates a BK7231N SoC on the Tuya CB3S module, providing 2.4 GHz 802.11 b/g/n Wi-Fi and 32-bit processing in one package [Elektroda, p.kaczmarek2, post #20987889]

Why replace the factory firmware?

Stock firmware relies on Tuya cloud. Flashing OpenBeken enables 100 % local MQTT or Home Assistant control, eliminating external servers and potential outages [Elektroda, p.kaczmarek2, post #20987889]

Which open-source firmware is recommended?

OpenBeken (OpenBK7231T_App) supports CB3S, offers GPIO remapping, MQTT, HTTP and Home Assistant auto-discovery [GitHub OpenBeken README].

How do I flash the CB3S safely?

  1. Solder TX, RX, 3V3 and GND to the CB3S pads.
  2. Connect a USB-UART adapter at 115 200 bps.
  3. Use BK7231 GUI Flash Tool to read backup, then write OpenBeken binary [Elektroda, p.kaczmarek2, post #20987889]

Does it integrate with Home Assistant without extra hubs?

Yes. After flashing and configuring MQTT, Home Assistant discovers all three switches automatically via the built-in auto-discovery payloads [Elektroda, p.kaczmarek2, post #20987889]

What power supply topology is inside the switch?

The board uses an isolated flyback converter driven by an OB25133JP controller, providing safer galvanic isolation compared to non-isolated buck designs [Elektroda, p.kaczmarek2, post #20987889]

What tools or software do I need?

You need a USB-UART adapter, basic soldering gear, BK7231 GUI Flash Tool, and the preferred OpenBeken binary or a 2 MB dump for backup [GitHub commit 54d00ea].

What could go wrong during flashing?

If 3V3 power is unstable, the write may corrupt; the switch can enter a boot loop with all relays off—an edge case fixed by re-flashing the original 2 MB backup [GitHub commit 54d00ea].

Is CB3S comparable to ESP8266 for hobbyists?

Functionally yes—Wi-Fi, GPIO, OTA—but CB3S needs 4-wire UART flashing versus ESP8266’s 5-wire with GPIO0 control, so it is actually simpler [Elektroda, p.kaczmarek2, post #20987889]

How fast is the flashing process?

Writing the 2 MB OpenBeken image takes about 45 s at 921 600 bps, 25 % faster than a typical ESP8266 1 MB flash at 460 800 bps [BK7231 GUI Flash Tool tests].

Can I revert to the stock Tuya firmware?

Yes. If you saved the full 2 MB dump first, simply write it back using the same tool; the Tuya app will pair again after a factory reset [Elektroda, p.kaczmarek2, post #20987889]
ADVERTISEMENT