OpenSprinkler PlugIn

[quote=“AgileHumor, post:40, topic:176206”]I’m 100% PLEG now. Over 400+ conditions :slight_smile:

I have a few scenes for some simple stuff and to expose interface to run PLEG actions.[/quote]

Using the rainsensor plug-in with it? If i remember correctly, you live in the NW as well. Seems like a great solution!

[quote=“blockerm, post:23, topic:176206”]Chris,

I am also having trouble using the plug-in with the OpenSprinkler PI version. The stations are populating but I am getting the following message when trying to set to manual:

OpenSprinkler Interface : Unable to control irrigation controller. General failure

Appreciate your help[/quote]

[quote=“whitema, post:25, topic:176206”]I’m not able to set the OSPi to Manual or Auto. I’m getting this error

Got UNEXPECTED Status Code : 303 <0x2aed5000>

What’s odd is that if I go to the opensprinkler interface and put it in Manual mode it actually lets you turn the sprinklers on and off via Vera (even though it still kicks out this error).

Any ideas?[/quote]

These are both the same problem. The current plugin code expects to receive a 200 response code when the sprinkler mode is changed. However, the open sprinkler interface returns a 303 response code. The current plugin version doesn’t know what to do with this code so it reports the general error message. I fixed the problem by making the following change to line 399 of the I_OpenSprinkler.xml file:

Original: elseif (status_code == 200) then
New: elseif (status_code == 200 or status_code == 303) then

If you’re interested in why this is happening, here’s my speculation. A 303 response code is a redirect code. Meaning it tells the browser to redirect to different url. If you use the OpenSprinkler web interface and click on the button to enable manual mode it will do a GET request to the following URL: http:///cv?pw=&en=&rd=&rbt=0&mm=1. That request will return a 303 response code with a redirect to http://. Basically, it looks like interface uses the redirect to keep the URL address bar cleaned up. Currently without the 303 redirect, after clicking on the button, the URL address bar would show all the query string variables (pw, en, rd, rbt, and mm).

So does this plugin work with the OSPi v1.4 version? (Pi version, not Arduino)

I have the plugin working great. Thanks for the great work. It really helps being able to access everything from one location (without forwarding ports is even better!)

Anyway, I’ve been watching Vera Logs and noticed that Opensprinkler seems very “chatty”. Is there any way to limit this? Should I not be concerned?

Hey all… I posted this to Ray’s site… but thought you all might also have an idea:

just got my fully building OS. I?m using the following to power it:

with hard connection to router.

It powers up great, and I can see it on my network via web interface. However, nothing happens when I go to manual mode and turn on a valve. the LCD shows it working, but nothing happening. No sounds, nothing.

I tried the self test, and all I see on the LCD is the zone numbers cycle through, counting up. I don?t know if this means the controller thinks all is fine, or not. Any ideas? Power related?

Also, as a side issue. i’m only seeing two of my six zones. Any thoughts there?

EDIT: in the area of full disclosure… after a good hour of debugging, it turns out I had the comm port/wire plugged into the rain sensor connection. NICE. :stuck_out_tongue:

As for the other zones, I just added them manually in the advanced configuration, and it’s all good.

I have the plugin working with OSPi v1.4 after making the code correction I mentioned above to deal with the 303 status code.

I was getting an error “OpenSprinkler Interface : Unable to control irrigation controller. General failure” and found that i needed to enter the IP Address with port 8080 on the end ie: 192.168.1.50:8080

Should this be automatically populating Zone Names?

I am running v 2.0.1 of the OpenSprinkler Software on a OSPi 1.4.

It runs on port 8080 thus the IP field in the Vera sprinkler object is 10.0.0.1:8080.

I can toggle press off/manual/auto in Vera and those show up when I refresh the page on the OSPi.

If I toggle an option on OSPi it is not reflected in Vera – I’ve also done a refresh in the browser on Vera and it doesn’t seem to populate Vera with changes I make in OSPi.

No idea how to get Zone names populated.

I have ZoneIDs listed like this: 01,02,03,04,05,06,07

Received and installed OpenSprinkler with OSPi - all seems to be working properly. Pretty disappointed in the web interface, with no straightforward way to vary zone watering times short of a bunch of separate programs for zones. Was hoping for something my wife could navigate, perhaps similar to the RainBird I decommissioned.

The OSPi offers an interface, albeit very limited.

Does anyone have any suggestions how to use PLEG or ??? to easily manipulate twice daily watering schedules with independent zone ON times? Nothing seems apparent to me at the time as far as PLEG goes, but understand I’m no PLEG expert either.

Don

The OpenSprinkler HTTP GET command can set a timer for a zone when manually turning it on.

Can someone add this to the Plugin?

http://x.x.x.x/sn1=1&t=xxx

I am currently operating mine in manual mode only and using Vera to turn zones on/off but if Vera doesn’t turn the zone off for some reason, it will remain on forever. Setting this variable ensures the zone will turn off after a set time.

I just installed an OSPi 1.4 running on 2.0.2
I entered the IP and Port 8080 and the password in the advanced Tab of the OpenSprinkler Device, but only get
“OpenSprinkler Interface : Unable to control irrigation controller. General failure.”
I can’t set it to manual or auto. I don’t see any of my stations.
I tried setting the debug mode in the I_OpenSprinkler1.xml device file, but when I try to open it with WinSCP it seems to be compressed.
Any ideas what I could do?

