I’ve been waiting for something like this - great work! I’m using ST on an Android OS phone. At some point, will your code work for ST on Android?
@jbeletti It works well both on Android/iOS … the code is not platform dependent.
Cool. I look forward to building and trying this out later this summer.
Actually, the system is already compatible with input buttons! You can pair the system with the Aeon MiniMote which allows you to individually control all 8 zones! The MiniMote has 4 buttons but each button can sense when its either “pressed” or “held”, giving you in effect the ability to control 8 switches. To use with this project, just virtualize the 8 relays and pair with the MiniMote. I tried this today and it took me just a few mins to hook up, after spending about 10 mins virtualizing my switches.
And here is the cool part: no need to run back and forth to the garage to activate the next zone. Just walk and click. This should easily work for the use case of when a repair person comes to work on the system. Just hand them the MiniMote.
I added some instructions to both virtualize the switches and pair the MiniMote to the README file on github under our MASTER branch.
Here is an excerpt:
Take Your Controller to the Next Level:
We modified our Device Type command set to be compatible with the Virtual Switch capability by Jonathan (jwsf on github or badgermanus on SmartThings). This allows you to virtualize each of the 8 zones giving enhanced ecosystem capabilities. Virtualizing gives each zone its own “switch” capability that can be recognized within SmartThings ecosystem. Then you can start linking irrigatoin zones to all the SmartApps that link switches to other devices.
For example, you can use the “Turn on when there is motion” SmartApp to connect an irrigation zone to a motion detector and trigger the sprinkler every time deer or intruder enters that zone!
As another example, you can use the Aeon Labs MiniMote to wirelessly turn on and then off individual zones. This is great if you do not have your iPhone or if you have a repair person working on your system. The repair person just needs the MiniMote to switch the zones. No running back and forth to the garage to advance the system!!!
Here is how to virtualize your switches:
- Log into graph.api.smartthings.com
- Go to “My Device Types”
- Create a new SmartDevice, filling out the required info to create the device
- Paste in the VirtualSwitch.groovy code from jwsf.
- Save and Publish (for me)
- Go to My SmartApps and create a new SmartApp
- Paste in the modified code for the VirtualSwitchParent.groovy. I have modified to recoginize our Irrigation Controller. Be sure to use the modified code.
- Save and Publish (for me)
- Go to My Devices and create a new Device.
- Give it a ‘name’ and a ‘label’ such as “Virtual Irrigation Zone #1”
- Under ‘type’, select “virtual switch”, which is the device type you created in #4 above
- For ‘version’, select “published”
- Now repeat this 7 more times for each of your zones!
The above is a bit tedious. As soon as SmartThings supports child devices, I imagine we will update our code and can do away with the need to create virtual switches.
Now for the cool part. To control your system with the Aeon MiniMote:
- Add the MiniMote to the sytem using Aeon’s instructions "Becoming a Secondary/Inclusion Controller to Another Z-Wave Controller or Gateway in an Existing Z-Wave Network
- When it asks you to configure ‘button 1’: add Virtual Irrigation Zone 1 as the switch under ‘Pushed’ and Virtual Irrigation Zone 2 as the switch under ‘Held’
- Repeat for buttons 2,3,4 using zones 3-8
Now when you ‘push’ or ‘hold’ a MiniMote button, the corresponding zone will activate. If you push again, it will turn off. If you do not turn off the sytem, it will run for as long as the zone ran, the last time it was activated from the device type or the smart app. Tip: you can tell push and hold apart. When you push, a solid blue led comes on. When you have ‘held’ the button, the blue led starts flashing.
@mattn is also looking into adding a button directly to the controller. This will be cheaper than buying a MiniMote (but everyone should have at least one) and also allow walk up control at the device.
So you need to control a pump? No problem, we have added two ways to control a pump or master valve. In both cases, the relay controlling the pump or master valve will be activated when any of the zones are active. Also, it will stay activated while the system switches from one zone to the next. And it automatically shuts off after all the zones have finished.
In the first scenario, you can now repurpose relay 8 to control the pump. Simply connect the Pump Start Relay load wire to Relay 8 on your 8-relay board and hook the Pump Start Relay ground wire to your ground wire bundle with the 24V transformer. The SmartDevice tiles now include a tile to activate the use of pump and inactivate relay 8.
In the second scenario, you can also purchase an additional single relay and add to your Arduino. The additional relay is then used to connect to your Pump Start Relay. A small code change activates the additional relay!
I have uploaded the updated Arduino sketch and Device Type groovy code to our Master branch on github. Our Master Branch is where we keep works in progress so there is a chance its a bit buggy or will change. We have a few other enhancements in the works and will create a new release when they are all done. I also updated the README file on the master branch to include some help in setting up the pump connections.
We hope either of these works for your use case. Please provide feedback on how it works!
This is fantastic. How hard would this be to install for someone that has never used an Arduino?
@Jsalicru if you are somewhat tech savy and handy, this really isn’t that difficult. The readme @d8adrvn provides is extraordinary and walks you through the entire process. Give it a shot! I couldn’t be happier.
@Jsalicru Could not agree more with @ziemba_jason
That readme is very detailed, walks you through the entire process.
I am new to this, but where do I “paste the code” in when I am on the new device type screen and where exactly do find the code ( I down loaded the “smart sprinkler master” folder, is it present there and if so how do I access it?). Also do any of the other fields need to be filled out?
To set up the device type, go to graph.api.smartthings.com. Go to ‘My Device Types’ and click on upper right button to create a ‘New SmartDevice’. On the next page, just assign the device a name such as “Irrigation Controller”. Don’t worry about anything else. Click Create New Device.
You should then see the following screen:
You need to replace all the lines of code that you see in the box (lines 1-33). Select all the code on the on lines 1-33 and delete them. Now paste in the code from teh Irrigation Controller.groovy app that you down load from github. Click Save and then Click Publish (for me).
You should really go back to github and download the code from our Release. On the github site you should see a link that says release. Click it and download the release code. Its in a zip file so it needs to be unpacked. Don’t know what machine you have but on a Mac, its automatic.
Thanks, that answered my questions! I appreciate your efforts. I think this is an awesome project and am looking forward to getting it up and running!
I am in the process of installation and have created the new device type without an issue. When I went to create the new smart app I get this error:
500: Internal Server Error
Fri Jul 25 14:56:06 UTC 2014
No such property: name for class: java.util.LinkedHashMap$Entry Possible solutions: value
Any ideas how to correct this? Thanks in advance!
Sorry, ignore my last question I figured out my mistake!
It can be helpful to post your findings - as others may encounter similar things
The mistake I made was only entering the name when I created the smart app and left out the description. Once that was filled in everything worked fine. Thanks again, and hopefully I won’t have any other questions!
Thanks - I have been tripped up by similar things too.
I finished the installation yesterday and everything was working as it should. I set the Irrigation Scheduler app to turn on the system at 6:00AM but it did not come on automatically. I was able to run the zones manually by hitting the main tile and it seemed to work fine and cycled through all the zones. After that cycle was completed I was looking at the Smart app settings to make sure all was set properly, and it was. I then tried to set another timer sequence just to see if it would turn on automatically and it seems as if the Smartthings Shield is no longer connected (the LED light is not on, but the Arduino one is). Is that likely that it is no longer connected to or receiving a signal and if so is it easy to reconnect it without repeating all of the installation steps?
I truly apologize for my impatient, type A behavior. Apparently I have been having some internet connectivity issues which I think is what has been playing havoc on the system. It seems to be behaving normally now.
Glad that the system is working for you.