Brent Saltzman


Interested in all things technology with a passion for analog, design, audio, and anything that sparks creativity and imagination.


Adding a Z-Wave Door Sensor to your Backyard Gate

I spent some time looking for a Z-Wave sensor for my backyard gate. I didn't find much for something that was rated for outdoors and all weather so I made my own.

The key here is utilizing my favorite Z-Wave Door Sensors by EcoLink because they have an internal connection for wired sensors allowing you to connect almost anything to these. I was able to find a heavy duty stainless steel garage door contact sensor and I was off and running.

You'll want to enclose your Z-Wave Door Sensor in something that is rated IP65 or higher to protect it from the elements. I went with this sealed project box here that was just deep enough for the sensor and mounted nicely on my 4" fence post.

Drill a hole in your enclosure to pass the armored cable from the sensor and attach it to the contacts inside your Z-Wave sensor. It's a little messy, but I used some outdoor sealant to seal up the cable entrance into the enclosure.

Door Sensor inside enclosure

Install the cover back onto the enclosure with the gasket seal. I like to treat it like lug-nuts on a tire and tighten each one in a diagonal fashion to ensure an even seal around the enclosure.

Mount the contact sensor near your gate opening and attache the magnet and bracket (if needed) to the gate.

Mounted Contact Sensor Mounted magnet

What I really like about this garage door contact sensor is that it has a 3" open gap where it will still read as closed. You can mount the magnet on the gate door in such a way that it isn't visible from the outside and it made for a very clean and covert installation.
View from outside

Now the fun part, I will presume you know how to include the Z-Wave sensor in your network. I use Home Assistant for all of my home automation needs. I like to use template sensors to make my Door Sensors make a little more sense to me in the frontend:

sensor:  
  - platform: template
    sensors:
      backyardgatestate:
        value_template: '{% if 
        is_state("binary_sensor.ecolink_doorwindow_sensor_sensor_14_0", "off") %} 
        Closed
        {% else %}
        Open 
        {% endif %}'
        friendly_name: 'Backyard Gate'

And now we can create automations based off of the gate such as an alert notification or turning on some exterior lighting in your backyard!

automation:  
  alias: Notify iOS app backyard gate was opened
  trigger:
    platform: state
    entity_id: binary_sensor.ecolink_doorwindow_sensor_sensor_14_0
    to: 'on'

  action:
    service: notify.ios_iphone
    data:
      message: "Backyard Gate is open!"
      data:
        attachment:
          content-type: jpeg
        push:
          category: camera
        entity_id: camera.backyardcamera

Hope this helps someone out! Sometimes it's very easy to build it when a specific device does not exist!

Previous Post |