I was recently at the movies and my phone started ringing off the hook. Two different neighbors were calling to say they saw my crazy dog running around outside the fence. I knew I needed a way to make sure my gates were closed. I read a few threads here and got some ideas, and I wanted to post up exactly what I did for anyone else who may want to do the same.
In short, I bought an Indoor/Outdoor, wide gap open/close sensor, paired it with a dry contact switch sensor, a waterproof project box and some screws/caulking. All in the job took 15 minutes per gate.
Parts:
Chamberlain Wide Gap Bar Switch, $7.30, Bar Switch Sensor Wide Gap Surface Mount Contact Security Alarm System Contact | eBay
https://photos.google.com/photo/AF1QipNKpJmZ7cBiGHC4zIbcrh-731XARYb3ajWjhPh-
Estone Project Box Kit, $8.76, Amazon.com
Aeotec by Aeon Labs ZW097 Dry Contact Sensor, Small, White, $34.95, Amazon.com
I started by connecting the Bar Sensor to the Dry Contact sensor and testing sensor placement. Once I found a good location I drilled a hole in the enclosure and threaded the wire through the box:
Then Mounted the sensors and the box:
Once I was satisfied with the location and sensor placement I put the Aeotec sensor in the enclosure, added a dollop of silicone at the opening and sealed it up tight.
Once all that was done I installed the custom device handler from this thread:
and I was in business.
Hope this helps!