www.homeseer.com    
 

Go Back   HomeSeer Message Board > Irrigation Plug-ins > Irrigation Discussion

Irrigation Discussion Discussion of irrigation integration with HomeSeer systems.

Reply
 
Thread Tools Display Modes
  #1  
Old August 3rd, 2014, 05:19 AM
Mattyjee's Avatar
Mattyjee Mattyjee is offline
Seer Deluxe
 
Join Date: Apr 2014
Location: Perth, Australia
Posts: 207
New OpenSprinkler Plugin

Hi All,

This thread is about a plugin for the OpenSprinkler Controller.
https://opensprinkler.com/

This started off as a learn vb.net project for myself. I finished it off and published the first version here. I also published the source files and Brady (jbbtex) kindly added a ton of functionality and republished the source. The version attached in this post (OpenSprinkler-1.0.4.0) will work for Firmware 2.04 - Newer versions (OpenSprinkler 1.1.0.0 +) supporting Firmware 2.10+ are available in the updater.

Basic Functionality:

Install and run the plugin and go to the config page. Set the IP address, port, password, of your OpenSprinkler controller set a poll rate. Homeseer will then poll the Controller and detect the number of zones and programs. It will create a root device for the controller, a device for each station (sprinkler zone), a device for each registered program, a rain delay device, a status device, a history device, a rain sensor device (if enabled) and an overall watering percentage device.

Homeseer will then poll the device continuously for status. If the wrong (or no) answer is recieved, all devices will show Comms Fail. Each device will display it's current status.

The controller (root device) can be enabled, disabled or rebooted - all with status feedback.
Each station can be turned on for a set period of time (at your choosing) or turned off.
Programs will display status and will allow you to enable, disable or run-once (with current station times).
A Rain delay can be set/reset which will stop the stations activating for a set period of time.
A watering percentage device can be used to set an overall time adjust factor, this can also be set to auto-weather control or manual control.
A status device tells which station is currently running - and also displays OpenSprinkler's feedback for each command sent by Homeseer. This has a 'stop all' button'.
A history device displays the last station to run.
A rain sensor device (only built if rain sensor enabled) will show the status of this device.
The config page will also show a log of all activity over the last month.

Source code can be shared by request - send me a message.

Version History:
0.1.1.0 - original version by mattyjee
0.1.2.0 - added (not successfully) expansion boards
1.0.0.6 - Ton of functionality added by jbbtex.
1.0.0.7 - bug fixes by jbbtex
1.0.0.8 - bug fixes by jbbtex
1.0.1.0 - bug fixes and rewrite for ease of future updates by mattyjee
1.0.2.0 - added watering ratio device
1.0.3.0 - can now adjust zone watering time of each program.
1.0.4.0 - bugs fixed in previous version which would reset other settings when water% set. Enhanced the general debugging capabilities.
1.1.0.0 - Provides support for new OpenSprinkler Firmware v210 including extra functionality, also converted plugin to be available through the updater and now no need to manually edit ini file.
1.2.0.2 - Provides support for new OpenSprinkler Firmware v213 (MD5 password). Adds buttons for Program devices. Also now Linux compatible.
1.2.1.0 - Fixes bugs with program device buttons not rendering on webpage. Fixes compatibility issue with new Firmware v214.
Attached Images
  
Attached Files
File Type: zip OpenSprinkler 1.0.4.0.zip (78.5 KB, 97 views)

Last edited by Mattyjee; May 9th, 2015 at 10:12 PM. Reason: Updated.
Reply With Quote
  #2  
Old August 6th, 2014, 09:10 PM
jbbtex's Avatar
jbbtex jbbtex is offline
Seer Deluxe
 
Join Date: Dec 2010
Location: Texas
Posts: 450
I'd be interested to try this out, but I have 23 irrigation zones.

I really like the ability to set the zone manual watering time from the Device page.
__________________
Brady
Reply With Quote
  #3  
Old August 6th, 2014, 09:31 PM
Mattyjee's Avatar
Mattyjee Mattyjee is offline
Seer Deluxe
 
Join Date: Apr 2014
Location: Perth, Australia
Posts: 207
I'm not sure if I'm smart enough to have it work with expansion zones just yet - I also don't have a way to test it... I'll have a quick look later and see if it's simple or not.

Cheers.
Reply With Quote
  #4  
Old August 6th, 2014, 09:35 PM
jbbtex's Avatar
jbbtex jbbtex is offline
Seer Deluxe
 
Join Date: Dec 2010
Location: Texas
Posts: 450
I just got my hardware today and hope to have it installed by the weekend. I'd be happy to test things for you.

I'm not much of a coder, but I have written quite a few vb .net scripts that I use with my setup.
Reply With Quote
  #5  
Old August 7th, 2014, 09:04 AM
Mattyjee's Avatar
Mattyjee Mattyjee is offline
Seer Deluxe
 
