ESP8266 Valve actuator

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:

6 Likes

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?

Waiting on one of these( should be here today) from the link posted above.

the device uses IO12 for the pushbutton, IO13 for the relay and IO0 for the diode.

I tried this. I installed EspHome and used the GPIOs you described and it worked.

switch:
  - platform: gpio
    name: "${devicename} relay"
    pin: GPIO13
    id: switch_relay
    restore_mode: RESTORE_DEFAULT_OFF
    icon: mdi:water-pump
    on_turn_on:
    - logger.log: "Valve Turned On!"
    on_turn_off:
    - logger.log: "Valve Turned Off!"

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO12
    name:  "${devicename} button"
    on_press:
      - switch.toggle: switch_relay

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!

3 Likes

Hi.

This works as intended, with tasmota 7.1.2. The pinout and gpio are correct as the link provided.

You may need to set the tasmota template correctly as stated here: https://blakadder.github.io/templates/honeyzy_DN20.html

The open/close duration is arround 7 seconds, on each way.

Also, the power supply is a DC 12V 1A one. This is a must for those how might want to add power backup with batteries.

Thanks.

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)

Do anyone has a clue?


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.

Thanks

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.

1 Like

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.

https://www.aliexpress.com/item/32977505873.html…

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.