Automatic/Motorized Water Shut Off Valves

I use a z-wave shutoff like this one.

I have been very happy with it and it requires no plumbing. If you have a quarter turn handle shutoff like that, I recommend it.

I started looking at these things and I found this one (WiFi) for $35, how do you hook this kind of thing up to Home Assistant?

1 Like

Not sure on that one.
I don’t use many wifi devices, but I would imagine if you can find the chip it uses, you could flash it. It says it uses the Tuya/Smartlife App so it seems possible. Never done that before, but I’ve seen/heard of loads of people flashing those (Tasmota maybe?)

Looks like Tasmota is possible on them:

https://templates.blakadder.com/jinvoo_SM-AW713-v2.html

1 Like

Hah! I totally bought this: https://www.amazon.com/gp/product/B07F36MVVT

I got it tonight, flashed it to Tasmota 8.1.0.9 using the OTA spoof of tuya-convert, then used the template @Holdestmade shared and added the switch to home assistant using MQTT. Works fantastically!!

1 Like

I just learned that we can flash ESPHome.io over Tasmota. I’ve been converting my Tasmota devices over to ESPHome so I decided to do it with this one. Works awesome! If you want to do the same, here’s how:

  1. On the Tasmota device, if the version of Tasmota is new enough (mine was 8+) you won’t be able to flash an image that isn’t a tasmota image. In order to get around it, you can use the setoption78 1 command on the console and then reboot Tasmota. When it comes back you can flash it with whatever you want.
  2. Write up the replacement EPSHome.io yaml file. It turns out these Jinvoo SM-AW713 v2 Valves (I paid $32 on Amazon) are clearly documented on a Tasmota webpage (thanks @Holdestmade). I made a template switch and handle the relay in it. The light is a freebee, not sure why they have two LEDs on this thing.

–EDIT 10/8/2023 –
PLEASE DON’T USE THE YAML IMMEDATELY BELOW
I’VE FOUND BUGS: SEE THIS POST

I’m leaving this here for posterity but beware that it has bugs with the latest versions of ESPHome.

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO13
      mode: INPUT_PULLUP
      inverted: True
    name: "Button"
    id: button
    internal: True
    on_press:
      - switch.toggle: relay_template

status_led:
  pin:
    number: GPIO4

light:
  - platform: binary
    id: valve_status_light
    name: "Main Water Valve Status"
    output: valve_gpio5

output:
  - platform: gpio
    id: valve_gpio5
    pin:
      number: GPIO5
      inverted: True

switch:
  - platform: gpio
    pin: GPIO12
    id: relay
  - platform: template
    name: Main Water Valve
    id: relay_template
    icon: 'mdi:pipe'
    lambda: |-
      if (id(relay).state) {
        return true;
      } else {
        return false;
      }
    turn_on_action:
      - light.turn_on: valve_status_light
      - switch.turn_on: relay
    turn_off_action:
      - light.turn_off: valve_status_light
      - switch.turn_off: relay

  1. Generate the binary image file from ESPHome.io: click on the three dots for the device, choose Compile when it’s done download it to your computer/phone.
  2. Navigate to your Tasmota device’s webpage, choose Firmware Upgrade then choose Upgrade by file upload, select your binary image and fire it off!

When it comes back it’ll be an ESPHome device and you should be able to hook it up directly to Home Assistant without using MQTT! :smiley:

2 Likes

@SpikeyGG its very interesting !
What plateform use un yaml (i suppose ESP8266)?
And board ?

Yeah, I think it’s just an ESP8266. I just bought the cheap shutoff valve from Amazon and reprogrammed it with Tasmota and then again with ESPHome. I’ve got Home Assistant running on a Raspberry Pi 3.

1 Like

Yeahhhh @SpikeyGG It’s working great!! and it’s really easy!

Hi, is there anyway the following valves can be integrated in hass or nodered?


or

Should be ok to Tuya Convert:

How did you get it to reset? I was able to wipe the wifi by holding in the power for 6 seconds, but I can’t get it to connect to the Pi like my other Tuya stuff when I try to flash it. If there another kind of reset?

@JoeA, I’m not sure I know what you mean. I didn’t need to reset it. I flashed it to Tasmota, then flashed it to ESPHome. I don’t remember having to reset it other than pulling the plug from the wall.

I couldn’t get mine to connect to the Pi to flash over the air like the rest of my ESP stuff. I saw that some devices have a reset button of some sort that you have to hold to get it to flash fast so that it looks for that wifi network. I’ve been able to reset the wifi, but can never get it to connect to the Pi to flash. I might have to open it up to look for another way to flash it.

Yeah FYI they’ve been pushing out a new firmware which makes tuya-convert no longer work (see https://github.com/ct-Open-Source/tuya-convert/issues/483)…currently you either need to solder (which isn’t too difficult) or use a jig like this https://www.thingiverse.com/thing:3231225

@JoeA Did you ever get to flash it via Tuya Convert or via soldering? I have opened mine and the circuit boards look like on these pictures but I’m not sure where to solder TX and RX: https://imgur.com/a/MX4UtMK

I just reprogrammed the OwFeel shutoff valve using the main soldering technique - because the easy way is no longer available. I was waiting for my water sensors to arrive from China before mounting it. They just arrived so I’m about to fully integrate. Are you all set or do you still need help reprogramming?

@Foosman Thank you for your reply. I haven’t been able to figure out how to do the soldering. What pins have out been soldering to TX and RX? And did you flash Tasmota via Tasmotizer or Arduino IDE?

Morning- I flashed via tasmotizer. Ironically right when I figured out that it’s a common WiFi chipset- I was able to find pinouts all over the place. I’m going to try and paste picture here, but if I can’t, the TX is the corner pin, and RX is the one right beside it. (Obviously you’ll want to connect those to the RX and TX of your serial programming interface). The Gnd and 3.3 are located on the other two corners as you work your way around clockwise from corner to corner. Lastly- remember to push gpio to ground when you boot, to enter programming mode. Crossing my fingers this picture works - I’m posting from my phone…

Awesome. Thank you very much!