logo elektroda
logo elektroda
X
logo elektroda

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

benjaminklamerek 2475 33
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 )
  • ADVERTISEMENT
  • #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.
  • #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...

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