logo elektroda
logo elektroda
X
logo elektroda

[CBU/BK7231N] AVATTO WSM16-W1 WiFi relay module for PLN 30 - firmware change

p.kaczmarek2 2733 2

TL;DR

  • The AVATTO WSM16-W1 WiFi relay module was modified to work fully locally with Home Assistant instead of depending on Tuya cloud servers.
  • Inside, the compact design uses a non-isolated OB2525 converter, an extra 3.3V step-down stage, and a side-mounted relay to fit the small housing.
  • The module uses a CBU board with BK7231N, and the flasher automatically detected the Tuya configuration on P8, P6, P14, and P20.
  • Firmware replacement required soldering four wires, and the author recommends setting PowerSave 1 to reduce startup stress and possible capacitor wear.
  • Bought for less than PLN 30, the module was considered a good value after the firmware change worked hassle-free.
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • WSM16-W1 Wi-Fi switch module with visible connectors and technical markings.
    Today we are modifying another relay module for the box so that it works 100% locally, regardless of the manufacturer`s servers. Then we will also pair it with Home Assistant. This modification was made for a reader who sent me a set of gadgets that I haven`t described yet so that we could expand our electrode list of IoT device interiors .

    Purchase of WSM16-W1
    The module was purchased quite cheaply - less than PLN 30:
    Product page of Tuya WSM16-W1 switch showing the device and a smartphone.
    The description has standard Tuya talk:
    Image of the AVATTO WSM16-W1 smart switch and a phone with an app.
    What also catches my eye is that the description includes the version 250W and we got the versions 800W , I wonder if both versions have the same interior?
    Parameters:
    Table with parameters of a smart switch.
    Packaging:
    Packaging of WSM16-W1 relay module on a wooden background Box of AVATTO WSM16-W1 module on a wooden surface.
    The contents of the set (well, there is a plastic mounting with hooks):
    WSM16-W1 Wi-Fi switch module, manuals, and packaging on a wooden surface.
    Instruction:
    Smart module user manual with illustrations and QR codes. User manual for WSM16-1 module showing technical specifications. User manual for Avatto WSM16-W1 smart Wi-Fi switch. WSM16-W1 module instruction manual with diagrams and text.


    Interior of WSM16-W1
    We question the casing:
    Interior view of the WSM16-W1 electronic module with electronic components on a green PCB.
    Inside there is again a non-isolated converter based on OB2525. I also see a fuse resistor and a step down converter (U2), because OB2525 only provides 5V, and I need to generate another 3.3V for the WiFi module:
    Close-up of the PCB of the WSM16-W1 module showing electronic components. Close-up of a circuit board with electronic components.
    In this case, it was extremely difficult to remove the PCB from the other half of the housing. I had to gradually pry from each side.
    WSM16-W1 relay module with visible electronic components, including a relay, capacitors, and a terminal block.
    Inside is the CBU module:
    https://developer.tuya.com/en/docs/iot/cbu-module-datasheet?id=Ka07pykl5dk4u
    You can upload:
    https://github.com/openshwprojects/OpenBK7231T_App
    The whole thing is packed very tightly, the capacitor and the coil are specially placed:
    Close-up of the WSM16-W1 module with electronic components on a wooden background.
    In order to reduce the thickness of the module, the clever manufacturer placed the relay on its side:
    Close-up view of an electronic relay module with FANHAR markings.

    ADVERTISEMENT



    Changing the WSM16-W1 load

    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
    CBU documentation is available online:
    https://developer.tuya.com/en/docs/iot/cbu-module-datasheet?id=Ka07pykl5dk4u
    We solder four wires, first whiten the pads:
    Close-up of the CBU electronic module with soldered components on the PCB. Close-up of the WSM16-W1 module with visible electronic components on the PCB.
    Soldered:
    Close-up of the interior of the WSM16-W1 module with connected wires.
    Whole flashing system:
    WSM16-W1 module connected to a breadboard with several wires.
    Flasher correctly detects Tuya configuration:
    Screenshot showing the BK7231 Easy UART Flasher interface extracting JSON configuration for a device module.
    JSON:
    Code: JSON
    Log in, to see the code

    Verbal description:
    
    Device configuration, as extracted from Tuya: 
    - Pair/Toggle All Button on P8
    - WiFi LED on P6
    - TglChannelToggle (channel 1) on P14
    - Relay (channel 1) on P20
    Device seems to be using CBU module, which is using BK7231N.
    And the Tuya section starts, as usual, at 2023424
    

    OBK template:
    Code: JSON
    Log in, to see the code

    Uploading a template:



    Configuration with HA:



    This device probably needs to be entered as well PowerSave 1 to short startup command, otherwise we will have to replace the capacitor after a few months, as in this topic: https://www.elektroda.pl/rtvforum/topic3898805.html

    Summary
    The manufacturer has made every effort to pack this module into a small housing. Even the relay was specially mounted "on the side", so as not to increase the height of the module. Similarly with the coil and capacitor.
    Changing the firmware was, as usual, hassle-free, just solder four cables and the configuration was automatically detected by my flasher again.
    For such money - I can recommend this module.

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 14612 posts with rating 12630, helped 655 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 21781898
    divadiow
    Level 38  
    Posts: 5059
    Help: 438
    Rate: 893
    interesting your extraction seems to suggest there's an RF version. I don't see evidence yours have an RF chip

    "remote_io":"23",
  • #3 21782134
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14612
    Help: 655
    Rate: 12630
    Nice finding. I seem to remember that there was some other version of this device around, it had a 3 pin female connector for external RF receiver.... maybe this?
    Wi-Fi Tuya RF smart controllers for blinds and shutters with prices shown
    BLOW WiFi roller shutter controller with Tuya app on smartphones
    BLOW WiFi roller shutter controller on a glass surface
    but I haven't found how the RF module addon for that looks like.
    Helpful post? Buy me a coffee.
