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?
@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:
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.
Thanks, I will look into the link, so far I am still confused . 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:
- Stepper motor
- Servo motor
- 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.
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.
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?