Join Date: Apr 2014
Location: Perth, Australia
Posts: 207
Hi Brady,

I'm unable to test this version, but you should now be able to add expansion zones. Just edit the number of expansion zones into the .ini file and it should create the correct number of devices and work for them all. As I said, I can't test this so if it's no good let me know and just try my original post instead.

Cheers.

Last edited by Mattyjee; October 26th, 2014 at 06:25 AM.
Reply With Quote
  #6  
Old August 14th, 2014, 10:37 PM
jbbtex's Avatar
jbbtex jbbtex is offline
Seer Deluxe
 
Join Date: Dec 2010
Location: Texas
Posts: 450
Quote:
Originally Posted by Mattyjee View Post
Hi Brady,

I'm unable to test this version, but you should now be able to add expansion zones. Just edit the number of expansion zones into the .ini file and it should create the correct number of devices and work for them all. As I said, I can't test this so if it's no good let me know and just try my original post instead.

Cheers.
I tried this but couldn't get it to work.

After looking at the docs on OpenSprinkler, I decided to do what I needed with scripts.

Thanks
Reply With Quote
  #7  
Old August 16th, 2014, 06:34 AM
Mattyjee's Avatar
Mattyjee Mattyjee is offline
Seer Deluxe
 
Join Date: Apr 2014
Location: Perth, Australia
Posts: 207
It is pretty easy to do with scripts, however what part specifically didn't work so I can have a look at my code? Did you edit your IP address in the .ini file?
Reply With Quote
  #8  
Old August 16th, 2014, 10:21 AM
jbbtex's Avatar
jbbtex jbbtex is offline
Seer Deluxe
 
Join Date: Dec 2010
Location: Texas
Posts: 450
Quote:
Originally Posted by Mattyjee View Post
It is pretty easy to do with scripts, however what part specifically didn't work so I can have a look at my code? Did you edit your IP address in the .ini file?
Log:

Code:
Aug-16 9:31:31 AM           Info     Plugin OpenSprinkler has connected. IP:127.0.0.1:2012
Aug-16 9:31:30 AM           Warning     I/O interface OpenSprinkler is down, executable is not running, restarting ...
Aug-16 9:31:00 AM           Info     Plugin OpenSprinkler with instance: has disconnected
Aug-16 9:30:31 AM           Info     Plugin OpenSprinkler has connected. IP:127.0.0.1:1984
Aug-16 9:30:31 AM           Warning     I/O interface OpenSprinkler is down, executable is not running, restarting ...
The only device created is "OS-0."

This is my .ini:
[Settings]
IPaddress=192.168.0.81
IPPort=80
Password=password
Expansions=2
Reply With Quote
  #9  
Old August 17th, 2014, 07:32 AM
Mattyjee's Avatar
Mattyjee Mattyjee is offline
Seer Deluxe
 
Join Date: Apr 2014
Location: Perth, Australia
Posts: 207
That's strange - I can't replicate the fault after trying a number of different permeations. It's a weird part of the code to fail on. Unfortunately I'm only a very ameteur programmer so can't offer too much help.

There's only one scenario I can think of that caused this. Did you start the plugin once before copying the .ini file across? If so that would do it.

If you did get an error and then tried again, it will not attempt to recreate any devices unless you delete ALL OpenSprinkler devices (including OS-0) and then restart the plugin.

No pressure to test this since you've set up your scripts.
Cheers.
Matt.
Reply With Quote
  #10  
Old August 20th, 2014, 06:13 AM
Mattyjee's Avatar
Mattyjee Mattyjee is offline
Seer Deluxe
 
Join Date: Apr 2014
Location: Perth, Australia
Posts: 207
Here is the source code if anyone is interested...

If anyone uses this or makes changes - please post back to me.
Cheers.
Matt.

Edit - source code attachment removed - it was old and crappy anyway. Email me if you want the latest copy.

Last edited by Mattyjee; October 26th, 2014 at 06:26 AM.
Reply With Quote
  #11  
Old August 24th, 2014, 10:33 AM
jbbtex's Avatar
jbbtex jbbtex is offline
Seer Deluxe
 
Join Date: Dec 2010
Location: Texas
Posts: 450
Thanks for the source Matt. I made a couple of tweaks and have it working with my 24 zone system.

I'm away on vacation now but will explain what I changed when I'm back home later this week.

My plan is to incorporate the scripts I've been using. This will require creating a few more devices.

And I hope to be able to read the zone names from Open Sprinkler and use them for the device names in HS. We'll see.

Since I've never done a plug in before, I may be asking for some help.

Thanks again.


Brady
Reply With Quote
  #12  
Old August 24th, 2014, 11:02 PM
Mattyjee's Avatar
Mattyjee Mattyjee is offline
Seer Deluxe
 
