forked from blakadder/templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWF-CS01_EU
102 lines (86 loc) · 4.79 KB
/
WF-CS01_EU
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
date_added: 2019-07-15
title: WF-CS01
category: cover
type: Curtain Switch
standard: eu
image: https://ae01.alicdn.com/kf/HTB1s85oKAvoK1RjSZFNq6AxMVXaE.jpg?width=788&height=704&hash=1492
template: '{"NAME":"Tuya Shutter","GPIO":[157,0,54,10,22,19,0,0,17,21,53,23,52],"FLAG":0,"BASE":18}'
link: https://www.amazon.de/dp/B07PNV9XKQ/
link2: https://www.aliexpress.com/item/32983943702.html
---
Added a rule to get it working properly:
```console
Rule1 on Power1#State=1 do backlog Power3 0; Power2 0 endon
on Power2#State=1 do backlog Power1 0; Power2 0; Power3 0 endon
on Power3#State=1 do backlog Power1 0; Power2 0 endon
Rule1 1
```
This combines to:
```console
Rule1 on Power1#State=1 do backlog Power3 0; Power2 0 endon on Power2#State=1 do backlog Power1 0; Power2 0; Power3 0 endon on Power3#State=1 do backlog Power1 0; Power2 0 endon
```
Or use the Interlock settings like below (or use both for safety).
Added some commands too:
```console
InterLock 1,2,3 # lock the relays, only one relay can be on
InterLock on # switch interlocking on
PowerOnState 0 # keep relay(s) OFF after power up
PowerRetain 0 # don't retain states
PulseTime1 145 # set relay 1 activation to 45 seconds (+100 for 1sec interval)
PulseTime2 1 # deactivate button 2 immediately after activation (disables relays)
Pulsetime3 145 # set relay 3 activation 45 seconds (+100 for 1sec interval)
SetOption1 1 # restrict button-multipress to single, double and hold actions
SetOption26 1 # use indexes (Power1 iso Power)
SetOption56 1 # Wi-Fi network scan to select strongest signal on restart
SetOption57 1 # Wi-Fi network re-scan, alternate AP
```
This combines to:
```console
Backlog Delay 50; InterLock 1,2,3; InterLock on; PowerOnState 0; PowerRetain 0; PulseTime1 145; PulseTime2 1; Pulsetime3 145; SetOption1 1; SetOption26 1; SetOption56 1; SetOption57 1; Restart 1
```
A second solution to use this curtain switch.
Template:
```console
Template {"NAME":"WF-CS01","GPIO":[157,0,54,18,22,11,0,0,9,21,53,23,52],"FLAG":0,"BASE":18}
```
Some rules to change button color and hold the middle button to turn the timer on or off. (LED status is not perfect if you use the web interface for the timer!)
```console
rule1 on Power1#State=0 do LEDPower1 0 endon on Power1#State=1 do LEDPower1 1 endon on Power3#State=0 do LEDPower3 0 endon on Power3#State=1 do LEDPower3 1 endon
rule1 1
rule2 on button2#state=2 do backlog timers 2; LEDPower2 2 endon
rule2 1
```
An some important commands:
```console
interlock 1 2 3 # lock the relays, only one relay can be on
SetOption1 1 # restrict button-multipress to single, double and hold actions
PulseTime1 145 # set relay 1 activation to 45 seconds (+100 for 1sec interval)ru
PulseTime2 1 # deactivate button 2 immediately after activation (disables relays)
Pulsetime3 145 # set relay 3 activation 45 seconds (+100 for 1sec interval)
PowerOnState 0 # keep relay(s) OFF after power up
PowerRetain 0 # Don't retain states
SwitchMode1 5 # pushbutton with hold
SwitchMode2 0 # toggle (default)
SwitchMode3 5 # pushbutton with hold
SetOption11 1 # Swap button single and double press functionality
```
This module is based on the Tuya [TYWE3S](https://tasmota.github.io/docs/Pinouts/#tywe3s) and TuyaConvert isn't working anymore (but one can always try..)

The inside of this module looks like this:


And the processor boards:


The device has a separate MCU on board which connects to the TYWE3s module via Rx and Tx.

To be able to flash the device one needs to make 5 connections and CUT the RxD0 line
Important: Cutting the Line in my model resulted in the middle button not working afterwards,
so after the flash I had to resolder the cut connection:

Flashing can be done in several ways: Arduino IDE, VSCode, Platformio, ESP8266Flasher, etc.
> !!! BE CAREFUL: always use 3,3 volts for power, NOT 5 volts, and DISCONNECT THE MAINS COMPLETELY while working on the device !!!
The WF-WS01/02/03 have the same boards inside and can be flashed the same way.