📢 Listen (AI):

FAQ

TL;DR: With 4 wires and the quote "works 100% locally," this FAQ helps AVATTO WSM16-W1 owners replace Tuya firmware on a CBU/BK7231N relay, recover its pin map, and prepare Home Assistant use without relying on vendor cloud servers. [#21017766]

Why it matters: This relay is cheap, compact, and flashable, but its mains-powered, non-isolated design makes correct wiring, template setup, and safe handling essential.

Variant or option What the thread shows Practical takeaway
Listing version 250 W appears in the description Store listing may not match the opened unit
Received unit 800 W marking on the purchased module Internal inspection was done on this version
RF-capable variant mention Later photos show a 3-pin connector for an external RF receiver Some hardware revisions may expose extra remote features

Key insight: The most valuable result is not just successful flashing. It is the extracted Tuya map: P6 LED, P8 button, P14 toggle input, and P20 relay, which lets OpenBeken work quickly on this model. [#21017766]

Quick Facts

  • The module was bought for less than PLN 30, making it a low-cost candidate for local-control firmware replacement. [#21017766]
  • The opened unit combines an OB2525 mains supply that provides 5 V with a separate step-down stage for the WiFi module’s 3.3 V rail. [#21017766]
  • The flashing setup uses 4 wires, and the flasher auto-detected a Tuya configuration for a CBU / BK7231N device. [#21017766]
  • The extracted map is concrete: P6 = WiFi LED, P8 = pair/toggle-all button, P14 = channel toggle input, P20 = relay. [#21017766]
  • The JSON also exposes remote_io on pin 23, which later discussion links to a possible RF-capable hardware revision with a 3-pin external receiver connector. [#21782134]

How do I flash OpenBK7231T_App onto an AVATTO WSM16-W1 relay module with a CBU/BK7231N chip?

You flash it by opening the module, soldering 4 programming wires to the CBU pads, and using BK7231GUIFlashTool until it detects the Tuya layout. 1. Tin the pads first. 2. Solder the four wires and connect the flashing setup. 3. Read the detected configuration, then upload OpenBK7231T_App for BK7231N. The thread shows this process working cleanly on the WSM16-W1 and links the firmware repository and video guide. [#21017766]

What is the CBU module in Tuya devices, and how is it related to the BK7231N WiFi chip?

The CBU module is the Tuya radio module used on this relay, and this unit uses a BK7231N inside it. "CBU" is a Tuya WiFi/Bluetooth module that hosts the device firmware and exposes GPIO pins, while BK7231N is the Beken system-on-chip used on that module. In the thread, the board is identified as CBU, and the extracted configuration states the device uses BK7231N. [#21017766]

Which pins and functions should I set in an OpenBeken template for the AVATTO WSM16-W1 single switch module?

Set P6 to WifiLED_n, P8 to Btn_Tgl_All, P14 to TglChanOnTgl for channel 1, and P20 to Rel for channel 1. The posted OpenBeken template names the device "AVATTO single switch module" and identifies the chip as BK7231N on a CBU board. That four-pin map is the key configuration detail for a working template on this model. [#21017766]

Why does the AVATTO WSM16-W1 use both an OB2525 power supply and a separate 3.3 V step-down converter?

It uses both because the OB2525 stage provides 5 V, while the WiFi module needs 3.3 V. The author explicitly notes that OB2525 alone only gives 5 V, so the board adds a second converter, marked U2, to generate 3.3 V for the wireless section. That split-rail design is common on compact smart relays with low-voltage logic. [#21017766]

What is a non-isolated converter in a mains-powered relay module, and what safety issues does it create during flashing and testing?

A non-isolated converter means the low-voltage side is not galvanically separated from mains. "Non-isolated converter" is a mains power-supply topology that drops voltage without isolation, so the logic side can stay electrically tied to live mains potential, creating shock risk during probing, flashing, and bench testing. This module uses a non-isolated converter based on OB2525, so you must treat the board as hazardous when opened. [#21017766]

What does the Tuya JSON extracted by BK7231GUIFlashTool mean for the WSM16-W1, including P6, P8, P14, and P20?

It means the flasher recovered the device’s GPIO role map from Tuya storage. In plain terms, P8 is the pair or toggle-all button, P6 drives the WiFi LED, P14 is the channel-1 toggle input, and P20 switches the relay. The thread also states the Tuya data section starts at 2023424, which helps confirm the tool found a valid configuration block. [#21017766]

Why is PowerSave 1 recommended on the AVATTO WSM16-W1 after installing OpenBeken, and how can it help capacitor lifespan?

PowerSave 1 is recommended to shorten startup command behavior and reduce stress on the power stage. The thread says this device likely needs PowerSave 1, otherwise the capacitor may need replacement after a few months, referencing a similar failure pattern from another topic. That makes PowerSave 1 a preventive reliability setting, not just a performance tweak. [#21017766]

What is the step-by-step process for soldering the four wires needed to program a CBU-based Tuya relay safely?

Use a controlled, minimal-heat process. 1. Open the case fully and expose the CBU pads. 2. Pre-tin or "whiten" the pads first, as shown in the photos. 3. Solder the 4 wires only after the pads are prepared, then attach the complete flashing rig. The thread stresses that the board is tightly packed, so careful pad preparation reduces the chance of lifted pads or accidental shorts. [#21017766]

How do I add a flashed AVATTO WSM16-W1 to Home Assistant after installing OpenBeken?

The thread’s workflow is to flash the firmware, upload the template, and then follow the linked Home Assistant configuration video. It does not provide typed HA steps, but it clearly shows a separate video for template upload and another for HA configuration. In practice, that means the thread supports HA integration on this exact device after OpenBeken installation. [#21017766]

What makes the PCB in the AVATTO WSM16-W1 hard to remove from the housing, and how can I open it without damage?

The PCB is hard to remove because the enclosure is very compact and grips the board tightly from multiple sides. The author says removal was "extremely difficult" and required gradual prying from each side rather than forcing one edge. Open it evenly and slowly, because the coil, capacitor, and sideways relay leave very little free space inside the shell. [#21017766]

How does the 250 W version of the AVATTO WSM16-W1 compare with the 800 W version internally, and do they likely use the same hardware layout?

The thread does not confirm that the 250 W and 800 W versions share the same internals. It notes that the listing mentioned 250 W, while the received units were marked 800 W, and then asks whether both versions have the same interior. Only the 800 W-marked unit was opened, so any hardware match remains unverified in this discussion. [#21017766]

Why does the extracted Tuya configuration mention remote_io on pin 23, and what does that suggest about an RF-capable version of the device?

It suggests the firmware family includes support for a remote or RF-related input path. A later reply highlights remote_io:"23", and the follow-up points to another version of the device that appears to include a 3-pin female connector for an external RF receiver. That makes pin 23 a strong clue that some WSM16-W1 variants were designed for RF expansion. [#21782134]

Where can I find documentation for the RF-enabled variant of the AVATTO WSM16-W1, including the version with a 3-pin connector for an external RF receiver?

You cannot find full documentation in this thread. The later post shows photos of a version with a 3-pin female connector and says it may be for an external RF receiver, but it also states that the RF addon documentation or module details were not found. The thread therefore gives visual evidence of the variant, not a complete technical reference. [#21782134]

What is BK7231GUIFlashTool, and how does it auto-detect Tuya configuration on BK7231N-based modules?

BK7231GUIFlashTool is the flasher used here to read and program BK7231-based Tuya modules. "BK7231GUIFlashTool" is a flashing utility that reads firmware regions on BK7231 devices, extracts stored Tuya settings, and presents the GPIO mapping needed to build an OpenBeken template. In this case, it correctly detected the WSM16-W1 configuration and produced both JSON and a verbal pin description. [#21017766]

Which firmware is better for a Tuya CBU relay module like the AVATTO WSM16-W1: the stock Tuya firmware or OpenBeken for fully local control?

OpenBeken is better if you want fully local control and Home Assistant use without vendor servers. The author’s goal was to make the relay work "100% locally," then pair it with Home Assistant, and the flashing process was described as hassle-free after soldering 4 wires. Stock Tuya firmware remains the default cloud-oriented option, but the thread clearly favors OpenBeken for local ownership and customization. [#21017766]
Generated by the language model.
ADVERTISEMENT