logo elektroda
logo elektroda
X
logo elektroda

Roller shutter Etersky WF-CS01 : CB3S and WB3S pin mapping and scripts

benjaminklamerek 3174 47
ADVERTISEMENT
  • #31 21769822
    p.kaczmarek2
    Moderator Smart Home
    added vars:
    - $mqtt_client
    - $shortName
    - $name
    They work for publish and publishFile. Self tests:
    Code: C / C++
    Log in, to see the code
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #32 21770619
    Acefx
    Level 9  
    All done & Working

    For anybody willing to use it here's the FS tar;
    Just restore it from the web application menu
    /!\ You need firmware version 1.18.223 or above /!\



    Control panel for BK7231N device with diagnostics, configuration, and MQTT status

    Total integration with home assistant,
    Diagnostic information
    Build
    IP
    RSSI
    SSID
    Chip Temp
    Uptime.

    Shutter travel time in sec( need to time it manually and wrote it down )
    Backlight of the touchpad
    and of course, cover entity with feedback.

    Also the 2 files already in the Filesystem
    Autoexec.bat
    // Autoexec file for Etersky WS01, CB3S , with new ha integration and autodiscovery
    //Made by Acefx and Google Gemini  - Thx to  divadiow, benjaminklamerek for the initial source
    // and of course p.kaczmarek2 for his wonderfull work, availability, and patience ( with me ) 
    
    
    
    // Set up Aliases
    alias Set_Stop backlog setChannel 3 0; setChannel 1 0; setChannel 2 0; setButtonColor 3 CornflowerBlue; setButtonColor 2 CornflowerBlue; setButtonColor 1 CornflowerBlue
    alias UPmouv_Stop backlog  setChannel 1 0
    alias DWmouv_Stop backlog setChannel 3 0
    alias Set_Open backlog setChannel 1 1; setButtonColor 1 Coral 
    alias Set_Close backlog setChannel 3 1; setButtonColor 3 Coral
    alias Set_Finish backlog setChannel 2 1; setButtonColor 2 Coral
    alias Start_Opening backlog stopAllScripts; startScript autoexec.bat openSkylight
    alias Start_Closing backlog stopAllScripts; startScript autoexec.bat closeSkylight
    alias Stop_All backlog stopAllScripts; startScript autoexec.bat stopSkylight
    alias Stop_led_up backlog setButtonColor 1 Coral
    alias Stop_led_finish backlog setButtonColor 2 Coral
    alias Stop_led_dw backlog setButtonColor 3 Coral
    
    
    // create GUI buttons for HTTP panel
    startDriver httpButtons
    
    // Define displayed text on button 4/5
    setChannelLabel 4 "Shutter travel time (sec)"
    setChannelLabel 5 "Backlight"
    
    setButtonEnabled 1 1
    setButtonLabel 1 "Open"
    setButtonCommand 1 Start_Opening
    setButtonColor 1 CornflowerBlue
    
    setButtonEnabled 3 1
    setButtonLabel 3 "Close"
    setButtonCommand 3 Start_Closing
    setButtonColor 3 CornflowerBlue
    setButtonEnabled 2 1
    setButtonLabel 2 "Stop"
    setButtonCommand 2 Stop_All
    setButtonColor 2 CornflowerBlue
    
    // Hide the default GUI buttons
    setChannelVisible 1 0
    setChannelVisible 2 0
    setChannelVisible 3 0
    
    SetChannelPrivate 1 1
    SetChannelPrivate 2 1
    SetChannelPrivate 3 1
    
    // Loading Event Handlers
    addEventHandler OnClick 7 Start_Closing
    addEventHandler OnClick 24 Start_Opening
    addEventHandler OnClick 10 Stop_All
    
    // --- HomeAssistant discovery  ---
    
    addEventHandler OnDiscovery 0 publishFile homeassistant/cover/$mqtt_client_cover/config d.json 1
    scheduleHADiscovery
    
    
    
    // ----------Script part for interlock--------------------------------
    
    
    // Stop Operation on power up
    goto stopSkylight
    
    
    // do not proceed
    return
    
    openSkylight:
    DWmouv_Stop
    delay_ms 100
    Set_Open
    publish shutterState opening
    setChannel 2 0
    setButtonColor 2 CornflowerBlue
    delay_s $CH4
    Set_Stop
    Set_Finish
    publish shutterState open
    delay_s 2
    Set_Stop
    return
    
    closeSkylight:
    UPmouv_Stop
    delay_ms 100
    Set_Close
    publish shutterState closing
    setChannel 2 0
    setButtonColor 2 CornflowerBlue
    delay_s $CH4
    Set_Stop
    Set_Finish
    publish shutterState closed
    delay_s 2
    Set_Stop
    return
    
    stopSkylight:
    Set_Stop
    Set_Finish
    publish shutterState open
    delay_s 6
    Set_Stop
    return


    And the d.json ( discovery payload )
    {
      "dev": {
        "ids": [
          "$mqtt_client"
        ],
        "name": "$mqtt_client"
      },
      "name": "$name",
      "~": "$mqtt_client",
      "avty_t": "~/connected",
      "uniq_id": "$mqtt_client_cover",
      "qos": 1,
      "unique_id": "$mqtt_client_id",
      "device_class": "shutter",
      "state_topic": "~/shutterState/get",
      "command_topic": "cmnd/$mqtt_client/backlog",
      "payload_open": "Start_Opening",
      "payload_close": "Start_Closing",
      "payload_stop": "Stop_All",
      "state_open": "open",
      "state_closed": "closed"
    } 


    thx again to p.kaczmarek2 for his wonderfull work, availability, and patience ( with me )
    Attachments:
    • LittleFS_WS01-Etersky_12-3-2025_10-31-48 PM.tar (10 KB) You must be logged in to download this attachment.
  • #33 21770648
    p.kaczmarek2
    Moderator Smart Home
    Thank you, so it's working now? How it looks in HA?

    Would you like to improve it a bit more?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #34 21770855
    Acefx
    Level 9  
    Totally working and integrated. Thanks to you!
    Do you think it's possible to improve it more? :-)

    I think one major improvement could be to add a temperature probe on the I/O to get feedback for the domotics :-)

    Added after 8 [hours] 19 [minutes]:

    Ok i have deeply tested the firmware & adaptation, i have 2 flaws
    1. the backlight seems to have a wrongpin adress , ( easy to fix )
    2. when you order the "stop" command, the device send "publish Shutterstate open"
    Which is problematic because home assistant feels that the shutter is open, and disable the up button.

    It could be better if we could publish a " stopped state" nor a shutter position 50% , but i'm not sure it exist...
    Of course, a position prediction feature could be gold, but i think a C driver is needed for that...
  • #35 21787148
    p.kaczmarek2
    Moderator Smart Home
    Are you still interested in C driver for shutters? I need testers.
    Garage device UI showing unknown status, with Visual Studio debugger on the right

    Added after 25 [minutes]:

    App interface showing garage WT3145CAFF is open at 76%
    Helpful post? Buy me a coffee.
  • #36 21804782
    dgel27
    Level 8  
    I think it will be better. There are many shutter modules on the market; also it will possibly apply any few-channel module as a shutter.
    I can test it. It is better to add calibration to movement. Need different times for up and down. Usually in the upward direction it takes more time.
    Thanks!
  • ADVERTISEMENT
  • #37 21856504
    JYO
    Level 4  
    >>21787148
    Hi,
    I have an SC420W-EU Loratap dual-shutter switch,
    White wall switch with six buttons, Wi‑Fi icon, and “LoraTap” label
    I have made a teardown of this switch and I have found the pinout and use of the GPIOs.

    Flashing was a breeze, needing only two solders.
    I am very interested in testing a (C) shutter driver...

    Let me know when you have made one!

    P.S.: Thanks for this great work
  • #38 21856706
    p.kaczmarek2
    Moderator Smart Home
    Helpful post? Buy me a coffee.
  • #39 21858085
    JYO
    Level 4  
    >>21856706
    Thanks for the info.
    I finally succeeded in getting OpenBK7231N_2013_merge_b69856ffe78e.rbl and flashed it to my SC420W-EU, but there is no shutter driver in it, nor PinMutex driver...
    And obkSimulator_2013_merge_b69856ffe78e has PinMutex, but no shutter...
    So I can't test...
  • ADVERTISEMENT
  • #40 21858105
    DeDaMrAz
    Level 22  
    @JYO

    Can you confirm you are running on that PR FW build, I just tested it on my end


    Info:MAIN:Available drivers: 
    Info:MAIN:TuyaMCU
    Info:MAIN:, tmSensor
    Info:MAIN:, PixelAnim
    Info:MAIN:, NTP
    Info:MAIN:, HTTPButtons
    Info:MAIN:, I2C
    Info:MAIN:, BL0942
    Info:MAIN:, BL0942SPI
    Info:MAIN:, BL0937
    Info:MAIN:, CSE7766
    Info:MAIN:, SM16703P
    Info:MAIN:, SM15155E
    Info:MAIN:, IR
    Info:MAIN:, RC
    Info:MAIN:, Shutters
    Info:MAIN:, DDP
    Info:MAIN:, SSDP
    Info:MAIN:, DGR
    Info:MAIN:, Wemo
    Info:MAIN:, Hue
    Info:MAIN:, PWMToggler
    Info:MAIN:, DoorSensor
    Info:MAIN:, SM2135
    Info:MAIN:, BP5758D
    Info:MAIN:, BP1658CJ
    Info:MAIN:, SM2235
    Info:MAIN:, CHT83XX
    Info:MAIN:, KP18058
    Info:MAIN:, ADCSmoother
    Info:MAIN:, AHT2X
    Info:MAIN:, DS1820
    Info:MAIN:, Battery
    Info:MAIN:, Bridge
    Error:CMD:LFS_ReadFile: lfs is absent




    Screenshot of BK7231N/T pin configuration with a dropdown list; “ShutterA” is selected
  • #41 21858145
    JYO
    Level 4  
    >>21858105
    No, there is no 'Shutters' driver in the FW I downloaded...
    Can you send it to me, or any links?
  • #42 21858151
    dgel27
    Level 8  
    >>21858105 Could you provide a link to this firmware?
    Thanks!
  • #43 21858160
    DeDaMrAz
    Level 22  
    https://github.com/openshwprojects/OpenBK7231...actions/runs/22540704798/artifacts/5709120231

    Provided link is for N platform only!!

    Extract the RBL file only if you already have OBK installed and after OTA make sure that your device shows this on the bottom of OBK index page - version 2013_merge_b69856ffe78e


    Screenshot of OBK web page showing version 2013_merge_b69856ffe78e and BK7231N chipset

    If it does not show that after OTA, reboot manually and repeat OTA.

    Share more detail if it fails.
  • #44 21858189
    JYO
    Level 4  
    >>21858160
    Thanks a lot! Shutters driver is in the box!
    It works like a breeze !
    autoexec.bat :
    // autoexec.bat Shutter driver test
    // adapted to SC420W-EU (Loratap dual shutter) (c)JYO2026
    startDriver Shutters
    ClearIO // clear old GPIO/channels
    StartupCommand ""  // clear STARTUP
    // Shutter 1 (left buttons)
    backlog setPinRole 7 ShutterA; setPinChannel 7 1
    backlog setPinRole 24 ShutterB; setPinChannel 24 1
    backlog setPinRole 9 BtnShutterUp; setPinChannel 9 1
    backlog setPinRole 20 Btn; setPinChannel 20 1   // btn stop 1
    backlog setPinRole 14 BtnShutterDown; setPinChannel 14 1
    // Shutter 2 (right buttons)
    backlog setPinRole 8 ShutterA; setPinChannel 8 2
    backlog setPinRole 26 ShutterB; setPinChannel 26 2
    backlog setPinRole 11 BtnShutterUp; setPinChannel 11 2
    backlog setPinRole 23 Btn; setPinChannel 23 2   // btn stop 2
    backlog setPinRole 10 BtnShutterDown; setPinChannel 10 2
    backlog setPinRole 6 WifiLED_n
    

    Buttons, setup & sliders :
    OpenBK web UI screenshot: calibration and control for two shutters with Open/Stop/Close buttons and sliders

    In HA the 2 shutter commands appears as separate entities :
    Home Assistant dashboard screenshot with two shutter tiles, “Cuisine Ouest” and “SdB”, circled in pink

    Both forms of the command:
    Home Assistant UI screenshot showing a shutter slider labeled “Ouvert: 49%”App screen with shutter control panel “Ouvert” and up, stop, and down buttons
  • #45 21858246
    p.kaczmarek2
    Moderator Smart Home
    So it's okay? Or what do you mean by "2 shutter command entities"? Should there be a single one, or is it ok?
    Helpful post? Buy me a coffee.
  • #46 21858354
    JYO
    Level 4  
    >>21858246
    I think it's Ok.
    I was just surprised at first, as the dual switch is one piece of material, but shutters are individual so we may consider the SC420W-EU as two independant switches.
    I saw that values in the calibration screen returns to the default value (10s) when mainss is switched off.
    Where can I set the values permanently?
  • #47 21858404
    p.kaczmarek2
    Moderator Smart Home
    It was not implemented, I implemented it in PR. Can you update and recheck?
    Helpful post? Buy me a coffee.
  • #48 21860151
    JYO
    Level 4  
    >>21858404
    Tested OK !
    New autoexec.bat:
    // autoexec.bat Shutter driver test (PR#2022)
    // adapted to SC420W-EU (Loratap dual shutter) (c)JYO2026
    startDriver Shutters
    ClearIO // clear old GPIO/channels
    StartupCommand ""  // clear STARTUP
    // Shutter 1
    backlog setPinRole 7 ShutterA; setPinChannel 7 1
    backlog setPinRole 24 ShutterB; setPinChannel 24 1
    backlog setPinRole 9 BtnShutterUp; setPinChannel 9 1
    backlog setPinRole 20 Btn; setPinChannel 20 1   // btn stop 1
    backlog setPinRole 14 BtnShutterDown; setPinChannel 14 1
    backlog ShutterChannels 1 10 11 12 - stores shutter 1's state in channels 10-12
    // Shutter 2
    backlog setPinRole 8 ShutterA; setPinChannel 8 2
    backlog setPinRole 26 ShutterB; setPinChannel 26 2
    backlog setPinRole 11 BtnShutterUp; setPinChannel 11 2
    backlog setPinRole 23 Btn; setPinChannel 23 2   // btn stop 2
    backlog setPinRole 10 BtnShutterDown; setPinChannel 10 2
    backlog ShutterChannels 2 20 21 22 - stores shutter 2's state in channels 20-22
    backlog setPinRole 6 WifiLED_n
    

    One remark: MQTT traffic has been reduced, sending less shutter positions, but is still sending one msg/second 'secondsWithNoPing' ; is there a way to reduce/program this behaviour ?
    And there is a flaw in security (pehaps only in th PR): SSID & password appears as plain text in device log

Topic summary

The discussion revolves around the Etersky WF-CS01 roller shutter device, focusing on the pin mapping and scripting for different versions, specifically CB3S and WB3S. The user shares their experience adapting the device using scripts based on information from various sources, including GitHub documentation. They highlight the variability in pin mapping across different versions of the device, which complicates setup. Responses include acknowledgments of the user's script contributions and suggestions for improving the autoexec.bat script for the WB3S model, emphasizing the need for clear documentation and setup guidance for users.
Summary generated by the language model.
ADVERTISEMENT