Author Topic: OpenSprinkler Plugin Update for firmware 2.1.3+  (Read 29910 times)

Offline brucehvn

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +1/-3
OpenSprinkler Plugin Update for firmware 2.1.3+
« on: January 11, 2015, 06:12:57 pm »
**** Update 03/01/2015 ****
OpenSprinkler just released their unified firmware 2.1.3 which means that the API should now be stabilized between the regular OS, the OSPi, and the OSBBB.  They also added hashed md5 passwords to the API.

The files that are attached here are now only compatible with firmware 2.1.3 and above.  They should work now no matter what version of the OS you have as long as you can run firmware 2.1.3.

*************************

Based on the discussion here, I'm posting some updated files for the OpenSprinkler plugin to allow it to work with the latest firmware (mine is running 2.1.2).  This is a rough beta, but appears to be doing what it should.  The instructions I'm going to give below are for UI5 because that's what I use.  I can't really answer any questions on UI7 installation.

The first step is to install the current OpenSprinkler plugin from the app store if you haven't already.  The files I'm putting here are just updates to the existing files so there's no formal install for them yet.

Next you should backup the files that we are about to overwrite.  Go to Apps->Develop Apps->Luup Files and download the following three files:
I_OpenSprinkler1.xml
D_OpenSprinkler1.json
D_OpenSprinkler1_UI7.json

Save them somewhere so you can restore them later if necessary.

Because the new firmware for OS returns everything in JSON, I opted to use akbooer's JSON parser library.  You will need to install this to /usr/lib/lua (usually done via scp or sftp).  If you use any of akbooer's other programs/plugins, you may have it installed already.  You can get the file from here.  That's the official thread for the parser and the latest version will be available there.

Once those steps are done, you are ready to upload my updated versions of the three files you backed up above (you did back them up, right?)

Using the same Apps->Develop Apps->Luup Files screen, browse for my copy of the three files attached here so they show up in the right hand side of that screen, ready for upload.  Check the "Restart Luup after upload" check box and hit the "Go" button.  Vera will restart the luup engine.

In order to see the UI changes, you might need to refresh the vera page in your browser, or maybe even clear your browser cache and reload.  When it's working right, the main OpenSprinkler controller device will only have "Disable" and "Enable" buttons next to each other instead of "Off", "Manual", and "Auto" in one column.

Debugging is turned on, so there will probably be lots of feedback in the logs which could be helpful to me if you see any issues.

Configuration is pretty much the same as for the old plugin.  You can look at the original thread for more info.  I've added one new variable called ManualMaxMinutes which by default is set to 1.  If you want to control the valves manually with vera, then set this to some number that is probably more realistic.  The valves will run no longer than this amount when you turn them on manually.  I had to do this because the new API requires a time be passed in when turning on a valve manually.  You can always still turn them off early, however.

I have been using 20 seconds for the status update time as opposed to the default 2 seconds.  That seems plenty for me and cuts down on some network traffic and vera overhead.

So, give it a whirl and see how it goes.  Let me know of any issues or other features you might like to see.

« Last Edit: March 01, 2015, 09:45:18 pm by brucehvn »

Offline xuniman

  • Sr. Newbie
  • *
  • Posts: 36
  • Karma: +0/-1
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #1 on: January 19, 2015, 10:39:04 pm »
So I had some free time and thought I would give this a try. So far no luck. Here's what I've done:

I checked to make sure that dkjson.lua was in /usr/lib/lua (I had EventWatcher loaded)
I backed up the files you directed. I uploaded your new files and set the lua engine to restart
I cleared the cache in Chrome

When I look at the OpenSprinkler device I now see enable and disable instead of the auto/manual/off
 I don't see your new variable in the advanced tab of the device??

Nothing seems to actually do anything but there are no errors generated