Join Date: Apr 2014
Location: Perth, Australia
Posts: 207
Cool. looking forward to it.

Cheers.
Matt.
Reply With Quote
  #13  
Old August 30th, 2014, 02:28 PM
jbbtex's Avatar
jbbtex jbbtex is offline
Seer Deluxe
 
Join Date: Dec 2010
Location: Texas
Posts: 450
Here is what I have so far. Just the source files.

The .ini file should have the following entries:
[Settings]
IPaddress= OS ip address
IPPort=OS ip port
Password= password
Expansions= number of expansion boards
(note: current OS expansion unit = 2 boards
Poll= plugins polling interval in seconds

I have tested this on an OpenSprinkler system with 24 stations and 4 programs running in Sequential mode.

The first time the plugin runs, it will create devices for all the zones and programs. The Zones will be named based on the Station Names from OpenSprinkler. The Programs will be named "Program 1", etc.

On each poll, the plugin will set the Program devices' strings to indicate the next day the program will run. It will also check to see if any Zones are running. If a zone is running, then the Zone's device string will show what Program (or Manual, Run-once) is controlling the Zone and how much time is remaining before the Zone stops. If a Program is in progress, then all the zones will show the Program name and run time, but only the currently running zone will count down the time and indicate that it is active.

Planned additions:
  • A device that shows if the Rain Delay is Active and for how long.
  • A device that shows what zone last ran and the time it stopped.
  • Changing the behavior of the Zone device drop down to create a run-once program just for that zone, rather than manually run a zone. This will eliminate the need for the user to change back to Program Mode.

Since I'm an amateur at coding, I'm sure the code is pretty clunky. And there are probably better ways to do the things I did. Constructive criticism is appreciated.

Last edited by jbbtex; September 2nd, 2014 at 05:13 PM.
Reply With Quote
  #14  
Old September 2nd, 2014, 05:35 PM
jbbtex's Avatar
jbbtex jbbtex is offline
Seer Deluxe
 
Join Date: Dec 2010
Location: Texas
Posts: 450
Here is the latest version.

-Added device that shows Rain Delay Status and time and date it is scheduled to end.

-Added device that if a zone is running, what zone it is and count down to finish

-Added device that shows the last zone that ran and when it stopped.

-Added the following controls to the Status Controller device: 'Stop All Zones', 'Enable OpenSprinkler', 'Disable OpenSprinkler'

HSPI_MG-BWOpenSprinkler.zip is the source project
BWOpenSprinkler.zip has the .exe, config file and a text file with installation instructions.

Suggestions welcomed, although my skill, or lack there of, may prevent implementation.

Last edited by jbbtex; October 26th, 2014 at 10:38 AM. Reason: removed attachments
Reply With Quote
  #15  
Old September 3rd, 2014, 01:40 AM
Mattyjee's Avatar
Mattyjee Mattyjee is offline
Seer Deluxe
 
Join Date: Apr 2014
Location: Perth, Australia
Posts: 207
Nice work, you've gone to town on that. I'm on holidays at the moment so can't load it (just had a browse of the .vb files) but looks like you got a lot further than i did. You're hardly an amateur coder.

I was always wondering if there was a way to pull status and other advanced things off the web pages and it looks like you worked out how to do it. I'll have a good look through when I get back home.

Another handy thing with OpenSprinkler is that within HSTouch you can create a text box, set the IsHTML to true and enter the IP address. This then gives you a direct portal to the web interface from within HSTouch.

The other thing i wanted to add to the plugin (although since it does what i need it to do I'm not in a hurry) was to build a webpage where you can enter the config settings instead of having to manually edit the ini file. I've only built one other plugin and that one is specific to my setup so I've hard coded those types of settings. I'm not good with html - only just learning vb.

Too many things to learn, not enough spare time...

Cheers.
Reply With Quote
  #16  
Old September 3rd, 2014, 04:04 AM
TomTom's Avatar
TomTom TomTom is offline
Seer Master
 
Join Date: Apr 2012
Location: USA
Posts: 1,402
Nice work! Thanks
__________________
Tom
baby steps...starting again with HS3
HS3Pro: Z-NET & 80 Z wave Devices,
HSTouch: 4 Joggler (Android Kitkat), 2 iPhone, 3 iPads
Whole House Audio: 5 SqueezePlay Jogglers w Bose Speakers
In The Works: 10 Cameras Geovision, new Adecmo/Envisalink Alarm, Arduinos
System: XP on Fanless Mini-ITX w/ SSD
Reply With Quote
  #17  
Old September 4th, 2014, 07:59 PM
jbbtex's Avatar
jbbtex jbbtex is offline
Seer Deluxe
 
Join Date: Dec 2010
Location: Texas
Posts: 450
Here's the latest.

1.0.08
-Fixed bug where device strings were written to the wrong device

----------------
1.0.0.7
No functional changes, just cleaned up config webpage.
----------------
Change the Stations device "Run for X minutes". It now creates a Run-once program for that Zone. This eliminates having to change to manual mode.

I have a crude config page that will set the parameters in the .ini file. It's not pretty, but it works. NOTE: You will have to disable and re-enable the plugin for the changes to take effect.

Last edited by jbbtex; October 26th, 2014 at 10:39 AM. Reason: removed attachments
Reply With Quote
  #18  
Old September 27th, 2014, 12:28 AM
frankc's Avatar
frankc frankc is offline
Seer Deluxe
 
Join Date: Jan 2009
Location: Kansas, USA
Posts: 301
evapotranspiration ??

Your plugin looks nice Mattyjee.

I've been reading about evapotranspiration, aka ET, today. I had been considering using a moisture detector with my controller. But per comments on this board, it is pretty obvious that ET would be better. I use Stevea's 'Snevl Sprinkler' script with HS2 and a 'Webcontrol' board. It works well, but no ET yet.

If you want to further 'improve your VB.net skills' Mattyjee, this might be a challenge to take on. There are a few compiled ET calculators and Excel spreadsheet 'calculators' on the Internet. But none of them lend themselves to integration with HS.

However, one document I found worth noting can be found at: http://edis.ifas.ufl.edu/pdffiles/AE/AE45900.pdf , which explains step by step how to calculate the ET. I figure software like WeatherXML will provide access to all of the weather related variables required. The more I read about evapotranspiration, the more interesting it becomes and the more feasible a DIY version seems. 'mcsSprinklers' may be the only plug-in already making use of ET.

Just food for thought...

take care!

Frank
__________________
HS3, CM15A, Win10, Sprinklers w /ET, Concord Security , CallerID, tenScripting3, TextSeer, tenHsServer, tenScriptAid, Jon00ImageBuilder, Jon00LogMonitor
Reply With Quote
  #19  
Old September 28th, 2014, 05:42 AM
Mattyjee's Avatar
Mattyjee Mattyjee is offline
Seer Deluxe
 
Join Date: Apr 2014
Location: Perth, Australia
Posts: 207
Brady - I've loaded a new version based on your latest but with a bit of a re-write. I'm not sure if you're interested in trying it out or sticking with what you've got but if you do try it you should be able to test it in parallel to your existing program with no interference between the two - the files are renamed and it will create a new set of devices. This definitely works for me but I'd need you to tell me if there any issues with expansion boards. I did manage to find an error with expansions that wouldn't have worked in my old original version.

My main changes are:
1) Renamed the address fields of devices and changed code to refer to devices by address not by name. Otherwise if a user renames a device it will stop working.

2) Changed your new devices to be children of the root device - helps group things nicely.