pls90,
First, try port 80, if you haven’t already done so.

[quote=“pls90, post:51, topic:176206”]I just installed an OSPi 1.4 running on 2.0.2
I entered the IP and Port 8080 and the password in the advanced Tab of the OpenSprinkler Device, but only get
“OpenSprinkler Interface : Unable to control irrigation controller. General failure.”
I can’t set it to manual or auto. I don’t see any of my stations.
I tried setting the debug mode in the I_OpenSprinkler1.xml device file, but when I try to open it with WinSCP it seems to be compressed.
Any ideas what I could do?[/quote]

The v2 serious of the OpenSprinkler software for OSPi doesn’t work with the current rev of the plugin.

Grab the v1 image file for OSPi and it should have ver 1.8.3 of Open Sprinkler (not the pretty GUI but a simple GUI). That one works with the plugin.

http://rayshobby.net/phpBB3/viewtopic.php?f=28&t=723&p=4873#p4873

I tried port 80, no luck.
I’m quite happy with the 2.0.2 functionality, it supports wunderground rain forecast based delays of the watering programs.
The reason I want to intergrate OSPi into vera is to setup my pleg to notify me if watering started but did not finish after the expected time.
Are there big differences in 1.8 and 2.0 firmware?

I tried port 80, no luck.
I’m quite happy with the 2.0.2 functionality, it supports wunderground rain forecast based delays of the watering programs.
The reason I want to intergrate OSPi into vera is to setup my pleg to notify me if watering started but did not finish after the expected time.
Are there big differences in 1.8 and 2.0 firmware?

[quote=“pls90, post:55, topic:176206”]I tried port 80, no luck.
I’m quite happy with the 2.0.2 functionality, it supports wunderground rain forecast based delays of the watering programs.
The reason I want to intergrate OSPi into vera is to setup my pleg to notify me if watering started but did not finish after the expected time.
Are there big differences in 1.8 and 2.0 firmware?[/quote]

I’m sure the 2.0.2 is fantastic (I played with it on my Pi for a while) but it won’t work with the current version of the plugin.

2.02 on the Pi has a pretty GUI than 1.8 and more options in setting programs.

And plugin support.

I am hoping the arduino version gets support for forecast-based non-watering. But it doesn’t have it yet. But I can do something in Vera for that.

I got a kit with firmware version 2.0.5, works fine with the plugin.

How do you lot prefer to run irrigation programmes? Do you program a fixed schedule into OpenSprinkler, or do you let Vera run things?

Weather and the necessity to irrigate is variable here, so a fixed schedule maxes little sense. I usually kick off the program manually on dry days, but would like to integrate more with rain and soil sensors, and Wunderground forecasts. In that case I’ll pretty much have to go with Vera as the controller.

So here is what I did:

I modified the plugin (Attached) to report on Rain Sensor Status from OpenSprinkler. It reports as “Rain” or “NoRain”.

I have a program defined on the Sprinkler to run every other day for my various zones. If the OpenSprinkler is set to “Auto” then this program runs.

Every day at 4am, I run the following Luup code in a scene:

[code]–Run at 4am
–Check Rain Sensor and Check Forecasted Precipitation
–If Rain Sensor set to Rain then disable sprinklers
–If Forecasted Precip > 1 then disable the sprinklers
–Else Enable Sprinkler

if luup.variable_get(“urn:fowler-cc:serviceId:OpenSprinkler1”, “RainSensorStatus”, 187) == “Rain” then
–Rain sensed; disable the sprinkler
luup.call_action(“urn:fowler-cc:serviceId:OpenSprinkler1”,“SetModeTarget”,{NewModeTarget=“Off”},187)
luup.call_action(“urn:richardgreen:serviceId:VeraAlert1”, “SendAlert”, {Message = “Irrigation Stopped due to rain detected by outdoor sensor”, Recipients = “Insert Email Address”}, 85)
elseif luup.variable_get(“urn:upnp-org:serviceId:VRainSensor”,“ForecastedPrecip”, 180) > “1” then
luup.call_action(“urn:fowler-cc:serviceId:OpenSprinkler1”,“SetModeTarget”,{NewModeTarget=“Off”},187)
luup.call_action(“urn:richardgreen:serviceId:VeraAlert1”, “SendAlert”, {Message = “Irrigation Stopped due to forecasted rain”, Recipients = “Insert Email Address”}, 85)
else luup.call_action(“urn:fowler-cc:serviceId:OpenSprinkler1”,“SetModeTarget”,{NewModeTarget=“Auto”},187)
luup.call_action(“urn:richardgreen:serviceId:VeraAlert1”, “SendAlert”, {Message = “Irrigation Enabled by Vera”, Recipients = “Insert Email Address”}, 85)
end[/code]

This Script uses the Virtual Rain Sensor for rain forecase and Vera Alert (to send me email logs) and of course the wired sensor on my Sprinkler system.

Separately, I have a PLEG that turns the sprinkler off If I have a zone run longer than 17 minutes (i.e. if I turn it on manually and forget to turn it off).

The only problem I have is this line: elseif luup.variable_get(“urn:upnp-org:serviceId:VRainSensor”,“ForecastedPrecip”, 180) > “1” then

It works if I have it set to “1” but not “.25” which is what I’d like…

You sir…are awesome!!!

Plugin still working? I’m about to order, I expect I’ll get 2.05.
I’m concerned with compatibility between the firmware, plugin and iOS app. Plus your iOS app.