WF-CS02 Curtain Switch

Available from:

Install method:

GPIO #Component
GPIO00 LedLink
GPIO01 None
GPIO02 Led2
GPIO03 Switch3
GPIO04 Relay3
GPIO05 Button2
GPIO09 None
GPIO10 None
GPIO12 Button1
GPIO13 Relay1
GPIO14 Led3
GPIO15 Relay2
GPIO16 Led1
Configuration (old format, will be converted to new template when applied)
{"NAME":"WF-CS02 Tuya","GPIO":[157,0,53,11,23,18,0,0,17,21,54,22,52],"FLAG":0,"BASE":18}
Requires configuring shutter support.

WARNING: New Tuya devices have replaced their Wi-Fi module with one incompatible with Tasmota!!!
Tuya-Convert might not be possible for this device since the template was added (2019-12-31).

Added some rules to get the switch working, based on https://tasmota.github.io/docs/Blinds-and-Shutters:

SetOption80 1 # Enable shutter support, reset the device after for correct interface to show up

SetOption13 1 # only single press action for immediate response, for faster buttton response

ShutterRelay1 1 # Enable shutter relay 1

Backlog PulseTime1 0; PulseTime2 0 # ShutterMode0

Pulsetime3 1 # auto disable Power3 button

Backlog Interlock 1,2,3; Interlock ON

PowerRetain 1 # Save state for Home Assistant

Rule1 on Power3#State=1 do ShutterStop1 endon # Use the middle button for stopping shutter movement

Rule1 1

Rule2 on Power1#State=0 do LEDPower1 0 endon on Power1#State=1 do LEDPower1 1 endon on Power2#State=0 do LEDPower2 0 endon on Power2#State=1 do LEDPower2 1 endon on Power3#State=0 do LEDPower3 0 endon on Power3#State=1 do LEDPower3 1 endon # Giving color on button press

Rule2 1

WebButton3 ■ # Set stop symbol for the third button in the web GUI

SwitchMode1 4 # Make the buttons do their actions on touch, not release

SwitchMode2 4

SwitchMode3 4

Do the calibration as per instructions in Tasmota documentation.

Flashing the device using TuyaConvert worked in this case even though multiple devices were manufactured in October 2019. There are no prebuilt Tasmota binaries with native shutter support included, so Tasmota must be compiled manually with the correct flag for this functionality to be present. Instructions for this can also be found in Tasmota documentation.

The shutter can now be integrated into Home Assistant:

    platform: mqtt
    name: "Shutter 1"
    availability_topic: "tele/<tasmota>/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    position_topic: "stat/<tasmota>/SHUTTER1"
    position_open: 100
    position_closed: 0
    set_position_topic: 'cmnd/<tasmota>/ShutterPosition1'
    command_topic: "cmnd/<tasmota>/Backlog"
    value_template: ''
    payload_open: "ShutterOpen1"
    payload_close: "ShutterClose1"
    payload_stop: "ShutterStop1"
    retain: false
    optimistic: false
    qos: 1