Alibaba KS-604S

Michael Ingraham 2019-04-07 02:25:12 -04:00
parent b982c44b7d
commit 3c815f5ac5
1 changed files with 37 additions and 9 deletions

@ -1,16 +1,44 @@
This ESP8266 device has a really attractive form factor and functionality (in-wall, single gang, dual outlet, individually controlled).
This Tuya Wi-Fi module ESP8266 based device has a really attractive form factor and functionality (in-wall, single gang, dual outlet, individually controlled).
[@DavinKD](https://github.com/DavinKD) was able to flash this device OTA using Tuya-Convert. This device **must be flashed using [Tuya-Convert](https://github.com/ct-Open-Source/tuya-convert/wiki/Compatible-devices)**. Flashing this device by attaching leads to the serial interface requires disassembling and unsoldering the internal components to get access to the needed contacts. This makes flashing the device by this method highly undesirable.
## Shopping
* [Ali Express](https://www.aliexpress.com/item/Smart-WiFi-USB-Charger-Wall-Outlet-High-Speed-Voice-Control-Dual-Outlets-Individually-Surge-Protection-Remote/32976742669.html)
* [Amazon](https://www.amazon.com/dp/B07JZ124FK)
* [Alibaba](https://www.alibaba.com/product-detail/New-Design-2-way-Double-Power_60817067611.html?spm=a2700.7724857.normalList.54.4dfd645aBY3qAH) (10 minimum)
[@DavinKD](https://github.com/DavinKD) was able to flash this device OTA using Tuya-Convert.
## Configuration
- GPIO2 = Green LED Inverse
- GPIO5 = Button1
- GPIO12 = Relay2
- GPIO13 = Relay1
- GPIO16 = Button2
It appears that there are different versions of the KS-604S. The device that @DavinKD flashed (likely purchased from Amazon in early to mid March 2019) has a different GPIO configuration than devices purchased from Alibaba in late March.
This device **must be flashed using [Tuya-Convert](https://github.com/ct-Open-Source/tuya-convert/wiki/Compatible-devices)**.
Flashing this device by attaching leads to the serial interface requires disassembling and unsoldering the internal components to get access to the needed contacts. This makes flashing the device by this method highly undesirable.
### [@DavinKD](https://github.com/DavinKD) Device
| GPIO | Function | Configuration |
|:---|:---|:---|
| 2 | Device Status (Green) | LED1i
| 5 | Top Button | Button1
| 12 | Bottom Receptacle | Relay2
| 13 | Top Receptacle | Relay1
| 16 | Bottom Button | Button2
### Alibaba Device
![](https://user-images.githubusercontent.com/34340210/55679367-8ccdf980-58d8-11e9-8da7-b2fb6ae637cd.jpg)
| GPIO | Function | Configuration |
|:---|:---|:---|
| 0 | Device Status (Green) | LED1i
| 3 | Top Button | Button1
| 4 | Top LED (Orange) | Relay3i
| 5 | Bottom Button | Button2
| 12 | Bottom Receptacle | Relay2
| 13 | Top Receptacle | Relay1
| 14 | Bottom LED (Orange) | Relay4i
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.
The following Console statements define the necessary settings and rules for configuring the indicator behavior as described above.
> Backlog SetOption0 0; PowerOnState 0; LEDState 0; Rule1 ON Power1#State DO Power3 %value% ENDON ON Power2#State DO Power4 %value% ENDON
>
> Rule1 1