ai91 / dee

Arduino project to control ESP8266-based relay-switch module as a 1-channel light switch
MIT License
1 stars 0 forks source link

Compatibility with Tuya Switch single input from switch? #1

Open aleroot opened 4 years ago

aleroot commented 4 years ago

Is this firmware compatible even with this other model of the switch ?

https://www.aliexpress.com/item/33013535262.html

Have you tried ?

ai91 commented 4 years ago

No, I didn't try. But if it's based on some Espressif ESP - then should be compatible.

Tuya produces many modules, which are based on different chips. I've personally tested ESP8285 (TYWE2S), ESP8266 (TYWE3S), RTL8710BN (WR2E). First two are Espressif - they can easily be flashed with this firmware.

I would recommend to open your module, check the WiFi module, and find datasheet to see chip used there. For example here is a TYWE2S on official webpage: https://docs.tuya.com/en/iot/device-development/module/wifi-module/wifie2smodule , or on third party webpage: https://fccid.io/2ANDL-TYWE2S/User-Manual/Users-Manual-3596121

Most probably it would be necessary to update GPIO mappings - but you need to analyse which IO is responsible for what action. NB! even if your module is based on same TYWE2S as used by me, most probably the mapping is different, as each manufacturer is free to develop own schematics and use different GPIOs for same purposes. To find GPIO mappings, I flashed ESPEasy firmware and then was controlling/analysing remotely (to avoid module connection to PC while the module is powered with 220v). But you also can prepare simple dummy firmware with MQTT or simple REST interface. After you collect all GPIO mappings, you can update constants in my firmware with your IO's, and it should go.

ai91 commented 4 years ago

OKay, I did some research. No, it's not Espressif. In comments on product page you've sent, some buyer posted picture: https://ae01.alicdn.com/kf/Ua5a7b31be96b4362935344b36289fcecV.jpg where it's possible to see it's a WA2 module. Unfortunately it's not documented on official Tuya site, but in home-assistant community some guy did remove shield and realized there is a BK7231 https://community.home-assistant.io/t/unkown-tuya-chip/153591/2

As far as I see, they stuck in flashing it, and one member ended up by replacing internal WA2 with ESP12 :D