Yesterday I received a Wifi valve actuator I ordered from Aliexpress:
Luckily as I hoped the valve actuator does contain an TYWE3S which has a ESP8266 and could easily be flashed with preferred firmware; ESPHome, ESPEasy, sonoff-tasmota, espurna and so on.
Didn’t have time to flash it or check the GPIO yesterday.
Found the below link which states that the relay has GPIO-13, LED GPIO0 and the pushbutton GPIO-12:
Hi.
I actually have the same project. I intend to use Esphome in order to simplify it. Since this is the first time I will program, I am still trying to determine which GPIO controls what.
Did you flash it? How did you setup the GPIO pins?
Thanks for posting this information. Now I can automatically close my main water line when a leak is detected under the sinks, bathrooms, water heater. This is great!
Hi everyone. I’d like your insight on this little bugger
This is the pcb board of the valve actuator I got I brut forced un-solder the esp8266 as well as the 2 end switches and the magnetic relay (don’t worry I bought 4 of those for my project).
As stated above by the most useful pins are
GPOI 12 : Switch button
GPOI 13 : Relay
GPOI 5: LED red
GPOI 4: LED green or blue (can’t remember)
But there is also 2 other pin used ( although not really useful) and I cannot figure out what they are used for and how to configure them.
GPOI 15 (link with R6 resistor and I think to the (-) 12v DC )
and
CH_EN (directly to the esp8266 VCC)
GPOI 15 is for boot configuration. GPIO 15 deals with booting from SD-CARD when pulled high.
CH_EN is the chip enable aka the on/off switch for the esp.
Also, GPIO 0 needs to be low to boot into program mode for flashing.
I have the same PCB as mbt but my relay is on GPIO12 and button on GPIO13.
I have the same valve (just checked the PCB) and I am going to use your code (first time I try ESPhome). But… can you tell me what happens with the LED? Do you leave it off all the time? I don’t see any code controlling GPIO0.
After flashing ESPhome, the long press functionality is missing?
BTW… as part of my ESPhome learning process, I have seen a different example (for a valve with a different PCB, here: Automatic/Motorized Water Shut Off Valves) that is slightly more complex. The users use INPUT_PULLUP and inverted for the binary_sensor. Isn’t this required for this PCB?
I am not using the led, my valve is hidden in the basement and I don’t see it, therefore I didn’t have a need for it.
I am not sure why the on_press is not working for you, I will try to check the valve later and see if mine is working.
I saw the other examples, you could implement his example instead, you just need to have the correct gpio setup on your code. I didn’t have time to check if that valve uses the same gpios as the one that I am using. I have an extra valve, I might play with that code and let you know.
I haven’t yet flashed mine (waiting for the USB to TTL adapter). Actually my question is: if I flash ESPhome, will the valve enter in pairing mode when I long press the button (or that functionality is missing once an ESPhome firmware is installed)?
No, once you flash it with esphome, the pairing functionality will not work anymore. You have to go to Home Assistant and then under Configuration/Integration you will see the new node. Home Assistant will also look for new devices and it will tell you that a new device was found.
Once you flash it, then you won’t be able to use it with the Tuya app.
We the end switches connected to the ESP8266 chip? If they were then this opens up a possibility to detect if the valve is open or closed (and not stuck half way) which adds an extra level of protection.
I just got a similar switch I was playing with - I’ve been looking for the “newer style”, which has a longer contact point on the handle and on the pipe. Sadly, this version ships with an incompatible WB3S Tuya chip. On the upside, the chip is pinout compatible with an ESP-12F (just have to bridge GPIO15 to ground in the bottom right).
The switches used to disable the motor are NC switches that get fed +12V when “open” I believe. For some reason, my probing was wrong, and I blew up two ESP-12F already while trying to connect these to the ESP12’s extra pins. I’m not sure I want to make a voltage divider using thru-hole resistors as my wires to enable this.
Soo i buy motor valve.On tasmota site was this valve from Hoenyzy,sad that have ESP chip that you can flash with tasmota.After i open i see thay i have non ESP chip,it was Tuya CBU chip beken 7231N. I want to flash with opnbeken flasher.
The flasher/windows just ding ding ding ding, and cant recognise COM port connected USB+Tuya chip.I reset,… no luck. So F. that and replace with ESP D1 Mini.
First: Heat with hot air the chip. Because i dont have hot air: a lot of flux solder and praying and some force peel of the chip.
I broke some traces. So just scrape some color from trace and solder wires to d1 mini.
Flash D1 mini with tasmota,use basic template,and sonoff basic module type.
Use GPIO12 button, GPIO13 led_i, GPIO14 Relay.
D5 relay, D6 button, D7 led.
Use some epoxy glue on wires,to hold that the traces dont tear off the board. Tape the mini on board and you have tasmota motor valve.