Any troubleshooting tips? I'm happy to be a beta tester. I have a Vera 3 running UI5 and another test Vera 3 running UI7 (both seem to be the same)
My OpenSprinkler is a OSPi unit that is now running the 2.2.2 software (I tried a git and that's what loaded). It says it's from 1-13-15 so really new. It may have broken what you tried to do.

Let me know if I can help.

Offline brucehvn

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +1/-3
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #2 on: January 20, 2015, 01:34:15 am »
So I had some free time and thought I would give this a try. So far no luck. Here's what I've done:

I checked to make sure that dkjson.lua was in /usr/lib/lua (I had EventWatcher loaded)
I backed up the files you directed. I uploaded your new files and set the lua engine to restart
I cleared the cache in Chrome

When I look at the OpenSprinkler device I now see enable and disable instead of the auto/manual/off
 I don't see your new variable in the advanced tab of the device??

Nothing seems to actually do anything but there are no errors generated

Any troubleshooting tips? I'm happy to be a beta tester. I have a Vera 3 running UI5 and another test Vera 3 running UI7 (both seem to be the same)
My OpenSprinkler is a OSPi unit that is now running the 2.2.2 software (I tried a git and that's what loaded). It says it's from 1-13-15 so really new. It may have broken what you tried to do.

Let me know if I can help.

Thanks for the info.  So, for the firmware, you used their firmware upgrade tool and the version it gave you was 2.2.2?  Did it say that was a beta or anything?

Did you set your zones in the ZoneIds variable, and if so, do you see the child devices being created for those?

Are you able to ssh to your vera unit?  If so, you could pull some info from the logs and it might tell us more about what's happening.  Let me know if you can ssh in and I'll tell you what I need you to do.  I can also try and install the 2.2.2 update and see if I encounter any issues.  I'm guessing they might have made some change between the 2.1 -> 2.2.  But if I do that, it will probably be a few days before I can get to it.

Bruce

Offline brucehvn

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +1/-3
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #3 on: January 20, 2015, 02:40:26 pm »
I just downloaded the firmware update tool from OpenSprinkler.  My hardware appears to be the latest, 2.2 and the latest firmware it offered me was 2.1.2 which is what I already have.  I'm using the standard AVR based version though.

It looks like the OSPi uses a completely different way of updating software and I wouldn't be surprised if the versions don't match.  The key is whether the API is consistent across versions of OS.  I will write Ray and ask about this.

Bruce

Offline brucehvn

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +1/-3
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #4 on: January 20, 2015, 08:28:05 pm »
I talked to Samer at OS support via e-mail.  It appears there are some differences in the API between the OSPi and the Arduino based units.  The firmware for the OSPi is user contributed and developer updated, so while they strive to have API compatibility, there are some things that are different.  He offered to send me the list of things and how to tell which unit is being used.  So if I get that list, I will try to update the plugin to accommodate the various models.

Offline benr

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +2/-1
  • Everywhere And Nowhere
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #5 on: January 27, 2015, 01:10:22 pm »
Nice. Ill keep an eye on this thread I just found out about OpenSprinkler and for $99 with all this functionality its sounding like a good deal. Plus I noticed in the latest HomeWave update support for the OpenSprinkler Plugin was added which is a major plus.

Offline tomtcom

  • Hero Member
  • *****
  • Posts: 987
  • Karma: +23/-31
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #6 on: February 22, 2015, 07:26:41 pm »
I originally looked at the Asante irrigation controller. However it only has 6 zones and I need 8 so OpenSprinkler is what I'd like to get. My birthday is less than a month so.......lol...

I hope you are still working on this. I would certainly help out with testing as I did with a MyQ device for my garage. I just like how OpenSprinkler is literally meant to be open and not all the other closed proprietary solutions. Thanks!

Offline brucehvn

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +1/-3
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #7 on: February 22, 2015, 08:17:25 pm »
I originally looked at the Asante irrigation controller. However it only has 6 zones and I need 8 so OpenSprinkler is what I'd like to get. My birthday is less than a month so.......lol...

I hope you are still working on this. I would certainly help out with testing as I did with a MyQ device for my garage. I just like how OpenSprinkler is literally meant to be open and not all the other closed proprietary solutions. Thanks!

I haven't really heard any complaints about the arduino based open sprinkler running with this version of the plugin.  I have to make some changes to get it to work with the Pi version of the unit.

Bruce

Offline tomtcom

  • Hero Member
  • *****
  • Posts: 987
  • Karma: +23/-31
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #8 on: February 22, 2015, 09:20:35 pm »
I didn't readily see the difference on their site nor a reference in the faq. How are you knowing what you get directly from their site?

Offline tomtcom

  • Hero Member
  • *****
  • Posts: 987
  • Karma: +23/-31
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #9 on: February 22, 2015, 09:23:31 pm »
I didn't readily see the difference on their site nor a reference in the faq. How are you knowing what you get directly from their site?
Edit....I meant pi or arduino.

Offline brucehvn

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +1/-3
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #10 on: February 23, 2015, 06:18:41 am »
I didn't readily see the difference on their site nor a reference in the faq. How are you knowing what you get directly from their site?

As far as the end user is concerned, you probably wouldn't see much difference between the arduino or pi versions.  But from the aspect of someone developing the software, or in this case a plugin for the unit, there are some differences in the two.  Obviously, the arduino and pi are using two completely separate micro controllers, which means the firmware is not identical.  The firmware is developed by different developers and while they try to maintain compatibility with the API, the pi version is lagging behind somewhat, so we have to code around those differences.

On the website, this page lists all the various options.

Bruce

Offline tomtcom

  • Hero Member
  • *****
  • Posts: 987
  • Karma: +23/-31
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #11 on: February 23, 2015, 08:56:13 am »
Ahh, I see. Thanks for that. Sorry I missed it.

Offline kyle.dawson

  • Jr. Member
  • **
  • Posts: 92
  • Karma: +0/-1
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #12 on: February 27, 2015, 09:56:01 pm »
I have OSPi.   I love how it has raspberryPI.  Did not realize that OpenSprinkler and OSPi had different API.  I would developer for mios app gets this working for OSPi.OSPi was so easy to setup and replace my existing system, 10 min. Can control via phone while at home.  Once it works with Vera, I would have one interface to all my stuff and access to OSPi via internet via vera apps.


Here is my version of OSPi
Software version: 2.2.30 (2015-02-21)

Kyle
VeraPlus UI7(1), Sonos(3), GE Switch(25), GE Dimmer(1), GE Zwave Outlet(3),Aeon Labs Z-Wave Smart Energy Switch(1) , MimoLight Garage Door(1), MimoLight  Door Bell(1), Foscam Camera(8), Enerwave Z-wave PIR Sensor(1), Aeon Labs Z-Wave Multi-Sensor(2), Fibaro Motion(6), Honeywell Thermostat(2)

Offline brucehvn

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +1/-3
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #13 on: February 28, 2015, 04:10:27 am »
I have OSPi.   I love how it has raspberryPI.  Did not realize that OpenSprinkler and OSPi had different API.  I would developer for mios app gets this working for OSPi.OSPi was so easy to setup and replace my existing system, 10 min. Can control via phone while at home.  Once it works with Vera, I would have one interface to all my stuff and access to OSPi via internet via vera apps.


Here is my version of OSPi
Software version: 2.2.30 (2015-02-21)

Kyle

The API is mostly the same, maybe about 85%.  The Pi version is just lagging behind the development of the Arduino based version a little bit.  Since your firmware version was just released about a week ago, they might have made some more advances and I'll need to check out to see what they've done.  The biggest hurdle is that the Pi version still used the Auto/Manual mode settings in order to control valves individually (which is what we need from Vera), but the Arduino version has done away with that concept entirely.  I've been a little swamped and haven't been able to get finished incorporating the Pi support into the new plugin.  But hopefully I'll have something for you Pi users to try out soon.

Bruce

Offline kyle.dawson

  • Jr. Member
  • **
  • Posts: 92
  • Karma: +0/-1
Re: OpenSprinkler Plugin Update for firmware 2.1.x
« Reply #14 on: February 28, 2015, 09:21:17 am »
Thanks for follow up.  If you need help, testing, coding, let me know. I can help.  Not sure if you have pi version to test with.
VeraPlus UI7(1), Sonos(3), GE Switch(25), GE Dimmer(1), GE Zwave Outlet(3),Aeon Labs Z-Wave Smart Energy Switch(1) , MimoLight Garage Door(1), MimoLight  Door Bell(1), Foscam Camera(8), Enerwave Z-wave PIR Sensor(1), Aeon Labs Z-Wave Multi-Sensor(2), Fibaro Motion(6), Honeywell Thermostat(2)