logo elektroda
logo elektroda
X
logo elektroda

QS-WIFI-S10-C04 Roller Shutter Module with T1-M WiFi (BK7238) - Flashing and Automation

Hamalaon 1494 13
Best answers LABEL_AI_GENERATED

How can I make the physical roller shutter buttons on a QS-WIFI-S10-C04 BK7238 module respond instantly instead of with about a 0.5 second delay?

Enable flag 6 in the config; after that change, the button trigger felt much better, and the author confirmed the response improved [#21850681][#21850900] A separate suggestion was to use OBK’s internal Shutters driver instead of a custom script, since it is now merged into the main tree but disabled by default [#21851125][#21851426] With that driver, the reported pin roles are BtnShutterUp/Down on GPIO 6/26 and ShutterA/B on GPIO 9/24, and it worked from the UI/HA, although wired buttons were still not functional in that test [#21852097]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
  • Flashing and pinout for QS-WIFI-S10-C04 module

    #1 21850663
    Hamalaon
    Level 5  
    Posts: 12
    Help: 2
    Rate: 2
    Today I have flashed a wifi roller shutter module, also known as curtain module.

    The device model is QS-WIFI-S10-C04, but it is different from this one.
    It looks like upgraded revision with thinner case and different wifi module.

    Tuya Mini Wi‑Fi Curtain Module with terminal diagram and green screw terminal block

    Generally, it has a built-in button, wifi LED, two 220 switch inputs and two relays.
    Here is a wiring diagram for reference:

    Wiring diagram with L and N lines, a switch, motor M, and terminal connections inside a device housing
    Active signal on external buttons is LOW, while it is triggered by phase to the external contact.
    External buttons are probably made high voltage to allow the use for longer wires.

    Here is what inside:
    Opened Wi‑Fi curtain control module with exposed PCB and labeled white housingClose-up of a PCB with two relays, electrolytic capacitors, and a green screw terminal block Close-up of a PCB with a screw terminal block, two relays, and capacitors


    Wifi module is T1-M.
    Flashing procedure is very human - unsolder the module and flash it with GUI Tool.
    TX RX are not connected and it will probably flash without removing module.
    Config seems to be encrypted and nothing has been automatically extracted, so I had to debug the pinout.

    Small PCB with soldered wires and pin labels 3V3, GND, RX1, TX1, P9, P24

    Here goes the template:
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "WIFI Roller shutter with automation",
      "model": "QS-WIFI-S10-C04",
      "chip": "BK7238",
      "board": "TODO",
      "flags": "0",
      "keywords": [
        "roller",
        "shutter",
        "curtain"
      ],
      "pins": {
        "6": "dInput;13",
        "8": "WifiLED_n;0",
        "9": "Rel;1",
        "24": "Rel;2",
        "26": "dInput;12"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/7311259500_1772256606.png",
      "wiki": "https://www.elektroda.com/rtvforum/viewtopic.php?p=21850663"
    }


    But thats not all.
    Each relay is independent and we can enable them by buttons, but we need to implement the protection against enabling accidently two at once.
    Also it is not very human to hold the button - thats why we need the timers to hold relay enabled for a while, then disable it.

    My roller has stupid mechanical endstops at the ends and different drives for up and down direction.
    It is ok if the relay stays on slightly longer than needed to fully open/close.

    Here is autorun to make it happen:
    
    // State machine
    //0: stopped/unknown position
    //1: opening
    //2: closing
    //3: stopped/opened
    //4: stopped/closed
    
    // dn btn
    SetPinChannel 6 13
    SetPinRole 6 dInput
    
    // up btn
    SetPinChannel 26 12
    SetPinRole 26 dInput
    
    // up relay
    SetPinChannel 9 1
    SetPinRole 9 Rel
    
    // dn relay
    SetPinChannel 24 2
    SetPinRole 24 Rel
    
    // led
    SetPinChannel 8 0
    SetPinRole 8 WifiLED_n
    
    // state
    setChannelType 43 ReadOnly
    ClampChannel 43 0 4
    SetChannelVisible 43 0
    setChannelLabel 43 State 1
    
    
    // Logic
    alias goto-opening-then-opened backlog cancelRepeatingEvent 1; cancelRepeatingEvent 2; setChannel 2 0; setChannel 1 1; setChannel 43 1; addRepeatingEventID 20 20 1 goto-opened
    alias goto-opened backlog cancelRepeatingEvent 1; setChannel 1 0; setChannel 43 3
    
    alias goto-closing-then-closed backlog cancelRepeatingEvent 1; cancelRepeatingEvent 2; setChannel 1 0; setChannel 2 1; setChannel 43 2; addRepeatingEventID 20 20 2 goto-closed
    alias goto-closed backlog cancelRepeatingEvent 2; setChannel 2 0; setChannel 43 4
    
    alias goto-stop backlog cancelRepeatingEvent 1; cancelRepeatingEvent 2; setChannel 1 0; setChannel 2 0; setChannel 43 0
    
    
    // ext up dn buttons
    alias btn-open if $CH43==0||$CH43==2||$CH43==4 then goto-opening-then-opened else btn-open-cancel
    alias btn-open-cancel if $CH43==1 then goto-stop
    addChangeHandler Channel12 == 0 btn-open
    
    alias btn-close if $CH43==0||$CH43==1||$CH43==3 then goto-closing-then-closed else btn-close-cancel
    alias btn-close-cancel if $CH43==2 then goto-stop
    addChangeHandler Channel13 == 0 btn-close
    
    
    // Hide default web buttons
    setChannelVisible 1 0
    setChannelVisible 2 0
    
    // web up dn buttons
    startDriver httpButtons
    setButtonEnabled 41 1
    setButtonLabel 41 Up
    setButtonEnabled 42 1
    setButtonLabel 42 Down
    
    setButtonCommand 41 btn-open
    setButtonCommand 42 btn-close
    
    
    // stop on boot
    addEvent 1 goto-stop


    I have improved scripts from another posts to work fine for me.
    However here is still a room for improvement.
    I want to make button response time instant. Right now it takes about half a second for button to trigger. I dont know currently more optimal functions - maybe there should be some kind of interrupts.
  • ADVERTISEMENT
  • #2 21850681
    DeDaMrAz
    Level 23  
    Posts: 621
    Help: 34
    Rate: 130
    Hamalaon wrote:
    I want to make button response time instant. Right now it takes about half a second for button to trigger.


    Try to activate flag 6 in the config and report if the trigger feels better?
  • #3 21850900
    Hamalaon
    Level 5  
    Posts: 12
    Help: 2
    Rate: 2
    >>21850681
    Yep, it feels much better. Thank you.
  • ADVERTISEMENT
  • #4 21851125
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14770
    Help: 659
    Rate: 12913
    Nice script, but we have internal Shutters driver in OBK now. Have you tried it?
    Smartphone screen showing “Shutters Controls Section” with Open, Shut, and Stop buttons
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #6 21851426
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14770
    Help: 659
    Rate: 12913
    I've merged shutters driver into main tree, but it's disabled by default. Here is enabled build:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/2013
    Helpful post? Buy me a coffee.
  • #7 21851468
    Hamalaon
    Level 5  
    Posts: 12
    Help: 2
    Rate: 2
    >>21851426
    Good. How can I download any of these files?

    Screenshot of an “Artifacts” list showing OpenBK7231T file names and sizes in MB.
  • #8 21851488
    divadiow
    Level 38  
    Posts: 5220
    Help: 449
    Rate: 918
    login to GitHub first

    File list with OpenBK7231T names and download icons on the right, highlighted by a yellow line.
  • Updated pin roles and shutter calibration delay

    #9 21852097
    Hamalaon
    Level 5  
    Posts: 12
    Help: 2
    Rate: 2
    Today I found out that login may be required to download from github.

    I have tested the new Shutters driver and from UI it works fine.

    Screenshot of “smartcurtain1” with shutter calibration and control sections and Open/Stop/Close buttons

    With updated pin roles the template looks like this:
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Full Device Name Here",
      "model": "enter short model name here",
      "chip": "BK7238",
      "board": "TODO",
      "flags": "64",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "6": "BtnShutterUp;1",
        "8": "WifiLED_n;0",
        "9": "ShutterA;1",
        "24": "ShutterB;1",
        "26": "BtnShutterDown;1"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }


    Also works with HA
    Screenshot of a smart home app showing “Garage” with status “Closed”.

    The calibration thing does not work instantly after driver start, so I added a delay before it.
    startDriver Shutters
    delay_s 1
    ShutterCalibrate 1 19 19


    Wired buttons are not functional however. Seems like driver not getting it.
  • #11 21914505
    Golden_Melky
    Level 2  
    Posts: 2
    Hi everyone,
    ​I have 5 of these modules installed around my house. They worked fine for a couple of years, but recently, a few of them stopped working entirely.
    ​They completely disconnected from the Wi-Fi and pressing the physical switches does absolutely nothing. Only by turning off and on the main breaker makes them work, but not for long. Does somebody else have this problem too?
  • ADVERTISEMENT
  • #12 21914561
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14770
    Help: 659
    Rate: 12913
    Helpful post? Buy me a coffee.
  • Need shutter support files and 433 MHz pulse mapping

    #13 21925895
    SupremeOverload
    Level 1  
    Posts: 1
    >>21853015

    I have a shutter controller that works similarly as the OP's. I have flashed latest OpenBeken and it works (somewhat, web ui times out often), but now want to try shutter support but can't find the files. I am logged in to GitHub.

    BTW, my device also has 433 MHz wireless remote functionality. The button signals are all 300 ms low pulses for the following events:
    P8: Button 1 push/close (input or remote)
    P24: Button 2 push/close (input or remote)
    P1: Button 1 or 2 input release (nothing from the wireless remote)

    My switch for the rollers is three-way-stationary (down-0-up), not push buttons, so I need a logic that will always stop motion when the P1 ("break") signal is seen and otherwise a single pulse on the other two will turn on the motor in either direction, or while the motor is turned on, stop it (toggle function for the wireless remote). Will that work with the current state of the rollers/blinds support?
  • #14 21926028
    lcapriotti
    Level 2  
    Posts: 2
    Similar device here, different pin settings:

     
    "pins": {
        "6": "ShutterA;1",
        "9": "WifiLED_n;0",
        "24": "ShutterB;1",
      }
    


    Small PCB with two ORELAY relays and capacitors, plus a green screw terminal block

    BtnShutterDown, BtnShutterUp are not working though.

Topic summary

LABEL_AI_GENERATED
Discussion about flashing and configuring a Tuya QS-WIFI-S10-C04 roller shutter/curtain module with a T1-M WiFi module based on BK7238. The device has two relay outputs, two external switch inputs, and a built-in button/Wi‑Fi LED, with active-low button logic and high-voltage external inputs. After flashing OpenBeken, the shutter behavior was improved by enabling flag 6, and later the internal Shutters driver was tested successfully from the UI. A working pin template was shared with shutter roles such as ShutterA, ShutterB, BtnShutterUp, BtnShutterDown, and WifiLED_n. The thread also covers downloading enabled builds from GitHub, login requirements, and later reports from similar devices with different pin mappings, 433 MHz remote support, and issues with button handling or device instability after years of use.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT