logo elektroda
logo elektroda
X
logo elektroda

TEEPAAO Wi-Fi Curtain Switch Configuration for Non-Curtain Use - Setup Guide

keegiraido 2700 5
ADVERTISEMENT
📢 Listen (AI voice):
  • I bought this TEEPAO WI-FI Curtain Switch as second hand. It is designed for controlling electric curtains as its name says. One button for opening, one stop button, and one for closing curtains. It has controllable backlight. As I do not have such curtains I configured it to be as switch with 2 buttons and one extra button. This is the box:
    White box of TEEPAO curtain switch with Smart Touch Switch label. White box with certification markings and QR code. Photo of the label on the packaging of the TEEPAO WI-FI smart curtain switch.
    Front: TEEPAO WI-FI curtain switch with three buttons in a box.
    Back: TEEPAO WI-FI curtain switch with specification label.

    To open the switch, one has to use some sharp tool:
    Image showing the opening of a TEEPAO WI-FI curtain switch using a knife.
    The button plate is softly glued to the case with foam pieces. It can be easily removed like that:
    Image of the interior of a TEEPAO WI-FI curtain switch with visible circuit boards and a CB3S module.
    A closer look:
    Disassembled TEEPAO WI-FI curtain switch showing buttons and a wifi module CB3S.

    It has CB3S wifi module:
    Close-up of the CB3S wifi module with model number, P/N, S/N, and QR code.

    After removing the button plate one can see the back of button plate and solder side of power plate:
    TEEPAO WI-FI curtain switch circuit board with visible electronic components.

    Here is the pinout of wifi module:
    CB3S Wi-Fi module on a circuit board.

    To get out the power part one has to remove wire screws:
    Open casing with power board and screws on a white background.

    Closer look of both sides of the power plate:
    Close-up of the power board of the TEEPAO WI-FI curtain switch with electronic components. Close-up of the PCB board of the TEEPAO WIFI curtain switch with visible components.

    I tried to flash the device with tuya-cloudcutter without success. So I had to use wiring.

    Wiring to flash the device.
    The pins connecting the button plate with power plate has GND and 3.3V pins, so those do not have to be soldered. RX and TX have to be soldered. RX pin is connected to button control chip and this does not allow to flash new firmware. One has to desolder the button control chip pin 16 or cut through the wire between RX and this chip. There is always possibility also to remove the whole wifi plate or button control chip of course.
    I chose to desolder the pin 16 only:
    Close-up of a circuit board with electronic components and a chip.

    For flashing I used HW-597 USB to TTL module with CH340G chip. The power of this module was too weak to power the button plate, so I used a 5V to 3.3V power converter. I have had no such problem with PL2302 module.

    The pinout of HW-597 module from left to right is:
    5V (power)
    VDD (for choosing 5V or 3.3V TTL output)
    3V3 (power)
    TXD
    RXD
    GND

    As I told, the GND and 3.3V can be reached on pins of button plate <-> power plate connector. Pin 2 is ground and Pin 1 is 3.3V. Pin 2 is connected to HW-597 ground pin, Pin 1 is connected to AMS1117 5V to 3.3V converter chip which is soldered to the back of the power interruption switch (for initializing flashing). AMS1117 needs also the ground, so it is connected to ch-597 ground with a wire. RXD and TXD of wifi board are soldered to TXD and RXD of HW-597.
    USB module connected to the TEEPAO WI-FI curtain switch PCB with visible wire connections.

    I used BK7231 Easy UART Flasher. This software runs under Microsoft Windows. Fortunately my kid has one. At first windows did not recognize the usb to ttl converter and I started to search for it, but after a while the driver got installed without any special download. The flasher worked without any problems. Sorry for blurry picture. Forgot to focus.
    Screenshot showing the use of BK7231 Easy UART Flasher software for flashing firmware on a Windows 10 computer.

    After restart OpenBK booted up and I configured buttons, backlight and green led to be sure all are available. I will not go through this process, as I will provide json template where everything is already configured.
    OpenBK7231N user interface with control toggle buttons.

    This configuration allows to use the device as 2 way switch, while in ON state buttons glow. Middle button switches only its light and can be configured to do something else. Maybe switching both relays at the same time on or off. Backlight and green led can be only controlled from web with this config.

    Configuration json is attached: obkFF06494...43.json.gz (354 bytes)You must be logged in to download this attachment.

    Cool? Ranking DIY
    About Author
    keegiraido
    Level 2  
    Offline 
    keegiraido wrote 4 posts with rating 2. Been with us since 2024 year.
  • ADVERTISEMENT
  • Clarifying Rel_n and LED_n GPIO roles

    #2 20902971
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14707
    Help: 658
    Rate: 12772
    Hello, can you elaborate on what exactly is which GPIO? I slightly completed your template but it still seems quite mysterious:
    Code: JSON
    Log in, to see the code

    I assume that:
    - channel 1 - relay
    - channel 2 - middle button switches only its light
    - channel 3 - relay
    But I don't know what Rel_n with channel 20 on P9 and LED_n with channel 30 on P23 are doing. Maybe it's the backlight and the green LED?

    If you want to configure the middle button to do something by script then see:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    If you have any free LED then consider setting the WiFiLED_n role to show WiFi status.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • Relay 2 can be added with driver parts

    #3 20905212
    keegiraido
    Level 2  
    Posts: 4
    Rate: 2
    Hi,
    Thank you for asking!
    Sorry for the messy template. I am not familiar with templates and took it as it was.
    You are correct about channel 20 and 30. Here are the GPIO's:
    P7 btn 2 (channel 2)
    p8 btn 3 (channel 3)
    p9 backlight (inverted) (channel 20)
    p10 btn 1 (channel 1)
    p14 rel 1 + led for button 1
    p23 green led under button 1 (inverted) (channel 30)
    p24 rel 3 + led for button 3
    p26 led for button 2.

    btw,
    There is no relay for button 2, but it can be added. For this purpose relay itself, clamping diode, driving transistor and transistor input current limiting resistor are needed. Of course, decent output terminal would not do bad. Without terminal there is only place on pcb to solder wire for output of the relay.
  • ADVERTISEMENT
  • OpenBeken pin map and autoexec for Teekar curtain switch

    #4 21236706
    formeTA
    Level 3  
    Posts: 3
    Thank you for showing the details.
    Based on your Input I flashed a Teekar Smart touch curtain switch the same way (cutting Pin 16 and after flashing with openbk resolder the pin).
    I found various possible pin and autoexec.bat files for this CB3S Board with BK7231N Chip.

    Right know I use a part from the template from P.Kaczmarek2 for the pin setup.

    Code: JSON
    Log in, to see the code

    And the autoexec.bat from (Etersky) Wifi Roller Curtain Shutter Switch (WF-CS01) in the openbeken database.
    Code: Arduino
    Log in, to see the code


    I changed some data in autoexec.bat to meet the pin setup with the result, that I am able to
    open
    close
    stop
    curtain action via http.

    I am struggeling with the hard buttons on the switch. When I press
    open - > it does stop
    stop -> it does down
    down -> is does up

    The LED´s are mixed up also.
    I need some help to get the right setup for the hard buttons and for the led´s. I already searched the forum but couldn´t find a hint.
    Any support is appreciated. Thank you in advance.


    OpenBK7231N user interface with three curtain control buttons: Open, Stop, Close.
    @ElektrodaBot
  • ADVERTISEMENT
  • Button and LED pin mapping correction

    #5 21238586
    ElektrodaBot
    AI OpenAI ChatGPT4
    Posts: 8856
    Help: 362
    Rate: 950
    formeTA wrote:
    (...) own -> is does up

    The LED´s are mixed up also.
    I need some help to get the right setup for the hard buttons and for the led´s. I already searched the forum but couldn´t find a hint.
    Any support is appreciated. Thank you in advance.


    https://obrazki.elektroda.pl/8569711600_1727107905_thumb.jpg
    Thank you for providing detailed information about your Teekar Smart Curtain Switch setup. Based on your description, it seems that the button actions and LED behavior are not functioning as expected. Let's go through the steps to troubleshoot and correct the configuration.

    1. Button Configuration

    From your description, the button actions are reversed:
    - Pressing "Open" stops the curtain.
    - Pressing "Stop" closes the curtain.
    - Pressing "Close" opens the curtain.

    This suggests that the event handlers for the buttons are not correctly mapped to the physical buttons. Let's correct the button mappings in your `autoexec.bat` file.

    Current Button Pin Setup:
    - Pin 7: Button 2 (Close)
    - Pin 8: Button 3 (Stop)
    - Pin 10: Button 1 (Open)

    Correcting the Button Event Handlers:
    You need to adjust the `addEventHandler` commands to match the correct button actions. Based on your description, the correct mapping should be:

    Code: text
    Log in, to see the code


    This should ensure that pressing the "Open" button opens the curtain, the "Stop" button stops it, and the "Close" button closes it.

    2. LED Configuration

    You mentioned that the LEDs are also mixed up. The LED is connected to pin 23 and is inverted (`LED_n`), meaning that setting the pin to `0` turns the LED on, and setting it to `1` turns it off.

    Adding LED Control to the Actions:
    You can control the LED state in the `openAction`, `closeAction`, and `stopAction` sections of your `autoexec.bat` file. Here's how you can modify the actions to control the LED:

    - For `openAction`:
    Code: text
    Log in, to see the code


    - For `closeAction`:
    Code: text
    Log in, to see the code


    - For `stopAction`:
    Code: text
    Log in, to see the code


    3. Relay Configuration

    Ensure that the relays are correctly assigned to the curtain motor control. Based on your pin setup:
    - Pin 14: Relay 1 (Up)
    - Pin 26: Relay 2 (Stop)
    - Pin 24: Relay 3 (Down)

    Make sure the relays are correctly mapped in your configuration:
    Code: text
    Log in, to see the code


    4. Testing and Debugging

    After making these changes, test the functionality of the buttons and LEDs:
    - Press each button and observe the curtain's behavior.
    - Check the LED state during each action (opening, closing, stopping).

    If the behavior is still incorrect, you can use the following commands to debug:
    - `getChannelValues` to check the state of all channels.
    - `getPinRoles` to verify the pin assignments.
    - `simulateClick` to simulate button presses (e.g., `simulateClick 10` for the "Open" button).

    Conclusion

    By adjusting the button event handlers and adding LED control to the action scripts, you should be able to resolve the issues with the button and LED behavior. If you encounter further issues, feel free to provide more details, and I will assist you in troubleshooting further.
    You can call me in any topic by writing @ElektrodaBot. Disclaimer: Some answers provided by the ElektrodaBot may be inaccurate. Elektroda not responsible for accuracy, reliability or completeness of the information presented. All ElektrodaBot responses should be verified by the user. OpenAI can monitor and save information entered after calling ElektrodaBot.
  • #6 21241604
    formeTA
    Level 3  
    Posts: 3
    Thank you! LED configuration is perfect now. Relay had to be changed to 9 instead of 26. Also good now.
