Autonomous Android Sprinkler / Pump controler

3/v1.0.5 is now up.

Some changes:
1. Fixed bug where certain characters in name fields were not handled correctly. We should be UTF-8 compatible now.
2. Fixed bug where editing on some enabled times was not allowed.
3. Added ability to quickschedule disabled schedules (they show up with the moniker « (disabled) », but they can be run)

 

2/I’ve got a new version that I’m going to upload tomorrow for beta testing. It has the following additional features:

  1. Support for Personal Weather Stations from Weather Underground
  2. Support for up to 15 zones.
  3. Ability to check on the data pulled from Weather Underground with a diagnostics screen
  4. Seasonal adjustment (0-100% of the set time)
  5. Home screen shows the configured time on the raspberrypi so as to avoid time zone confusions.
  6. Various bug fixes.

1/Here are the features:
Fully contained system with control logic and web serving.

Web based control (including mobile Android / iOS)

Automatic adjustment of intervals and duration based on weather conditions.

(weather underground API)
Weather conditions can be pulled from individual personal weather stations or from general weather data based on zipcode.

Manual Control
Named Scheduled Control
Quick Schedule
Named Zones Control
Full Graphing feature of historic logs

Ability to run with OpenSprinkler module / Arduino based module with  direct relay outputs.
Supports master valve/pump output

Very simple installation

  • One shot Gps based configuration for weather

Seasonal adjustment.

  • Usefull for automatique swimming pool pump scheduling

Working on a few other things…

Here are a few screen shots from the software:
Image Image Image Image Image Image Image Image Image Image Image Image Image

If something goes wrong on startup you can get some diagnostic information at /var/log/sprinklers_pi.

Once you’ve started things up, browse to port 8080 with a web browser. The system starts up in demo mode (i.e. it won’t actually switch outputs). To change the output type go to the Settings and change the Output type to « OpenSprinkler » (assuming you’re using the OpenSprinklerPi module).

For those who are particularly adventurous, the sprinkling logs are stored in sqlite3 database format, so if you really care, you can query them with SQL using the database at /usr/local/etc/sprinklers_pi/db.sql

FAQ

Looks great – does it support a master valve?
Yes. Master valve / pump. You can selectively define which zones require the master valve and which ones do not.

How does your system utilize the wunderground data (e.g., what is it pulling down and in what way does it alter the watering schedule)?
Average Humidity, Average Temperature and rainfall. If it’s a hot dry day, it adds in some time. If it’s a cool, humid day, or it rains, it subtracts some time.
To make it work you need to get a free API key from Weather Underground at api.wunderground.com/weather/api/
on the scheduling, when i set the individual zones time length, do they run 1 after the other? or do they all run together? i set all the zones for 1 minute(using it with a pump and drippers in a greenhouse) and 4 different run times during the day.if all 4 zones i have turn on together there will be not enough pressure.is there a way to run them sequentially without running 4 schedudles?
they should not run at the same time. They should run sequentially.
What does the « Interval » setting do on the Schedule page? What do the numbers on the slider refer to? Sorry if I’m just missing an obvious answer but I’m new to the opensprinkler thing and it looks like your software was the best out there for it so I’m just getting started with it!

Interval means how many days between waterings. So 1 would water every day, 2 would water every other day, 3 every 3rd day, etc.

Feedback: How do I know when the next watering event will be? I know when a zone is running the home page shows a sprinkler graphic with the zone name and time remaining. When nothing is currently running I’d like to see the next scheduled event on the home page. Something like:

« Normal watering » schedule will run tomorrow at 4:15 AM
or
Zone 1 « Front yard » is scheduled to run today at 10:00 PM

It’s something I’ve been pondering. There’s actually a « secret » screen that you can browse to at /ShowEvent which will show you the event queue. That’ll give you an idea as to what’s coming up for the day, but it ends at midnight. (plus it’s very hard to understand unless you’re intimately familiar with the event structure)

This is something that’s high on the to-do list.

I’m not clear on how the Seasonal Adjust in the Settings interacts with the weather based adjustments.

I see in the code you posted on the wiki that weather adjustments start with 100% then add or subtract the 3 weather factors to come up with a percentage between 0 and 200. So if Weather Adjust is enabled for a schedule does it take precedence over the Seasonal Adjust from the Settings page, or are the two used together some how?

Just a thought, should the two adjustments be combined? For example, if Seasonal Adjust is set to 70% then the weather adjustment could take 70 and add or subtract the weather factors to come up with a final aggregate adjustment.

