logo elektroda
logo elektroda
X
logo elektroda

Changing the firmware of the Avatto N-TS10-W1 light switch and searching for GPIO roles in GPIODocto

p.kaczmarek2 1962 0
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • Parts of Avatto N-TS10-W1 WiFi wall switch on a wooden table
    In this topic, I will modify the N-TS10-W1 light switch based on the CB3S module. In contrast to previous switches In this series, however, it will not be possible to automatically configure GPIO based on the Tuya partition, so I will have to discover it myself using the GPIODoctor tool, which I will also present here.


    Purchase Avatto N-TS10-W1
    This switch probably only distinguishes the unusual style of the front. At least it is not disfigured with the manufacturer`s logo, as is the case with, for example, the QTouch brand. The switch itself belongs to the N-TS10 series and costs PLN 70 in our country:
    WiFi touch light switch N-TS10 with smartphone app.
    Product description - as usual - but we will change the firmware anyway, because I tested the Tuya application a long time ago:
    AVATTO N-TS10-W1 light switch with voice and smartphone control features.
    Specifications, dimensions, etc.:
    Technical specifications: type, color, range, dimensions, communication, features.
    Here, I have a plus for the seller for writing "no data available" within WiFi range, it`s probably better than declaring values that are then not reflected in practice. WiFi is quite capricious and its reliability does not come close to that of a cable.
    White light switch Avatto N-TS10-W1 in disassembled form on a white background, showing internal components. Next to it are three assembled switches on a blue background.
    What we get in practice:
    Avatto Smart Home box on a wooden surface. White packaging of the Avatto N-TS10-W1 light switch with QR code, certifications, and Made in China text. White box with an informational label on one side.
    It seems that the importer tried to print his own print on the carton cover, and the carton is already without the Avatto name, typical:
    Cardboard packaging with a sticker of the Avatto N-TS10-EU-W1 product in white color.
    Full name: N-TS10-EU-W1
    Instruction:
    Installation and operation manual for the Avatto N-TS10-W1 light switch. User manual for Avatto N-TS10-W1 WiFi light switch
    However, the instructions are in Polish, not bad, someone made an effort.
    Set contents:
    Avatto N-TS10-EU-W1 set with wall switch and manual. Box with WiFi wall switch and user guide WiFi wall switch set with manual and mounting components
    The set also includes a second manual, already in English:
    User manual for a WiFi smart wall switch English instruction leaflet for setting up the Avatto N-TS10-W1 device. Photo of user manual with Amazon Alexa and Google Home apps.
    Mounting screws are present.


    Interior of Avatto N-TS10-W1
    We release four catches:
    Interior of the Avatto N-TS10-W1 light switch and mounting part.
    There is a CB3S module with BK7231 inside, you can load OpenBeken.
    View of the internal PCBs of the Avatto N-TS10-W1 switch
    The board with the power supply is typical, the system powers DP2525, this board also has a 3.3V AMS1117 LDO, because the power supply itself generates 5V for the relay.
    Printed circuit board of the Avatto N-TS10-W1 switch, version YD3L_WF_DV5, with visible electronic components.
    One row of connectors on the side is for mechanical support only, the other provides a connection to the front board.
    Close-up of a circuit board with visible electronic components.
    On the other side you can see a relay for the mentioned 5V and a nice accent is also a varistor, manufacturers do not always provide it, there is a fuse resistor as usual.
    Electronic components on a green printed circuit board. Close-up of a circuit board with electronic components for a light switch.
    I also see room for additional relays.
    Another front plate, touch buttons support BA04T1:
    Close-up of the Avatto N-TS10-W1 circuit board with visible electronic components.
    PCB designation YD3L_WF_DV5 20221118:
    Close-up of a circuit board with YD3L_WF_DV5 markings and electronic components.
    After connecting the power supply, we see that we have two colors of the LED:
    Close-up of the internal components of a light switch with a visible blue LED. Close-up of the interior of an Avatto N-TS10-W1 switch with visible electronic module.

    Avatto N-TS10-W1 firmware change
    Now let`s try to load OpenBeken to free this switch from the cloud.
    For previous products in this series, the process was quite simple:
    [CB3S/BK7231N] AVATTO TS02-EU-W3 light switch (triple version)
    I also wanted to repeat it here, according to the flasher`s instructions:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Interior of a light switch with electronic components connected to a breadboard. CB3S module from Avatto N-TS10-W1 light switch connected to a breadboard.
    Just see the CB3S pins on the Tuya website and connect the USB to UART converter to TX1/RX1 and connect the 3.3V power supply:
    https://developer.tuya.com/en/docs/iot/cb3s?id=Kai94mec0s076
    It was possible to upload the batch, but this time it was not possible to read the GPIO configuration/template from Tuya.
    In such a situation, use the GPIO Doctor tool located in the Web App:
    Interface of the GPIO Doctor tool showing pin configuration.
    We examine each pin in turn:
    Screenshot fragment of a diagnostic tool with GPIO settings for a light switch.
    However, the result disappointed me a bit. We only have 3 GPIOs to control here:
    - P8 - has a relay and both LEDs, blue and red, depending on whether the state is high or low
    - P26 - green led, e.g. for WiFi
    - P10 - button (touch button)
    OBK template:
    Code: JSON
    Log in, to see the code

    Template import instructions can be found on the Elektroda.com YouTube channel:





    Summary
    Changing the firmware was quite easy. The template could not be generated automatically, but I created it for you manually. However, I don`t like the fact that the diodes indicating the relay status are on the same GPIO as the relay, so they cannot be easily disconnected, modifying the software will not help, you would have to operate on the PCB. In addition - no complaints, you can easily modify this product and pair it later, among others. With Home Assistant .

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

FAQ

TL;DR: For CB3S/BK7231N owners, this FAQ maps 3 GPIOs and explains why manual discovery matters: "we only have 3 GPIOs to control here." It helps you flash OpenBeken on the Avatto N-TS10-W1 when the Tuya partition does not yield an automatic template, then apply a working relay, button, and Wi‑Fi LED pin map. [#21036407]

Why it matters: This switch is easy to reflash, but its GPIO layout must be identified manually, which determines whether OpenBeken works correctly after installation.

Model Firmware flashing GPIO discovery Result
Avatto N-TS10-W1 Easy on CB3S/BK7231N Automatic template read failed Manual GPIODoctor mapping needed
Avatto TS02-EU-W3 Simple in the earlier thread Simpler process Prior method was easier

Key insight: The working OpenBeken template is simple: P8 drives the relay and relay-status LEDs, P10 is the touch button, and P26 is the Wi‑Fi LED. The main limitation is hardware-level LED sharing on P8. [#21036407]

Quick Facts

  • The Avatto N-TS10-W1 was listed at PLN 70 in Poland and uses a CB3S module with a BK7231 chip, making it a practical OpenBeken conversion target. [#21036407]
  • The internal power section uses DP2525 for the supply path and an AMS1117 3.3V LDO because the supply itself provides 5V for the relay. [#21036407]
  • The discovered GPIO map is compact: P8 = relay + blue/red status LEDs, P10 = touch button, P26 = green Wi‑Fi LED. [#21036407]
  • The PCB is marked YD3L_WF_DV5 20221118, and the housing opens by releasing four catches, which matters for non-destructive disassembly. [#21036407]
  • The board includes a varistor and a fuse resistor, and the author also noted visible space for additional relays on the hardware. [#21036407]

How do I flash OpenBeken onto an Avatto N-TS10-W1 light switch with a CB3S/BK7231N module?

Flash it through the CB3S UART pins, then finish configuration manually. 1. Open the switch by releasing the four catches. 2. Connect a USB-to-UART adapter to TX1/RX1 on the CB3S and power it with 3.3V. 3. Upload OpenBeken with the flasher, then use GPIODoctor because the GPIO template was not read automatically on this model. [#21036407]

Why can't the Avatto N-TS10-W1 GPIO template be read automatically from the Tuya partition like on some other Avatto switches?

This unit did not expose a readable GPIO configuration from the Tuya partition, even though earlier Avatto switches in the series did. The firmware upload itself worked, but automatic template extraction failed on the N-TS10-W1, so the pin roles had to be discovered manually in the OpenBeken Web App with GPIODoctor. [#21036407]

What is GPIODoctor in OpenBeken, and how does it help identify GPIO roles on a BK7231N device?

"GPIODoctor" is an OpenBeken Web App diagnostic tool that probes GPIO pins one by one, revealing what each pin controls on the target device. On this BK7231N switch, it exposed only 3 useful control lines and let the author assign the relay, touch button, and Wi‑Fi LED without relying on Tuya partition data. [#21036407]

Which GPIO pins on the Avatto N-TS10-W1 control the relay, touch button, and WiFi LED?

The working map is P8 for the relay and both relay-status LEDs, P10 for the touch button, and P26 for the green Wi‑Fi LED. The author’s final OpenBeken template assigns Rel;1 to GPIO 8, Btn;1 to GPIO 10, and WifiLED_n;1 to GPIO 26. [#21036407]

How do I connect a USB-to-UART adapter to the CB3S module on the Avatto N-TS10-W1 for firmware flashing?

Connect the adapter directly to the CB3S module’s TX1 and RX1 pins and power the module from 3.3V. The thread explicitly states to use a USB-to-UART converter on TX1/RX1 and a 3.3V supply, following the standard CB3S pinout approach shown in the flasher instructions. [#21036407]

What is the CB3S module, and why is it commonly used in Tuya-based smart switches?

"CB3S" is a Tuya Wi‑Fi module that carries a BK7231 chip and provides the main wireless control platform inside the switch, including UART access for reflashing. In this Avatto unit, the CB3S made OpenBeken installation possible because the board exposes the module and its TX1/RX1 pins for serial flashing. [#21036407]

What is the BK7231N chip, and how is it supported by OpenBeken?

BK7231N is the microcontroller inside the CB3S module in this switch, and OpenBeken can be loaded onto it. The thread shows a successful OpenBeken upload to the BK7231-based hardware, then a manual GPIO role discovery process to complete the setup when auto-template reading did not work. [#21036407]

Why are the relay status LEDs on the Avatto N-TS10-W1 tied to the same GPIO as the relay, and what does that mean for customization?

They are tied together in hardware on P8, so software alone cannot separate their behavior. On this board, P8 drives the relay and both blue and red status LEDs, which means custom LED behavior requires PCB-level modification rather than only changing the OpenBeken configuration. [#21036407]

How can I import the OpenBeken template for the Avatto N-TS10-W1 after flashing the firmware?

Import the provided JSON template into OpenBeken after the firmware boots. The thread includes a complete template for the N-TS10-W1 with vendor Avatto, chip BK7231N, board CB3S, and pins 8, 10, and 26 already assigned, plus a video link showing the import process. [#21036407]

What power supply components are used inside the Avatto N-TS10-W1, including DP2525 and AMS1117, and what do they do?

The switch uses DP2525 in the power-supply section and an AMS1117 LDO for 3.3V regulation. The thread states that the supply itself generates 5V for the relay, while the AMS1117 provides 3.3V for the logic side, which matches the CB3S module’s low-voltage operation. [#21036407]

Avatto N-TS10-W1 vs Avatto TS02-EU-W3: what changes in the flashing and GPIO discovery process?

The flashing method stayed easy, but GPIO discovery became harder on the N-TS10-W1. On the earlier TS02-EU-W3, the process was described as quite simple, while this N-TS10-W1 could not generate a template automatically from Tuya data and required manual pin testing with GPIODoctor. [#21036407]

What should I check if OpenBeken flashes successfully on a CB3S switch but the GPIO mapping is still unknown?

Check each GPIO manually in GPIODoctor and verify visible functions one by one. On this model, that process found only 3 useful control pins: P8 changed relay and status LED behavior, P26 controlled the green Wi‑Fi LED, and P10 matched the touch button. The key failure case is successful flashing with no usable automatic template. [#21036407]

How can I integrate an Avatto N-TS10-W1 running OpenBeken with Home Assistant after replacing Tuya firmware?

Pair it after flashing and template import, then connect it to Home Assistant through the usual OpenBeken workflow. The thread’s conclusion says the product can be modified easily and later paired with Home Assistant, which is the practical reason for replacing the original Tuya cloud firmware. [#21036407]

What safety precautions should I take when opening and powering an Avatto wall switch during UART flashing and testing?

Open the housing carefully, power only the logic side with 3.3V during UART work, and avoid casual mains testing on the exposed board. This switch contains a relay supply section, a fuse resistor, and a varistor, so the safe bench path is the low-voltage CB3S serial connection rather than powering the full wall switch loosely while probing. [#21036407]

How do the blue, red, and green LEDs behave on the Avatto N-TS10-W1, and how can I verify their functions with GPIODoctor?

Blue and red share P8 with the relay, while green uses P26 as the Wi‑Fi indicator. The author notes that P8 changes between blue and red depending on high or low state, and P26 controls the green LED. You can verify this by probing pins individually in GPIODoctor and watching each LED response during the test cycle. [#21036407]
Generated by the language model.
ADVERTISEMENT