3) From now on, devices are rebuilt every time the code is started. Means you can make changes and add devices without having to delete all and you can add/remove program devices on the go (with a restart of plugin). Unfortunately this will only work from this version onwards. If you run this version it will create all new devices and communicate with them only.

4) Tidied up a few bits of code and moved functions from Root device to other devices.

5) Took "MG" or "BW" references out of all code.

Your enhancements are awesome. I have no idea how you managed to work that stuff out - I even struggled to reverse engineer your code to see how it works.

Frank - I'm not that advanced yet. I'm happy just having my rain delay set by external events. I don't think my grass is that advanced - it just likes getting wet.
Reply With Quote
  #20  
Old September 28th, 2014, 07:38 AM
frankc's Avatar
frankc frankc is offline
Seer Deluxe
 
Join Date: Jan 2009
Location: Kansas, USA
Posts: 301
Quote:
Originally Posted by Mattyjee View Post
Frank - I'm not that advanced yet. I'm happy just having my rain delay set by external events. I don't think my grass is that advanced - it just likes getting wet.
Strange! My grass seems to be the same way. I look forward to watching your software progress.

One consideration for future inclusion of the ET factor would be to write the software such that the zone on times could be adjustable by a percentage derived from ET. Perhaps OpenSprinkler is a problem in that regard if the on times are not remotely adjustable.

Frank

Last edited by frankc; September 28th, 2014 at 08:29 AM.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenSprinkler open source sprinkler controller reidfo Irrigation Discussion 21 August 27th, 2013 11:16 PM
OpenSprinkler control plugin available for download reidfo BeakerRain 0 July 19th, 2012 11:21 AM
Does this plugin work with the Windows Media Center plugin? rdimitri SqueezeBox Plug-In (3P) 0 May 16th, 2011 05:05 PM
Upgrade procedure for ACRF plugin from W800 free plugin htsource ACRF Processor (3P) 14 January 26th, 2006 11:21 AM


All times are GMT -4. The time now is 02:44 AM.


Copyright HomeSeer Technologies, LLC