BTW, the github wiki says the humidity adjustment is 1/2% but the formula does 1%. I updated the wiki to say 1% (and expanded the explanation of each of the 3 factors). If you want 1/2%, which seems more appropriate, the code should divide by 4 instead of 2.

The two adjustments are both applied. So if one is set at 50% and the other comes up to 200%, the overall adjustment is simply 100% (or no change)
I checked the EventStatus and it shows:

2 Events
00:03:21 2013/9/18 (4)
Event [00] Time:04:00(240) Command 3 data 0,0
Event [01] Time:05:00(300) Command 3 data 0,1

My schedule runs twice. What does the number in parenthesis mean? If it’s run time, is the weather adjustment applied to both times/runs?

The number in parenthesis is the structure representation of time (i.e. 240 minutes from midnight…..which is the same as the 4:00 that preceeds it….remember, this is a « secret » screen that I use during debug.) Command 3 means « run a schedule ». data 0,0 means run schedule 0, time 0. data 0,1 means run schedule 0, time 1.

If you watch closely, at 4AM you’ll see a bunch of additional events created. Command 1 means « turn on a valve » (data position 0 tells you which one). Command 2 means « turn off all valves ». The duration weather adjustment isn’t made until directly before the schedule is run (in case there has been some additional rainfall…).

It would be possible to run the zones in concurrent mode?. When I was testing it I noticed that only one valve can be on at once.
What would be the purpose of simultaneous zones? I suppose it wouldn’t be hard to enable, but I’m having trouble understanding the use case and I’m worried that adding it might cause confusion. I’ve never seen an irrigation timer with simultaneous zones.
How do you add garage opener any recommended software that will work with this one?
For your relay board, go to Settings and for Output select either Direct Positive (relays are activated by Raspberry Pi output going high) or Direct Negative (my board needed this).

I haven’t heard of anyone adding garage door support yet. The source code is available, hack away.

Somewhat related, how does sprinkler_pi handle weather adjustments when watering say every other day? Does it simply use the current day’s weather info? It would be nice if it could look back every day since the last watering and use the average of those days.

Currently it just looks at todays conditions and the rainfall from today and yesterday.

Zodiac69 wrote:Is it possible to include the current wind speed and « inhibit » the schedules if the wind speed is above value « X »?

I’m still trying to figure out what part of the country you are in. If the part with golf ball sized hail stones, I wonder how many personal weather stations survived yesterdays storm up in Gauteng?

Back to your topic, I’ve been thinking on the same lines as while most early mornings in Durbanville have almost no wind, we do have the odd day where the wind blows enough that I don’t want the sprinklers on, as the wind blows the water against the house, and due to the high Iron content, stains the walls.

I’ve got as far as mangling the code on my Pi to pull the metric values from WUnderground, and have added the current wind speed, but I can’t get the wind reading to display. Inhibiting the schedule is probably the best choice, as the wind only gets stronger during the day.

I’ve been looking at the way you adjust the schedule using WUnderground and have this question. How does the program adjust for today’s rainfall given that the API calls refer only to yesterday’s conditions?

Yes, it looks at today’s rainfall as well. If you look at the WUnderground Check screen (under the Advanced menu), you should see « Precip Today ».

At the moment I have a float switch in my tank to cut out the pump and restart when tank is full, also a pressure switch on the pump outlet, would this software be able to include these is some way?? I wish to add more zones and I have a pi so this could be a project that I would like to incorporate into my system

Munga, This seems like it would be pretty special purpose and wouldn’t be a feature that a lot of people would use. Keep in mind that you have the full source for the system, so you can do what you want with it. I would probably define a new class with your code in it, make use of the wiringpi libraries to get the state of inputs, and tie into the main control loop in the core.cpp file.

Awesome software! I just replaced the « dumb » box (a Hunter X-Core, 8-zone) with sprinklers_pi, and it feels liberating!

A couple of questions:

      1. How do you cancel a Quick Schedule? Rest System on the Advanced page?

:lol:

    2. How about showing how long a manual zone has been running on the main page? Right now it just says –:–
    3. How about taking « tomorrow’s » weather into account as well? I’d hate for it to run a full soak on my lawn when there’s 80% of a Thunderstorm the next day. (I live in Houston Texas, itpours here!)

Again, thank you for your efforts!

1. An easy way would be to cycle the Run Schedules button on the main page.
2. That’s a good idea. On the TODO list.
3. So many people have such wonderful ideas for how to handle the weather. It seems that I should probably make the weather system more easily pluggable module so that people can do what they want. Also on the TODO list.

the web server is built into the application logic. It’s a very simple web server capable of serving up simple static html web pages, along with dynamic json files for retrieving and storing settings. It will not execute php scripts.