HomeGenie Forum

Automation Program Plugins and Wizard Scripting => APP Contributions => Topic started by: enterprised on January 01, 2015, 05:45:23 AM

Title: Garden Sprinkler System App
Post by: enterprised on January 01, 2015, 05:45:23 AM
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 (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 (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
Title: Re: Garden Sprinkler System App
Post by: mvdarend on January 01, 2015, 10:45:44 AM
This is great, I've been wanting to set up something like this in my garden. Which Water Solenoid Valve do you recommend?
Title: Re: Garden Sprinkler System App
Post by: enterprised on January 01, 2015, 07:32:29 PM
It's depending on what you get in the Netherlands.

I've cut my Dutch roots 17 years ago and line in the USA now. Spreek nog wel Nederlands, dat vergeet je niet.

I have Orbit solenoids in my system. the sprinkler/irrigation system came with the house when I bought it.
http://www.amazon.com/Orbit-57100-4-Inch-Threaded-Sprinkler/dp/B00004S1V2/ref=sr_1_4?ie=UTF8&qid=1420135414&sr=8-4&keywords=sprinkler+solenoid (http://www.amazon.com/Orbit-57100-4-Inch-Threaded-Sprinkler/dp/B00004S1V2/ref=sr_1_4?ie=UTF8&qid=1420135414&sr=8-4&keywords=sprinkler+solenoid)

Just make sure you get what ever is the standard for where you live. For me in the USA the standard for sprinkler solenoids is a 24 volt AC system. Sticking to the standard means you have the choice of using an of the shelve controller or build one your self like i did once I discovered the unique power of HomeGenie and the Raspberry Pi.

So to make the garden part of the sprinkler system work work you need the following:
========================
24 VAC, 1 Amp minimum, power supply/transformer
Solenoids (as many as you need, for this app not exceeding 6, or with a bit of programming 8 max)

Peter

Title: Re: Garden Sprinkler System App
Post by: igorrobertifoc on February 17, 2015, 11:04:37 PM
Hello, very well.
I would like to command a sprinkler with zwave.. all with battery because i dont have the Electric on garden.. Do you think is impossible?

Title: Re: Garden Sprinkler System App
Post by: bkenobi on February 18, 2015, 04:04:44 PM
Sprinklers work on 24V typically (in the US anyway).  I do not know if the valve needs a constant 24V to hold the valve open or if it sends a signal to open and then another to close.  If they work with the latter, you might be able to use a large 24V battery that would need to be charged periodically or via a solar panel.

Just a quick search on google and I located a solar powered timer:
http://www.homedepot.com/p/DIG-Solar-Powered-Irrigation-Timer-with-Anti-Siphon-Valve-ECO1ASV-075/203766359 (http://www.homedepot.com/p/DIG-Solar-Powered-Irrigation-Timer-with-Anti-Siphon-Valve-ECO1ASV-075/203766359)

I know nothing about it, but it claims to work without any power other than ambient light.  I imagine you could find something similar and modify it to add a control wire.  There might even be one available that is solar powered and has control wires, though I doubt it.  Control wires run from a controller which requires power.  If you can run control wires, you can run power as well.  So, I think you are likely on your own here.

EDIT:  Well, I take that back!  Hunter makes a sprinkler that might be directly usable for you.  It looks like it even has wireless control via a tablet.

http://www.hunterindustries.com/irrigation-product/sensors/solar-syncr (http://www.hunterindustries.com/irrigation-product/sensors/solar-syncr)

If Hunter makes one, perhaps Rainbird and others do as well...
Title: Re: Garden Sprinkler System App
Post by: lv2roc on February 20, 2015, 05:34:57 AM
Newbie trying to install this "plugin".
I have imported the 1000-GPIO_Modules.hgx in my RASPBERRY PI under Automation and Programs. (circle is green)
Created Sprinklers under Automation and Programs.
Imported 1008-Garden_Sprinkler_System.hgx in my newly created Sprinklers. (circle is green)

Extracted zip file and put the contents in the /usr/local/bin/homegenie/html/pages/control/widgets/ folder.
In Groups and Modules I added the Garden Sprinkler System under the Dashboard.
Restarted HomeGenie.

Still no widgets are displayed like the picture you posted. What am I missing?

I will play with it but like I said I am a newbie and maybe someone else is wondering too.
Title: Re: Garden Sprinkler System App
Post by: enterprised on February 20, 2015, 07:13:00 PM
Will have to post an update. there was a change in HG where a file extension changed from .json to .js

renaming the .json extension to .js should fix it. The file is in the zip file you had to copy.
Title: Re: Garden Sprinkler System App
Post by: lv2roc on February 21, 2015, 12:11:50 AM
Perfect! that did it.

Question though...Can you schedule "zones" or "Sprinkler groups" at different times?
Ex.

Every 2 day turn on at 9:00am Zone 1, then 11:00am Zone 2.
Every day turn Zone 3  at 5:00pm

Will the app do that?
Again just a newbie here and my initial look at the interface looks like you set up the Cron with 1 start time.

Looks to be a great app, just trying to get figure out its full potential.
Title: Re: Garden Sprinkler System App
Post by: enterprised on February 21, 2015, 02:52:50 AM
you can make the program do this by extending the pause time between zones

Setup option:
01. Sprinkler Schedule (Cron) [* * * * *]
=== if you make this: 00 09 1-31/2 * * (starts at 09:00 every other day on odd days)

02. Sprinkler Pause Between Groups Time in Seconds
=== if you make this: 6300 (6300 seconds  = 1 hr and 45 min)

03. Sprinkler Active Time in Seconds (600 = 10 minutes)
=== if you make this: 900 (900 seconds is 15 min)


Based on the above, the program will start every 2 days at 09:00, run till 09:15 and then goes in pause till 11:00 to start the next group. It will continue this cycle for the number of groups you activated.

CRON:
# Will only run on odd days:
0 0 1-31/2 * * command

# Will only run on even days:
0 0 2-30/2 * * command


To make different schedules for different days as you asked I will have to add a second CRON instance and list of groups to activate.  This is easily done with some changes to the C# code.


Hope you get this working. For me it works fantastic, much better than the irrigation controller that came with the house.
Title: Re: Garden Sprinkler System App
Post by: lv2roc on February 21, 2015, 04:46:58 PM
Thanks again for your help. I hope other can follow this post to help them as well.

I guess I am off to learn C# after I finish with my self guided Python courses.

Are you allowing others to enhance this app and repost?

I am sure I will be back with questions, thanks again.
Title: Re: Garden Sprinkler System App
Post by: enterprised on February 21, 2015, 04:51:42 PM
That is the beauty of open source software, anybody can pitch in and make improvements, either for their selves or to share with the group. :)

This must have been Gene's vision when he made HomeGenie available to all of us.
Title: Re: Garden Sprinkler System App
Post by: enterprised on February 22, 2015, 05:06:30 AM
Program Update.

This will address the ,json vs .js issue and add new functionality.

!!!!! you must uninstall/remove previous version of this program prior to installing the attached files !!!!!

The Garden Sprinkler System App now has 3 individual schedules, Schedule A, B and C.
For each schedule you can program a time and date based on CRON and assign the individual sprinkler groups.
This should give full flexibility for even the most demanding and creative schedule you may want to use.

App Notes:
=========
Garden Sprinkler System

Activate sprinkler system (irrigation system) based on CRON scheduler.
This program has 3 individual programmable schedules for both time and sprinkler groups.

!!!!! Make sure that Schedule A, B and C do not overlap in time !!!!!

CRON:
* * * * * ( 1 2 3 4 5 ) command to execute
1 = min (0 to 59)
2 = hour (0 to 23)
3 = day of month (1 to 31) (1-31/2 = odd days, 2-30/2 = even days)
4 = month (1 to 12)
5 = day of week (0 to 6) (0 to 6 are Sunday to Saturday

Groups:
1,2,3,4,5,6 = all groups active
1,3,6 = group 1, 3 and 6 active
none = no group active

Title: Re: Garden Sprinkler System App
Post by: lv2roc on February 25, 2015, 10:32:54 PM
Nice update. I like the 3 CRON jobs to increase flexibility.

I have not had a chance to play with it as much as I would like to, but I would like to know if you can skip a schedule due to weather conditions.

My main conditions are current rain and wind conditions. I do not want it to sprinkle my lawn if it is raining or has rain "x" amount in the last 24 hours. As with the wind, do on run schedule if the wind is above a specified wind speed.

These conditions can be taken off Weather Underground or whatever weather info one uses.

If it does this, would you mind posting an example of how to set it up.

Many thanks!
Title: Re: Garden Sprinkler System App
Post by: bkenobi on February 25, 2015, 11:05:13 PM
I haven't looked at the code, but I don't remember seeing those conditions in the write-up.  I'd say that a check for x inches of rain in last day or predicted x" of rain in next y days would be a good thing to include.  I don't see how wind would be critical, but it could be added as well.  I think to add that check, you simply need to add in the value to check for in the setup and then find a source for rain history and rain/wind forcast.  Then, you just add that check in the same location where it checks the cron event as an additional AND statement.  Shouldn't be all that difficult yet very useful!
Title: Re: Garden Sprinkler System App
Post by: lv2roc on February 26, 2015, 04:47:11 AM
Wind is something I have to deal with each watering session. I live in a high wind area and water my neighbors is nice for him but not me.  ;)

I am not a coder but would like to see the app evolve to help everyone.

Title: Re: Garden Sprinkler System App
Post by: bkenobi on February 26, 2015, 04:46:52 PM
I have a pair of Rain Bird sprinkler controllers that have served the home for probably 20+ years.  They work, but don't understand to NOT water when it's raining or about to rain.  If I see that it will rain in the forecast, I have to manually suspend the timer for that day which isn't tragic, but not exactly "automation".  I'm adding a weather station in the near future so this is an app that I've been watching closely from the beginning.
Title: Re: Garden Sprinkler System App
Post by: enterprised on February 26, 2015, 07:19:44 PM
Adding some code for rain and wind conditions is easy to do. I'm currently 5000 miles away from home, but when I get back in a week or so I will add these features. It will most likely be based on the the "jkUtils - OpenWeatherData" app as data provider.
Title: Re: Garden Sprinkler System App
Post by: lv2roc on February 26, 2015, 10:26:00 PM
Very happy to see your post, enterprised. Since you did not mention a definite for going with OpenweatherData, I would like to see about using Weather Underground. Only reason is that I use a personal weather station that is connected to Underground.
Buy hey, you are coding it so I can change. Just wanted to add my 2 cents.
Title: Re: Garden Sprinkler System App
Post by: bkenobi on February 26, 2015, 10:39:05 PM
If the code is written correctly, it will pull data stored on HG.  Then, you just need HG to pull the data from the web site and store it somewhere.  The wind and rain data are included in the output of WU and presumably OpenWeather, so it shouldn't matter where the data comes from!  The primary difference would be calling the right location in HG parameters to get the data that's already stored.
Title: Re: Garden Sprinkler System App
Post by: lv2roc on March 04, 2015, 02:27:24 AM
Hope I am not making suggestions to complex for this app but I have another that would be useful.

To have active time for each group or groups.

For example the group (or valve) for my front lawn would need to be on longer that the group (or valve) that control the sprinkler head in my garden.

I would be nice to have different duration times for different groups (valves).

Again just a suggestion to improve on this great app!
Title: Re: Garden Sprinkler System App
Post by: bkenobi on March 04, 2015, 04:17:44 AM
I haven't looked that closely at this widget, but if that isn't possible currently, that would be a massive issue IMO.  All sprinkler controllers must be able to control different zone times as the first and foremost item of importance.  I run one zone for under 10 minutes and another at over 45 minutes so I understand this imperative.
Title: Re: Garden Sprinkler System App
Post by: bkenobi on March 04, 2015, 04:43:14 AM
I just realized that I may not be able to use this after all unless it is expandable with a RPi 2.  I currently have 2 controllers with 6 and 4 zones.  If I convert to using HG, I'd obviously need at least 10 zones.  The RPi A/B only don't have enough GPIO available (ignoring the fact that HG locks up a few).
Title: Re: Garden Sprinkler System App
Post by: enterprised on March 04, 2015, 09:08:18 PM
Although all the different timing options are not hard to add, it will make the configuration of this app lengthy and confusing and it by far exceeds my need for this app.

The same functionality is very easily created with a macro/wizard script, which will give a more manageable control over all the different timing requirements. This script then needs to be started on a CRON.  Thanks to the fantastic script functionality Gene added you don't need any programming knowledge to do this.
Title: Re: Garden Sprinkler System App
Post by: dani on March 05, 2015, 06:35:59 PM
Hi bkenobi,

Even wirh RPI B you can use more than 8 GPIO in output, in you don't use Serial and I2C, you can those PINs. Only modify standard GPIO modules of HG. I have tried before.
Actually I use GPIO4, 7, 8, 9,10,11,24,27(21 Model A)  because I don't need more but they are mapped defifferently than HG.
And with B+, has more pin avalaible.
Title: Re: Garden Sprinkler System App
Post by: bkenobi on March 05, 2015, 07:43:05 PM
I'll probably upgrade to a RPi2 at some point.  I'm planning on attaching an Arduino via most likely SPI soon (either Eden or something custom).
Title: Re: Garden Sprinkler System App
Post by: lv2roc on March 15, 2015, 06:34:46 PM
How do I set it up so it will automatically start when HG starts. Right now whenever I restart HG the Garden Sprinkler System defaults to off. I would like it to default to ON.

Thanks.
Title: Re: Garden Sprinkler System App
Post by: enterprised on March 15, 2015, 07:52:26 PM
Program Update:

Added the following features on request:
 - Pause on rainfall
 - Pause on wind speed (not tested, need someone in  windy place to do this)
 - Auto Start on HG start-up

Both rainfall and wind speed require the " jkUtils-OpenWeatherData" app for input. Ensure you enable and configure this app.

Program Parameters:
01. Sprinkler Schedule A (Cron) [* * * * *]
02. Schedule A Groups (1,2,3,4,5,6 or none)
03. Sprinkler Schedule B (Cron) [* * * * *]
04. Schedule B Groups (1,2,3,4,5,6 or none)
05. Sprinkler Schedule C (Cron) [* * * * *]
06. Schedule C Groups (1,2,3,4,5,6 or none)
07. Sprinkler Pause Between Groups Time in Seconds
08. Sprinkler Active Time in Seconds (600 = 10 minutes)
09. mm of Rain in last 24 hours to Pause Sprinklers
10. Maximum Wind Speed to Pause Sprinklers
11. Auto Start (at HomeGenie start): ON or OFF

Have fun playing around with this and let me know if something does not work properly.
Title: Re: Garden Sprinkler System App
Post by: enterprised on March 20, 2015, 02:10:51 AM
Program Update:

Did a bit of bug fixing and reformatted and cleaned up the code, hope I've not introduced new bugs.

This program is now compatible with standard GPIO and with the PiFace Digital (2), this is selectable in the set-up.

Added the following features:
 - Pause on rainfall (tested)
 - Pause on wind speed (not tested, need someone in  windy place to do this)
 - Auto Start on HG start-up
 - GPIO or PiFace Digital selector

Both rainfall and wind speed require the " jkUtils-OpenWeatherData" app for input. Ensure you enable and configure this app.

Program Set-up Parameters:
01. Sprinkler Schedule A (Cron) [* * * * *]
02. Schedule A Groups (1,2,3,4,5,6 or none)
03. Sprinkler Schedule B (Cron) [* * * * *]
04. Schedule B Groups (1,2,3,4,5,6 or none)
05. Sprinkler Schedule C (Cron) [* * * * *]
06. Schedule C Groups (1,2,3,4,5,6 or none)
07. Sprinkler Pause Between Groups Time in Seconds
08. Sprinkler Active Time in Seconds (600 = 10 minutes)
09. mm of Rainfall in last 24 hours to Pause Sprinklers
10. Maximum Wind Speed (m/s) to Pause Sprinklers
11. Auto Activate (at HomeGenie start): ON or OFF
12. GPIO or PiFaceD

Have fun playing around with this and let me know if something does not work properly.

Title: Re: Garden Sprinkler System App
Post by: enterprised on March 22, 2015, 02:23:53 AM
-- Update:
-- And yes, there was a bug, all schedules reverted to schedule A, fixed now

This program is now compatible with standard GPIO and with the PiFace Digital (2), this is selectable in the set-up.

Added the following features:
 - Pause on rainfall (tested)
 - Pause on wind speed (not tested, need someone in  windy place to do this)
 - Auto Start on HG start-up
 - GPIO or PiFace Digital selector
 - NEW: Sprinkler "On" time -  configurable per group

Both rainfall and wind speed require the " jkUtils-OpenWeatherData" app for input. Ensure you enable and configure this app.

Program Set-up Parameters:
01. Sprinkler Schedule A (Cron) [* * * * *]
02. Sprinkler Active Time (00,00,00,00,00,00) - 00 to 99 minutes for each group - 00 = Off - (G1,G2,G3,G4,G5,G6) - Must use 2 digits for each group!!
03. Sprinkler Schedule B (Cron) [* * * * *]
04. Sprinkler Active Time (00,00,00,00,00,00) - 00 to 99 minutes for each group - 00 = Off - (G1,G2,G3,G4,G5,G6) - Must use 2 digits for each group!!
05. Sprinkler Schedule C (Cron) [* * * * *]
06. Sprinkler Active Time (00,00,00,00,00,00) - 00 to 99 minutes for each group - 00 = Off - (G1,G2,G3,G4,G5,G6) - Must use 2 digits for each group!!
07. Sprinkler Pause Between Groups Time in Seconds
08. mm of Rainfall in last 24 hours to Pause Sprinklers
09. Maximum Wind Speed (m/s) to Pause Sprinklers
10. Auto Activate (at HomeGenie start): ON or OFF
11. GPIO or PiFaceD

Have fun playing around with this and let me know if something does not work properly.
Title: Re: Garden Sprinkler System App
Post by: lv2roc on April 02, 2015, 12:51:59 AM
The wind function seems to work well. I need to keep an eye on it a little longer to make sure it is functioning as it should.

One more note for future update...

You already have the status of the groups displayed on the widget, eg. Sprinkler group 1 Active, switching to next group, etc.

Could you add something like " Skipped due to weather" when the parameters come into effect and by pass the schedule. Keeping it displayed for the duration of the schedule.

Unless I missed something, when it skips due to rain or wind the widget display "Waiting on schedule"

Would be nice to know that it is on schedule but skipped because of weather.

Thanks,
Title: Re: Garden Sprinkler System App
Post by: lv2roc on April 04, 2015, 05:11:43 PM
I have 2 issues or bugs or whatever, not complaining just trying to figure them out.

Issue #1 - On the lasted release I do not have in the options-
02. Sprinkler Active Time (00,00,00,00,00,00) - 00 to 99 minutes for each group - 00 = Off -    (G1,G2,G3,G4,G5,G6) - Must use 2 digits for each group!!

Was this an upload oversight?

Issue #2 - Did not notice this on previous releases but when the schedule time for Schedule A is done and there is nothing for Schedule B or C. The widget will display "Switching to next group"

For testing purposes, I am only using 4 valves so in the groups I am only using 1,2,3,4 in Schedule A group and "none" in Schedule Groups B and C.

Great job on this app, enterprised!
Title: Re: Garden Sprinkler System App
Post by: enterprised on April 05, 2015, 02:37:35 AM
Thanks for the feedback.

Issue 1:
Could have done a better job explaining in the app config like:
02. Sprinkler Active Time (00,00,00,00,00,00) ; 00 to 99 minutes for each group ; 00 = Off ; Must use 2 digits for each group!! ; (00,00,00,00,00,00 denotes sprinkler time in minutes for group1,group2,group3,group4,group5,group6)

Issue 2:
Will fix this on next update.
Was hoping to get some help creating a widget, see post http://www.homegenie.it/forum/index.php?topic=823.0 (http://www.homegenie.it/forum/index.php?topic=823.0), as advanced display and controls for the sprinkler app. So far not much luck on this.
Title: Re: Garden Sprinkler System App
Post by: lv2roc on April 07, 2015, 12:51:40 AM
Ok, I think I understand your directions now.

If I am only using 4 of the 6 valves (groups) as I only have 4 valves, with a duration time of 10 minutes each. I would enter 10,10,10,10,00,00

This would indicate I am only using 4 valves and not the 6.

So in schedule A, If am only using valves 3 and 4 for 20 minutes and 25 minutes respectively, it would look like this... 00,00,30,40,00,00. Valves 1 and 2 off, Valve 3 on for 20 min, Valve 4 on for 25, Valves 5 and 6 off as I do not have them.

Is that correct?
Title: Re: Garden Sprinkler System App
Post by: enterprised on April 07, 2015, 02:16:30 AM
"If I am only using 4 of the 6 valves (groups) as I only have 4 valves, with a duration time of 10 minutes each. I would enter 10,10,10,10,00,00"
This is correct.

"So in schedule A, If am only using valves 3 and 4 for 20 minutes and 25 minutes respectively, it would look like this..."
00,00,20,25,00,00

00 is used for both off and not existing
Title: Re: Garden Sprinkler System App
Post by: lv2roc on April 09, 2015, 12:42:41 AM
That should help others seeking an explanation on how to set different duration times.

Looking forward to another update too!
Title: Re: Garden Sprinkler System App
Post by: lv2roc on April 10, 2015, 11:56:27 PM
I am still having troubles with your latest release. Like I mentioned a couple of posts ago, I was wondering if you have the link to the wrong release??
Here is a snippet of what I am seeing on my end for duration of groups. I thought this (08. Sprinkler Active Time in Seconds (600 = 10 minutes)) was removed so each valve could have it's own duration time.

I do not see this on your latest updated post on March 22.
02. Sprinkler Active Time (00,00,00,00,00,00)

Thanks,

Lv2roc


Title: Re: Garden Sprinkler System App
Post by: enterprised on April 11, 2015, 02:10:54 AM
I'm currently in Dubai, 8000 miles away from home. I can't look into this until I get home again in 2 weeks.

have you tried removing the app and associated data from the HG database. I had to do this with one of the earlier versions due to HG getting confused with the program setup parameters.
Title: Re: Garden Sprinkler System App
Post by: lv2roc on April 11, 2015, 05:36:14 AM
I tried removing the app and associated data from the HG database and still same result. As a last effort I reformatted my RPi, updated HG and fresh install of Garden Sprinkler System, again still not up to date. I could be totally wrong but I think the file for the link is wrong.
I see you are away for a couple of weeks, no big deal. We can look at it when you are settled back at home.

Maybe if others have the updated app working they can chime in.

Thanks again.
Title: Re: Garden Sprinkler System App
Post by: enterprised on April 11, 2015, 06:35:11 AM
Try the attached file.
I pulled this of my development RPi, should be the latest version.

It still amazes me what you can do with HG, like in this case pulling an app remotely far far away from home.
Title: Re: Garden Sprinkler System App
Post by: lv2roc on April 12, 2015, 12:00:25 AM
Nope that did not help either. Maybe it is me?? Maybe I am reading your post incorrectly.

Should I be seeing 08. Sprinkler Active Time in Seconds (600 = 10 minutes) on your latest update?

I thought this was removed so one could enter active times for each group. Which would be 02. Sprinkler Active Time (00,00,00,00,00,00).

The one I just downloaded that you pulled today shows 02. Schedule A Groups (1,2,3,4,5,6 or none).

I figure 02. Schedule A Groups (1,2,3,4,5,6 or none) would be replaced with 02. Sprinkler Active Time (00,00,00,00,00,00).

Below are the options I have after rebuilding and downloading RPi with HG.

01. Sprinkler Schedule A (Cron) [* * * * *]
02. Schedule A Groups (1,2,3,4,5,6 or none)
03. Sprinkler Schedule B (Cron) [* * * * *]
04. Schedule B Groups (1,2,3,4,5,6 or none)
05. Sprinkler Schedule C (Cron) [* * * * *]
06. Schedule C Groups (1,2,3,4,5,6 or none)
07. Sprinkler Pause Between Groups Time in Seconds
08. Sprinkler Active Time in Seconds (600 = 10 minutes)
09. mm of Rainfall in last 24 hours to Pause Sprinklers
10. Maximum Wind Speed (m/s) to Pause Sprinklers
11. Auto Start (at HomeGenie start): ON or OFF
12. GPIO or PiFaceD

I understand if you are busy with other things right now, you have done more than I expected be miles from home. I can wait until you are ready to dive into this with me.

Lv2roc

Title: Re: Garden Sprinkler System App
Post by: enterprised on April 12, 2015, 02:01:59 AM
Looks like I pulled and uploaded the wrong file. :-[
Will try again in the next couple of days when I have a bit of time again.

Well since I'm jet lagged and don't have anything better to do a 4AM in the morning I decided to re-write the file I have on my laptop as much as possible to match the version I'm running at home.

See attachment.
Not tested on RPi, but should work. Please give this a try and let me know if it works.
If it works I can modify this file for the new widget design.

//CRON:
// * * * * * ( 1 2 3 4 5 ) command to execute
//1 =  min (0 to 59)
//2 = hour (0 to 23)
//3 = day of month (1 to 31)  (1-31/2 = odd days, 2-30/2 = even days)
//4 = month (1 to 12)
//5 =  day of week (0 to 6) (0 to 6 are Sunday to Saturday
//
//Both rainfall and wind speed require the " jkUtils-OpenWeatherData" app for input. Ensure you enable and configure this app.
//
//Program Set-up Parameters:
//01. Sprinkler Schedule A (Cron) [* * * * *]
//02. Sprinkler Active Time (00,00,00,00,00,00)
//03. Sprinkler Schedule B (Cron) [* * * * *]
//04. Sprinkler Active Time (00,00,00,00,00,00)
//05. Sprinkler Schedule C (Cron) [* * * * *]
//06. Sprinkler Active Time (00,00,00,00,00,00)
//07. Sprinkler Pause Between Groups Time in Seconds
//08. mm of Rainfall in last 24 hours to Pause Sprinklers
//09. Maximum Wind Speed (m/s) to Pause Sprinklers
//10. Auto Activate (at HomeGenie start): ON or OFF
//11. GPIO or PiFaceD
//
//
//"If I am only using 4 of the 6 valves (groups) as I only have 4 valves, with a duration time of 10 minutes each. I would enter this..."
//answer: 10,10,10,10,00,00
//
//"So in schedule A, If am only using valves 3 and 4 for 20 minutes and 25 minutes respectively, it would look like this..."
//answer: 00,00,20,25,00,00
Title: Re: Garden Sprinkler System App
Post by: lv2roc on April 12, 2015, 05:27:19 AM
Wow...I did not expect to see you working on this today/tonight/tomorrow morning. Time zones' eh!

Ok, I am almost there. However, when I loaded onto HG everything went wonky. Good technical term to describe the snafu.

I will re-image, reload, and restart HG from scratch again. Will let you know how it works soon.

Lv2roc

Just a note, this seems to be a good thread as there are 2000+ reads. People must appreciate your work!
Title: Re: Garden Sprinkler System App
Post by: lv2roc on April 12, 2015, 07:20:24 PM
I have it working now.

Just a couple of notes for others reading this thread.

After putting on the lasted Raspian-wheezy release I tried installing the newest realease of HG (r484). That seem to create a whole lot of issues with the GPIO for RPi B+,  jkUtils - OpenWeatherData and this Sprinkler package.
I am only using HG for the Sprinkler app so other issues could be going on but I experienced issues with those as they are used by the Sprinkler app. Issues were with binding, OpenWeatherData was throwing error about blank data, and also when it did work it gave data from Berlin and not my location. (even after changing location).

What I ended up doing is putting on the lasted Raspian-wheezy release, install HG r478, configure jkUtils - OpenWeatherData. imported the GPIO Module for B+ , added Sprinkler App webpages, added Sprinkler App.
once that was done, I restarted HG.

Did a couple of test runs, all seemed to work fine then I let HG update itself to r484.

I know this is a long winded reply but someone might get some use of it, or maybe correct me on things. I am new to HG and learning as I go so any feedback is welcome.

Anyways, 2 thumbs up Enterprise! Looking forward to updates previously suggested.