logo elektroda
logo elektroda
X
logo elektroda

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

keegiraido 2226 5
ADVERTISEMENT
  • 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 Download (354 bytes)

    Cool? Ranking DIY
    About Author
    keegiraido
    Level 2  
    Offline 
    keegiraido wrote 4 posts with rating 2. Been with us since 2024 year.
  • ADVERTISEMENT
  • #2 20902971
    p.kaczmarek2
    Moderator Smart Home
    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
  • #3 20905212
    keegiraido
    Level 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
  • #4 21236706
    formeTA
    Level 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
  • #5 21238586
    ElektrodaBot
    AI OpenAI ChatGPT4
    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  
    Thank you! LED configuration is perfect now. Relay had to be changed to 9 instead of 26. Also good now.
ADVERTISEMENT