Hassbian + Z-wave + DIY sprinkler controller

Hey everyone, been using Hassbian for a little less than a year and have mostly been a lurker on these forums (which have been a godsend for troubleshooting!) and thought I’d share my current setup and a recent project. First off, I can’t take that much credit for this as there are plenty of DIY Raspberry Pi sprinkler controllers out there and (I believe) a fair amount of HA-based ones. So I had plenty of information at my disposal as I was putting this together.

Long story short I had been looking to upgrade my 6-zone sprinkler system to some kind of “smart” controller for some time. We’re pretty sure the previous owners of our house installed the system and it’s kind of a rat’s nest. So as I’ve been removing sprinkler heads, moving some to other locations and doing general inspection of the system it has always been a pain to have to go to the garage, switch on a valve then run outside to see which heads came on. Also forgetting to turn it off when it rains (or back on after it stops raining) was annoying, and I didn’t want to expend the money and time to wire up a rain sensor. I starting looking at a few off-the-shelf controllers (and OpenSprinkler) but all had more than I really needed since HA on my Raspberry Pi 3 could do everything with some basic hardware (the Pi is also barely taxed at all with my current setup, so I figured it could handle this no problem). First the hardware list:

I started by pulling a length of 18/7 sprinkler wire along with a CAT6 cable to the other side of my garage, which happens to be a fairly central location in our house for the z-wave devices. I wanted to keep the Pi running on POE in case of power failures (we have a fair amount when boom truck drivers run into overhead power lines :confused:) and the UPS I have my POE switch plugged into has roughly an hour of runtime. My garage walls are insulated and drywalled so I had to hole-saw through the top plates with a right-angle drill attachment and fish the wire through (used a fiberglass wire fishing tool from Harbor freight); a fair amount of work but worth it.

I followed these wiring directions for the valve wiring with a small modification using the AC/DC converter to power the relay using the VCC-JD jumper pin. I read on the Raspberry Pi forums that it’s not good to mix 5V and 3.3V logic and the Pi itself may not have enough amps to power the relay (I think a best-case scenario is something like 200 mA). Also since I was using a 1.6A brick, it made more sense to tap into the power there.

Right now I have just a simple input select to control one valve at a time using 7 automations to switch on/off the individual GPIO switches. I haven’t put together a schedule yet since the temperature is dropping here and I’ll be blowing out the system in the next few weeks, but putting together a complete HA package with a scheduler will be my winter project! I plan on updating this post when I get around to that. Thanks for looking!

Sprinkler%20controller

For anyone interested, I’ve uploaded the code and build instructions to Github.