This is my first attempt on writing an app for HomeGenie.
I borrowed some of the code of the Security Alarm System during the learning process, which was very helpful for me.
Code may still have room for improvement, suggestions are welcome.
As per the subject title of this post, this app is a Garden Sprinkler System controller. The app provides the logic to run the sprinkler system on a Cron based time schedule, the number of groups to activate and the sprinkler time. This needs to run on a Raspberry Pi, the app is configured for the GPIO pins of the Raspberry Pi B+, but with a little change of the code it can be made to work on the Raspberry Pi A or B.
This app has an dependency on the Raspberry Pi B+ modified version of the "GPIO Modules" (1000-GPIO_Modules.hgx) for centralized GPIO pin management.
The following attached files need to be installed on your Raspberry Pi:
=============
1000-GPIO_Modules.hgx | GPIO management
1008-Garden_Sprinkler_System.hgx | The Sprinkler App
Guytpetj.zip | The Widget files for this App - copy the content of the zip file to: /usr/local/bin/homegenie/html/pages/control/widgets/
The second part of the Garden Sprinkler System, the relay module for driving the sprinkler solenoids, requires some handy work and soldering.
Hardware needs:
=============
1 x LED
1 x 220 or 330K Resistor
6 x 1K resistor
6 x NPN transistor 2N3904
1 x Prototype board (
http://www.amazon.com/gp/product/B00N1X5CM4/ref=ox_sc_sfl_title_2?ie=UTF8&psc=1&smid=A325CF4XAXVINN)
1 x 8 Relay Module Board (
http://www.amazon.com/gp/product/B00C8O9KHA/ref=oh_aui_detailpage_o06_s01?ie=UTF8&psc=1)
some wire and connectors
The attached ScreenShot.jpg file shows how I have my Sprinkler System group configured. The App is in the top left. In addition I configured a switch for each sprinkler group for the odd time that you manually want to run a group.
Have fun playing with this.
Peter