logo elektroda
logo elektroda
X
logo elektroda

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

benjaminklamerek 1488 4
ADVERTISEMENT
  • Helpful post
    #1 21006126
    benjaminklamerek
    Level 1  
    Hello,

    First, thank you for your work.

    Based on all the useful information that I found in this topic https://www.elektroda.com/rtvforum/topic3972935.html + github docs, I did scripts to adapt Etersky WF-CS01 device.

    I don't have good images, but this is the same device as mentioned here : https://www.elektroda.com/rtvforum/topic4007022.html

    The main problem that I had is that over the years, the constructor used many different cards !
    I have found devices with TYWE3S (used Tasmota for these), CB3S and WB3S.

    I also discovered that CB3S and WB3S don't have the same pin mapping (maybe the mapping is more related to the date/version labels that you can find in the device, I'm not sure)

    CB3S pin mapping :

    Code: Arduino
    Log in, to see the code


    WB3S pin mapping :

    Code: Arduino
    Log in, to see the code


    I also tried (based on that I found in this forum) to create scripts that will mostly replicate the initial behavior :
    - LEDs are blue by default
    - LED is red when relay is activated (or stopping)
    - Up, middle and down buttons are for open, stop and close (in this order)
    - Both relays cannot be activated at the same time (sadly with MQTT, if you update directly the channel values this is possible)

    Other features :
    - Thank to the community, MQTT commands can use script aliases to open and close shutters
    - Duration is controlled by a specific channel (4)
    - I wanted to add a more easiest way to activate AP safe mode so I added a channel for this : if you enter 10 times in a row stop button
    - in WB3S, there is channel 6 which is hardcoded to force green led shudown (the button 1 have a second LED)

    CB3S script :

    Code: Arduino
    Log in, to see the code


    WB3S script :


    Code: Arduino
    Log in, to see the code


    I could also create templates but the added value is, from my point of view, quite low because you need autoexec.bat script too. That's why I put PIN configuration directly in the script, not sure if it's a good practice.

    For flashing, I totally unsolder the CB3S/WB3S component. This is a sensitive operation (I already broke 2 devices) but I use one ESP burner like this one :
    ESP8266 programmer with pin connectors


    I'm using CB3S for more than a week now. WB3S is tested but not used yet in a "real" context.
    Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
  • ADVERTISEMENT
  • #2 21007064
    p.kaczmarek2
    Moderator Smart Home
    That's a very nice script, thank you for sharing! I will add this later to our autoexec.bat samples page:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md

    CB3S and WB3S have indeed a slightly different pinouts. This is problematic and I already had this issue while making my BK7231 dev board:
    https://www.youtube.com/watch?v=xGE-DVrm3BU
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • Helpful post
    #5 21285677
    dennis3
    Level 1  
    >>21006126 I made a better autoexec.bat script for the wb3s.

    
    // Set up Aliases
    alias Toggle_Backlight startScript autoexec.bat toggleBacklight
    // alias Btn_open backlog stopAllScripts; startScript autoexec.bat btnOpenAction
    // alias Btn_close backlog stopAllScripts; startScript autoexec.bat btnCloseAction
    // alias Btn_stop backlog stopAllScripts; startScript autoexec.bat btnStopAction
    alias Btn_open startScript autoexec.bat btnOpenAction
    alias Btn_close startScript autoexec.bat btnCloseAction
    alias Btn_stop backlog stopAllScripts; startScript autoexec.bat btnStopAction
    alias Initial_Button_Color backlog setButtonColor 1 blue; setButtonColor 2 blue; setButtonColor 3 blue
    alias Start_open startScript autoexec.bat DoOpenAction
    alias Start_close startScript autoexec.bat DoCloseAction
    alias Start_stop backlog stopAllScripts; startScript autoexec.bat DoStopAction
    alias All_LED_off backlog setChannel 8 0; setChannel 9 0; setChannel 10 0
    alias Http_Button_open backlog setButtonColor 1 red; setButtonColor 2 blue; setButtonColor 3 blue
    alias Http_Button_stop backlog setButtonColor 1 blue; setButtonColor 2 red; setButtonColor 3 blue
    alias Http_Button_close backlog setButtonColor 1 blue; setButtonColor 2 blue; setButtonColor 3 red
    
    //To make this component visible in Windows
    startDriver SSDP
    
    // create GUI buttons for HTTP panel
    startDriver httpButtons
    
    SetChannelLabel 1 UP 1
    SetChannelLabel 2 STOP 1
    SetChannelLabel 3 DOWN 1
    SetChannelLabel 4 DURATION 1
    SetChannelLabel 5 STOP_COUNT 1
    SetChannelLabel 7 BACKLIGHT 1
    SetChannelLabel 8 AUF 1
    SetChannelLabel 9 HALT 1
    SetChannelLabel 10 ZU 1
    
    SetChannelPrivate 1 1
    SetChannelPrivate 2 1
    SetChannelPrivate 3 1
    
    setButtonEnabled 1 1
    setButtonLabel 1 "Öffnen"
    setButtonCommand 1 Btn_open
    setButtonColor 1 blue
    
    setButtonEnabled 2 1
    setButtonLabel 2 "Halt"
    setButtonCommand 2 Btn_stop
    setButtonColor 2 blue
    
    setButtonEnabled  3 1
    setButtonLabel 3 "Schliessen"
    setButtonCommand 3 Btn_close
    setButtonColor 3 blue
    
    setButtonEnabled 6 1
    setButtonLabel 6 "Beleuchtung"
    setButtonCommand 6 Toggle_Backlight
    setButtonColor 6 blue
    
    // Hide the default GUI buttons
    setChannelVisible 1 0
    setChannelVisible 2 0
    setChannelVisible 3 0
    setChannelVisible 7 0
    setChannelVisible 6 0
    
    addEventHandler OnClick 24 Btn_open
    addEventHandler OnClick 10 Btn_stop
    addEventHandler OnClick 8 Btn_close
    addEventHandler OnHold 10 Toggle_Backlight
    AddChangeHandler Channel8 == 1 Start_open
    AddChangeHandler Channel9 == 1 Start_stop
    AddChangeHandler Channel10 == 1 Start_close
    
    // ---------------------- Inputs
    setPinRole 24 Btn
    setPinRole 10 Btn
    setPinRole 8 Btn
    
    // ---------------------- Outputs
    setPinRole 6 Rel
    setPinRole 7 Rel
    
    setPinRole 14 LED
    setPinRole 0 LED
    setPinRole 26 LED
    setPinRole 11 Rel
    setPinRole 1 WifiLED_n
    
    
    setPinChannel 6 1
    setPinChannel 14 8
    setPinChannel 7 3
    setPinChannel 0 10
    setPinChannel 26 9
    setPinChannel 11 7
    setChannelType 5 TextField
    setChannelType 4 TextField
    
    if $CH4>0 then goto btnStopAction
    setChannel 4 30
    goto btnStopAction
    
    return
    
    btnOpenAction:
    setChannel 8 1
    return
    
    btnStopAction:
    setChannel 9 1
    return
    
    btnCloseAction:
    setChannel 10 1
    return
    
    toggleBacklight:
    ToggleChannel 7
    if $CH7==0 then setButtonColor 6 blue
    if $CH7==1 then setButtonColor 6 green
    return
    
    DoOpenAction:
    if $CH10==1 then setChannel 8 0
    if $CH10==1 then return
    if $CH9==1 then setChannel 8 0
    if $CH9==1 then return
    
    setChannel 5 0
    Http_Button_open 
    delay_s 0.1
    setChannel 1 1
    delay_s $CH4
    setChannel 1 0
    Initial_Button_Color
    All_LED_off 
    return
    
    DoCloseAction:
    if $CH8==1 then setChannel 10 0
    if $CH8==1 then return
    if $CH9==1 then setChannel 10 0
    if $CH9==1 then return
    
    setChannel 5 0
    Http_Button_close
    delay_s 0.1
    setChannel 3 1
    delay_s $CH4
    setChannel 3 0
    Initial_Button_Color
    All_LED_off 
    return
    
    DoStopAction:
    addChannel 5 1
    if $CH5>9 then goto enterSafeMode
    
    setChannel 1 0
    setChannel 3 0
    setChannel 8 0
    setChannel 10 0
    
    Http_Button_stop
    delay_s 2
    Initial_Button_Color
    All_LED_off 
    return
    
    enterSafeMode:
    SafeMode 3
    return
    
ADVERTISEMENT