mirror of https://github.com/arendst/Tasmota.git
Update configuration to use LedMask
parent
abcfd97cf1
commit
9aac2c4b52
|
@ -30,24 +30,30 @@ It appears that there are different versions of the KS-604S. The device that @Da
|
|||
### Alibaba Device
|
||||
<img src="https://user-images.githubusercontent.com/34340210/55679367-8ccdf980-58d8-11e9-8da7-b2fb6ae637cd.jpg" width="500" />
|
||||
|
||||
{"NAME":"KS-604S","GPIO":[56,255,255,17,32,18,255,255,22,21,33,23,255],"FLAG":0,"BASE":18}
|
||||
{"NAME":"KS-604S","GPIO":[56,255,255,17,57,18,255,255,22,21,32,23,255],"FLAG":0,"BASE":18}
|
||||
|
||||
| GPIO | Function | Configuration |
|
||||
|:---|:---|:---|
|
||||
| 0 | Device Status (Green) | LED1i
|
||||
| 3 | Top Button | Button1
|
||||
| 4 | Top LED (Orange) | Relay4i
|
||||
| 4 | Top LED (Orange) | LED2i
|
||||
| 5 | Bottom Button | Button2
|
||||
| 12 | Bottom Receptacle | Relay2
|
||||
| 13 | Top Receptacle | Relay1
|
||||
| 14 | Bottom LED (Orange) | Relay5i
|
||||
| 14 | Bottom LED (Orange) | Relay4i
|
||||
| 15 | USB Port | Relay3
|
||||
|
||||
In order to have the power indicators follow the state of the relays, the two orange LED GPIO must be configured as virtual relays. A rule is used to change the state of the LED "relay" when the real relay is toggled. Also, to avoid excessive flash writes caused by the addition of the virtual relays, disable state saves using [`SetOption0`](Commands#setoption0). In this case, Tasmota will not be able to restore the last known state so [`PowerOnState`](Commands#poweronstate) 3 is not an option. Select the desired power on state for the devices relays. Also, on this device, the status LED default is to turn the LED on whenever either relay is powered on. To avoid having the status LED indicate power status, set [`LEDState`](Commands#ledstate) to only display boot and connectivity status.
|
||||
This configuration requires [LedMask](Commands#ledmask) which was introduced in 6.5.0.7.
|
||||
|
||||
Currently, Tasmota only supports up two LEDs to indicate relay state and connectivity status. With two LEDs defined, LED1 will act as the Wi-Fi/MQTT status LED and LED2 will act as the LED that indicates relay power.
|
||||
|
||||
In order to have the power indicators follow the state of the relays, LedMask must be used to so that only Relay1 controls the second LED. The other orange LED GPIO must be configured as a virtual relay. A rule is used to change the state of the LED "relay" when the real relay is toggled.
|
||||
|
||||
Also, to avoid excessive flash writes caused by the addition of the virtual relay, disable state saves using [`SetOption0`](Commands#setoption0). In this case, Tasmota will not be able to restore the last known state so [`PowerOnState`](Commands#poweronstate) 3 is not an option. Select the desired power on state for the device's relays.
|
||||
|
||||
The following Console statements define the necessary settings and rules for configuring the indicator behavior as described above.
|
||||
```
|
||||
Backlog SerialLog 0; SetOption0 0; PowerOnState 0; LEDState 0
|
||||
Rule1 ON System#Boot DO Backlog Power3 On; Power4 Off; Power5 Off ENDON ON Power1#State DO Power4 %value% ENDON ON Power2#State DO Power5 %value% ENDON
|
||||
Backlog SerialLog 0; SetOption0 0; PowerOnState 0; LEDState 1; LEDMask 0x0001
|
||||
Rule1 ON System#Boot DO Backlog Power3 On; Power4 Off ENDON ON Power2#State DO Power4 %value% ENDON
|
||||
Rule1 1
|
||||
```
|
||||
```
|
Loading…
Reference in New Issue