
The MOES WRS-EUC-3D Smart Curtain switch ( this little fellow) is working with a CB2S module and uses TuyaMCU.



The DPs are as follows:
DP | Type | TX | RX | 1 | Enum | 0: open
1: pause 2: close | 0: opening
1:stopped 2: closing | 2 | Val | set position | position | 3 | Enum | Fine calibration
0: 1st step 1: 2nd step | Fine cal. state
0: 1st step 1: 2nd step | 7 | Bool | Switch backlight
0: off 1: on | Switch backlight state
0: off 1: on | 8 | Enum | Motor steering set
0: default 1: reverse | Motor steering state
0: default 1: reverse | 10 | Val | Set travel time | Travel time |
The CB2S must be desoldered in order to program.
Flag config: 7,19,43,50 set to 1
Here is the autoexec.bat:
startDriver TuyaMCU
tuyaMcu_defWiFiState 4
tuyaMcu_setBaudRate 9600
alias correctedPos if $CH2<101 then publish 20 $CH2
// Vezérléshez szükséges csatornák létrehozása
setChannelType 1 TextField // Enum parancsok küldése (vezérlés)
setChannelLabel 1 "Mód"
linkTuyaMCUOutputToChannel 1 4 1 // 1. csatorna (vezérlés Enum), Tuya DPID 1
setChannelType 2 Dimmer
setChannelLabel 2 "Pozíció" //Position
linkTuyaMCUOutputToChannel 2 val 2
setChannelType 3 TextField
setChannelLabel 3 "Zárási idő" //Travel time
linkTuyaMCUOutputToChannel 10 val 3
setChannelType 4 Toggle
setChannelLabel 4 "Gomb világítás" //Backlight of the buttons
linkTuyaMCUOutputToChannel 7 bool 4
setChannelType 5 Toggle
setChannelLabel 5 "Motor irány" //Motor steering direction
linkTuyaMCUOutputToChannel 8 bool 5
setChannelType 6 TextField
setChannelLabel 6 "Finom kalibráció" //Fine calibration
linkTuyaMCUOutputToChannel 3 4 6
addEventHandler OnChannelChange 2 correctedPos
addEventHandler OnMQTTCommand "/2/set" setChannel 2 $VAL
addEventHandler OnMQTTCommand "/3/set" setChannel 3 $VAL
addEventHandler OnMQTTCommand "/4/set" setChannel 4 $VAL
addEventHandler OnMQTTCommand "/5/set" setChannel 5 $VAL
addEventHandler OnMQTTCommand "/6/set" setChannel 6 $VAL
startDriver httpButtons
// Open button
setButtonEnabled 1 1
setButtonLabel 1 "Nyitás"
setButtonCommand 1 "setChannel 1 0" // 0 érték: Nyitás parancs Enum szerint
setButtonColor 1 "#00FF00"
// Stop button
setButtonEnabled 2 1
setButtonLabel 2 "Állj"
setButtonCommand 2 "setChannel 1 1" // 1 érték: Állj parancs Enum szerint
setButtonColor 2 "#FFFF00"
// Close Button
setButtonEnabled 3 1
setButtonLabel 3 "Zárás"
setButtonCommand 3 "setChannel 1 2" // 2 érték: Zárás parancs Enum szerint
setButtonColor 3 "#FF0000"
And the mqtt cover entity definition in mqtt.yaml. (Add mqtt: !include mqtt.yaml to the configuration.yaml)
cover:
- name: "Előszoba redőny"
unique_id: "redony_eloszoba"
device:
identifiers: ["DT2401"]
hw_version: "1.0"
manufacturer: "DOVER Electrotech"
model: "Depner Redőnyvezérlő"
sw_version: "2.3"
availability:
- topic: "redony_eloszoba/connected"
payload_available: "online"
payload_not_available: "offline"
command_topic: "cmnd/redony_eloszoba/Backlog"
state_topic: "redony_eloszoba/1"
position_topic: "redony_eloszoba/20"
set_position_topic: "redony_eloszoba/2/set"
position_open: 100
position_closed: 0
payload_open: "setChannel 1 0"
payload_close: "setChannel 1 2"
payload_stop: "setChannel 1 1"
state_opening: "0"
state_closing: "2"
state_stopped: "1"
qos: 0
retain: false
optimistic: false
device_class: "shutter"
number:
- name: "Precíz kalibráció" # Precise calibration
state_topic: "redony_eloszoba/6"
command_topic: "redony_eloszoba/6/set"
min: 0
max: 1
step: 1
unique_id: "redony_finom_kalibracio"
device:
identifiers: ["DT2401"]
manufacturer: "DOVER Electrotech"
model: "Depner Redőnyvezérlő"
sw_version: "2.3"
- name: "Felfutási idő" # Travel time
state_topic: "redony_eloszoba/3"
command_topic: "redony_eloszoba/3/set"
min: 10
max: 60
step: 1
unique_id: "redony_eloszoba_felfutasi"
device:
identifiers: ["DT2401"]
manufacturer: "DOVER Electrotech"
model: "Depner Redőnyvezérlő"
sw_version: "2.3"
switch:
- name: "Gomb világítás" # Button backlight
state_topic: "redony_eloszoba/4"
command_topic: "redony_eloszoba/4/set"
payload_on: "1"
payload_off: "0"
retain: false
qos: 0
unique_id: "redony_eloszoba_gomb_vilagitas"
device:
identifiers: ["DT2401"]
hw_version: "1.0"
manufacturer: "DOVER Electrotech"
model: "Depner Redőnyvezérlő"
sw_version: "2.3"
- name: "Motor irány" # Motor steering direction
state_topic: "redony_eloszoba/5"
command_topic: "redony_eloszoba/5/set"
payload_on: "1"
payload_off: "0"
retain: false
qos: 0
unique_id: "redony_eloszoba_motor_irany"
device:
identifiers: ["DT2401"]
hw_version: "1.0"
manufacturer: "DOVER Electrotech"
model: "Depner Redőnyvezérlő"
sw_version: "2.3"
The calibration can be done in 2 ways.
1.) Travel time manually setup: measure the time needed for fully close or fully open, and set it to the ch3. (Travel time)
2.) Fine setup. Write 0 to ch6. (Precise calibration). Then fully open the shutter and press pause on the switch itself. After it set 1 to ch 6 (Precise calibration), and close the shutter. The travel time is measuerd and stored automatically.