Automatic/Motorized Water Shut Off Valves

Awesome. Thank you very much!

Let me know how it goes- Iā€™m building my controls for the shutoff valve with leak sensors this weekend and Iā€™m open to other ideas.

For example, Iā€™m trying to make simple ways of resetting the valve position when there are quasi false alarms etc. for example- someone mopping the bathroom floor- so right now Iā€™m using Telegram to allow me to quickly text an override to node red to clear the valve action once we quickly confirm itā€™s just mop water. Iā€™m looking for more cases like this, so when I roll out the system to my fam- it just works without irritation.

Out of curiosity, why you decided to use mode: INPUT_PULLUP? I read about this, but I am not sure how you identify when it is necessary.

Thanks for asking @ReX! If I remember correctly, I copied this code from elsewhere so I didnā€™t come up with it or really even think about it, it just worked. I do have some experience with building ESP8266 devices, now; much more than I did back then for sure.

So, I know that this option tells the ESP8266 that the pin is going to be active low and should be ā€œpulled upā€ by default using a built-in resistor that is tied to VDD. This makes the signal walk up to VDD when the button is not pressed. As soon as the button is pressed it will overpower the resistor (because usually the button shorts the signal to GND) and the signal will be driven low.

Iā€™m glad you asked this question because I wasnā€™t aware of this, but after doing a quick Google search it looks like all GPIOs on ESP8266 have optional pull-up resistors except for GPIO16 which has a pull-down. Iā€™ve actually been using external pull-up resistors for some time now without this knowledge! LOL. Very handy to have this option built-inā€¦

Thanks for the prompt response, hope you donā€™t mind I ask some moreā€¦

Not sure I follow what you say: isnā€™t this already addressed by ā€œinverted: Trueā€ (by default circuit closed - goes open when button pressed)?

The ESPhome explanation is:

If youā€™re hooking up a button without an external pullup or see lots of ON/OFF events in the log output all the time, this often means the GPIO pin is floating.
For these cases you need to manually enable the pull-up (or pull-down) resistors on the ESP, you can do so with the Pin Schema.

What does it mean ā€œwithout an external pullupā€? And what does it mean that you enable the pullup/pulldown resistors?

1 Like

@ReX youā€™d better read an article describing pull-up and pull-down resistors. This wiki is a pretty good resource: Pull-up resistor - Wikipedia

An external pullup is a physical resistor that you hook to one of the GPIOs. Hereā€™s a random image I found as an example:

image

If you define the pinMode as INPUT_PULLUP in ESPHome, youā€™re telling the ESP8266 to enable the internal pull-up resistor, otherwise it will leave the GPIO disconnected from any pull-up.

1 Like

Thanks, I will look into the link, so far I am still confused :slight_smile:. Not sure if INPUT_PULLUP means to use the internal pullup (as opposed to the external one), but before anything let me read the articleā€¦!

Hi @SpikeyGG
I was wondering after flashing custom firmware on top of it
If youā€™re able to adjust the opening/closing of the valve (say 30%,60% for example) instead of just complete open/close.

You cannot. It isnā€™t built with a stepper motor, this is just like a relay: on/off

Hi, if I went for diy valves, should be looking for these types of motor:

  1. Stepper motor
  2. Servo motor
  3. Solenoid motor

Iā€™m not too sure about 3rd one if I can adjust the opening

Iā€™ve been thinking of buying the tuya valve controller discussed in this thread, but I found this video that shows how the valve defaults to the ā€œoffā€ position every time itā€™s powered on: Useelink Tuya Water Valve Problem and How I Solved it in Home Assistant - YouTube

Is it possible to fix that behaviour using esphome? Iā€™d like the valve to remain in its current position when powered on. (Not a big fan of the solution in the video above, where he configures Home Assistant to turn the water back on after the fact)

Mine does not do that.

1 Like

Do you know if that was the behaviour with the original firmware as well? Iā€™m wondering if itā€™s a hardware issue on some variants that canā€™t be fixed, or if itā€™s a firmware issue that goes away after flashing esphome.

This is the one thatā€™s available on amazon.ca, and there are a few reviews that report the same issue: https://www.amazon.ca/Owfeel-Control-Compatible-Application-Program/dp/B07SG48KSW/

I think it did but it has been so long that I canā€™t remember for sure. It doesnā€™t really matter because if you get ESPHome on it you can make it do whatever you want.

1 Like

You can use the restore_mode on ESPHome to set the valve either open or closed on bootup

Hello there,

I also bought these smart valves. But I think it doesnā€™t has an esp chip inside. Looks compatible though.
So If I desolder then solder in a sip like this that would work right? Or should I use different chip?




Itā€™s also worth noting that even if you can get a valve controller that can handle doing this, Ball Valves are generally designed to be used for On/Off toggling, and leaving them partially opened for long periods of time can result in the valve getting stuck.

Thatā€™s not to say itā€™s impossible, just something to be aware of before to implement it as, say, the main shut off valve for your entire house.

Yep, itā€™s pinout matches with esp12s

Itā€™s partially opened when in use, most of the time itā€™s closed

Thank you for the confirmation.
Other thing, what do you recommend for programming? How can I install esphome to a sip like this?