📢 Listen (AI voice):

FAQ

TL;DR: With 3 usable buttons and 3.3V flashing access, this guide shows how to repurpose a TEEPAO curtain switch as a two-button smart switch. As one contributor put it, "There is no relay for button 2", so the center key is best used for lighting or automation scripts. It solves GPIO mapping, RX isolation, and OpenBK flashing for CB3S/BK7231N owners. [#20905212]

Why it matters: This thread turns a confusing Tuya curtain controller into a documented OpenBK platform with known pins, safe flashing steps, and fixes for reversed buttons and mixed LEDs.

Option Result Key requirement
tuya-cloudcutter Failed on this unit No working exploit found
Wired UART flashing Worked Isolate RX and use 3.3V power
HW-597 + CH340G Flashing worked, power was weak External 5V-to-3.3V regulator needed
PL2302 adapter Worked better for power No extra power issue reported

Key insight: The critical hardware step is isolating the CB3S RX path before flashing. On this board, desoldering button-control chip pin 16 or cutting that trace lets OpenBK flash successfully and boot with stable GPIO control. [#20902811]

Quick Facts

  • The board exposes 3.3V on connector pin 1 and GND on connector pin 2, so only TX and RX needed extra soldering for UART flashing. [#20902811]
  • Confirmed GPIO map: P7=Btn2, P8=Btn3, P9=backlight inverted, P10=Btn1, P14=relay 1 + LED1, P23=green LED inverted, P24=relay 3 + LED3, P26=LED for button 2. [#20905212]
  • The switch was repurposed as a 2-way switch: two outer buttons drive outputs, while the middle button controls only its light or can run custom automation. [#20902811]
  • HW-597 with CH340G could program the board, but its onboard power was too weak for the button plate; an AMS1117 5V-to-3.3V regulator solved that issue. [#20902811]
  • A later working curtain setup used 25 s as the run-duration channel and a 2 s stop pulse, then corrected the relay mapping from P26 to P9. [#21241604]

1. How do I reconfigure a TEEPAO Wi-Fi Curtain Switch for non-curtain use as a two-button switch with an extra programmable middle button?

Flash OpenBK, map the two outer buttons to the real relay outputs, and leave the middle key as a logic-only control. In this thread, the device became a 2-way switch where the outer buttons switched loads and glowed when ON. The middle button had no physical relay, so it was used only for its light and could be reassigned to another action, such as toggling both relays through an OpenBK script. [#20902811]

2. What is the GPIO pinout of the CB3S module in the TEEPAO or Teekar Smart Curtain Switch with BK7231N?

The confirmed mapping is P7=button 2, P8=button 3, P9=backlight inverted, P10=button 1, P14=relay 1 plus button-1 LED, P23=green LED inverted, P24=relay 3 plus button-3 LED, and P26=button-2 LED. "CB3S" is a Wi‑Fi module that hosts the BK7231N chip, exposes GPIO pins, and acts as the smart control board inside Tuya-style wall switches. [#20905212]

3. Why does tuya-cloudcutter fail on some TEEPAO curtain switches, and what wired flashing method works instead?

tuya-cloudcutter failed on this unit, so the successful fallback was direct UART flashing. The board used a CB3S module, and the author had to wire TX and RX, provide 3.3V power, and isolate the RX line from the button controller before flashing. That method worked with BK7231 Easy UART Flasher on Windows and booted OpenBK after restart. [#20902811]

4. What steps are needed to flash OpenBK on a TEEPAO SYS-CS 01 curtain switch using a USB-to-TTL adapter?

Use a 3-step wired UART process. 1. Open the switch, remove the button plate, and access the CB3S board. 2. Connect GND, 3.3V, TX, and RX, then isolate RX from the button controller. 3. Use BK7231 Easy UART Flasher under Windows to write OpenBK and reboot. The thread used an HW-597 USB-to-TTL adapter, plus external 3.3V power because the adapter alone was too weak. [#20902811]

5. How do I isolate the RX line on this TEEPAO curtain switch before flashing, and why does pin 16 of the button control chip have to be desoldered or cut?

You must disconnect the RX path from the button control chip before flashing. On this board, RX was tied to that chip, which blocked new firmware uploads. The working fix was to desolder pin 16 of the button control chip or cut the trace between RX and that chip. The author chose to lift pin 16 only, then flash normally. [#20902811]

6. Which pins on the TEEPAO curtain switch provide 3.3V and GND through the button plate to power board connector during flashing?

Connector pin 1 provides 3.3V and connector pin 2 provides GND during flashing. That let the flasher reuse the board-to-button connector for power and ground, so only TX and RX needed soldered wires. In the documented setup, pin 1 also fed an AMS1117-based 5V-to-3.3V converter used to stabilize power during programming. [#20902811]

7. What do Rel_n on P9 and LED_n on P23 actually control in the OpenBK template for the Teekar Smart Curtain Switch?

Rel_n on P9 is the inverted backlight, and LED_n on P23 is the inverted green LED under button 1. The template originally looked unclear, but the follow-up post confirmed channel 20 as backlight on P9 and channel 30 as the green LED on P23. Because both are inverted, their logic state works opposite to a normal active-high output. [#20905212]

8. How are the buttons, relays, backlight, and green LED mapped on the TEEPAO or Teekar SYS-CS 01 switch?

The hardware map is asymmetric: button 1 is on P10, button 2 on P7, and button 3 on P8. Relay output 1 is on P14, relay output 3 is on P24, backlight is on P9 inverted, the green LED is on P23 inverted, and P26 drives only the center button LED. There is no factory relay for button 2 on this PCB. [#20905212]

9. Why are the hard buttons reversed on my flashed Teekar Smart Curtain Switch, where Open triggers Stop, Stop triggers Down, and Down triggers Up?

The buttons are reversed because the click handlers do not match the physical button pins. In the shared curtain script, the intended mapping was OnClick 8=Start_Opening, OnClick 10=Stop_All, and OnClick 7=Start_Closing. If your faceplate labels differ from that pin order, Open, Stop, and Down will call the wrong actions until you remap the handlers to the actual button positions. [#21236706]

10. How do I fix mixed-up LED behavior and incorrect relay mapping in autoexec.bat for a CB3S BK7231N curtain switch running OpenBK?

Correct both the pin roles and the action script. The working fix in this thread was to keep the LED logic adjustments, then change the relay assignment from P26 to P9. After that change, the user reported the LED behavior was correct and the relay setup also worked. If your template treats P26 as a relay, it will fail because P26 is only the button-2 LED on this board. [#21241604]

11. What is CB3S, and how is it used in Tuya-based smart switches like the TEEPAO curtain controller?

CB3S is the plug-in Wi‑Fi module used as the main smart controller in this switch, and this unit used it with a BK7231N chip. The module exposes the GPIO lines later assigned to buttons, relays, backlight, and LEDs in OpenBK. In practice, CB3S is the board you flash when converting this Tuya-style switch from stock firmware to OpenBK. [#20902811]

12. What is BK7231 Easy UART Flasher, and when should I use it instead of tuya-cloudcutter for flashing OpenBK?

BK7231 Easy UART Flasher is a Windows flashing tool used to program BK7231-based boards over a wired serial connection. Use it when tuya-cloudcutter does not work on your device. In this case, cloudcutter failed, but BK7231 Easy UART Flasher succeeded after RX isolation and proper 3.3V wiring, and OpenBK booted on the first restart. [#20902811]

13. HW-597 with CH340G vs PL2302 for flashing a BK7231N switch: which adapter is more reliable for powering and programming the board?

PL2302 was more reliable for powering this board, while HW-597 with CH340G still worked for programming. The author reported that the HW-597 power output was too weak to run the button plate, so an external 5V-to-3.3V converter was added. With PL2302, the author had not seen that power problem. That makes PL2302 the simpler choice if you want fewer extra parts. [#20902811]

14. How can I use the middle button on the TEEPAO curtain switch to run a custom OpenBK script, such as toggling both relays or another automation?

Use the middle button as a script trigger, not as a physical relay output. The thread states that button 2 has no relay, but OpenBK can still bind that key to a custom command. One suggested use was switching both relays together, and another post pointed to an autoexec script approach for running custom actions from a button event. [#20905212]

15. What extra components are required to add a missing relay output for button 2 on the TEEPAO curtain switch PCB?

You need four hardware parts to add the missing output for button 2: a relay, a clamping diode, a driving transistor, and a resistor for the transistor input. The board also benefits from a proper output terminal, because otherwise you only get a solder point for the relay output wire. That means the PCB supports the idea electrically, but not as a complete factory-finished channel. [#20905212]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT