Greenfield Automatic Security Valve (water-main flow control)

The Greenfield ASV100 is an industrial strength water valve that I fitted on my water-main to provide flow control in case of a leak. I have a mixture of old Insteon and new Aqara water sensors scattered throughout the house that have saved my bacon a few times. Although the ASV100 is expensive, I figure it is cheaper than a flood and I want something reliable and effective. I was also able to get my ASV100 for $300, so they can be found for cheaper than the MSRP if you shop around.

Initially I had my valve hooked up to an Insteon I/O Linc, but that had some issues and was unable to utilize the feedback lines reading open/closed. Eventually, I switched to ESPHome and a Lolin Wemos D1 Mini. I used the D1 Mini in conjuction with a tripler-base, a power shield, and a relay shield. I found an old 12V power-supply brick and stuffed the whole thing into a project box.

The wiring for the ASV100 is diagrammed in their documentation:

The tripler base has, from left-to right, the 12V shield, the relay, and the D1 Mini. Here is a not very good picture of that, installed.

Starting with the 12V power, I plugged the barrel connector from the brick into the 12V shield and then used the VIN/GND of the terminal block next to it to run 12V from the shield into the leftmost (NO) terminal block of the relay. This same input has the red wire from the valve pigtail to supply constant 12V to the valve.

The ground from the terminal block of the power shield goes to the black of the valve pigtail.

The middle of the relay block goes to the white “+12V output trigger” on the valve pigtail. Then I used matching color wires to provide leads from the D1 Mini solder points to screw-nuts for the remaining wires on the pigtail:

  • D5 to Orange “Feedback Open”
  • D6 to Purple “Feedback Closed”
  • Tripler ground to Green “Feedback Common”

Sample ESPhome YAML:

substitutions:
  device_name: watermain
  friendly_name: Watermain

switch:
  - platform: gpio
    name: "${friendly_name} Valve"
    pin: D1
    id: relay
    restore_mode: RESTORE_DEFAULT_ON
    
binary_sensor:
  - platform: gpio
    device_class: opening
    name: "${friendly_name} Valve NO"
    id: "${device_name}_valve_no"
    pin:
      number: D6
      mode: INPUT_PULLUP
  - platform: gpio
    device_class: opening
    name: "${friendly_name} Valve NC"
    id: "${device_name}_valve_nc"
    pin:
      number: D5
      mode: INPUT_PULLUP
  - platform: template
    name: ${device_name}_valve
    device_class: opening
    lambda: |-
      if (id(${device_name}_valve_nc).state == true && id(${device_name}_valve_no).state == false) {
        return false;
      } else {
        return true;
      }

The template binary_sensor takes the redundant input from the Valve NO/NC and combines it into one sensor. You can make the Valve NO/NC internal and not exposed to the HA API if you wish.

Here are some automations to go with this. The valve is shut off if any water sensor is wet, and it is also exercised once a week in the middle of the night.

- alias: 'Water Sensor Wet'
  id: water_sensor_wet
  trigger:
    platform: state
    entity_id:
      - binary_sensor.washing_machine_water_dry
      - binary_sensor.boiler_water_dry
      - binary_sensor.mud_room_water_dry
      - binary_sensor.kitchen_sink_water
      - binary_sensor.basement_bathroom_water
      - binary_sensor.half_bathroom_water
      - binary_sensor.master_bathroom_sink_left_water
      - binary_sensor.master_bathroom_sink_right_water
      - binary_sensor.master_bathroom_water
      - binary_sensor.upstairs_bathroom_water
    to: 'on'
    from: 'off'
  action:
    - service: switch.turn_off
      entity_id: switch.watermain_valve    
    - service: notify.iphone_critical
      data_template:
        message: '{{ trigger.to_state.attributes.friendly_name }} is wet.'

- alias: Water Main Off
  trigger:
    platform: state
    entity_id: binary_sensor.watermain_valve
    to: 'off'
  action:
    service: notify.pushover
    data:
      message: Water Main turned off

- alias: Water Main On
  trigger:
    platform: state
    entity_id: binary_sensor.watermain_valve
    to: 'on'
    from: 'off'
  action:
    service: notify.pushover
    data:
      message: Water Main turned on

- alias: Water Main Cycle
  trigger:
    platform: time
    at: '03:30:00'
  condition:
    condition: time
    weekday:
      - wed
  action:
    - service: switch.turn_off
      entity_id: switch.watermain
    - delay: "00:00:15"
    - service: switch.turn_on
      entity_id: switch.watermain

If you export your devices to HomeKit, it is important to specify that this “switch” is actually a “valve”:

    switch.watermain_valve:
      type: valve
1 Like