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 December 12th, 2017, 10:49 PM
bpwwer bpwwer is offline
Super Seer
 
Join Date: Oct 2007
Location: California
Posts: 1,594
New - RainMachine Plug-in

I have a plug-in for the RainMachine irrigation controllers available for testing.

Right now, it probably only works with 1st generation hardware since that's what I have. It looks like there may be API differences with newer hardware, but the documentation isn't real clear with exactly what.

To get/install the plug-in first grab the updater_override.txt file (attached) and place it in your homeseer directory. Then from the manage plug-ins menu in HomeSeer, select the plug-in from the available updates (should be the only one) and download/install it.

After starting the plug-in, you'll need to go to the plug-in's configuration page and enter the IP address and Password for the RainMachine. Currently, this only supports direct access to the RainMachine. You can also adjust the polling time, the default is 10 seconds.

The plug-in will create devices for each zone and each program you created on the RainMachine. From HomeSeer, you can see the time remaining on each zone that is currently active and can manually set an immediate run time for each zone. The programs can be started and stopped from the HomeSeer interface.

There isn't any ability to program the RainMachine in the plug-in. That ability seems somewhat redundant with the programmability built into the device itself.

Feedback and bug reports welcome.
Attached Files
File Type: txt updater_override.txt (2.9 KB, 51 views)
__________________
--
Bob Paauwe
ISYInsteon Plug-in
http://www.bobsplace.com/ISYInsteon/
Reply With Quote
  #2  
Old January 14th, 2018, 11:40 PM
ThomasFretwell2 ThomasFretwell2 is offline
Viewer
 
Join Date: Dec 2017
Location: California
Posts: 4
Thanks I was looking at getting this Irrigation system. I have the 2gig at the moment but don't like it that much. when i get it i will have to try your plugin. thanks for putting a plugin together on this device.
Reply With Quote
  #3  
Old January 15th, 2018, 02:16 PM
kevins669 kevins669 is offline
Seer
 
Join Date: Dec 2017
Location: Louisiana
Posts: 14
Hi Bob,

Thanks for deciding to make the plugin for RainMachine. I have a 2nd Generation Touch, and you are correct, this plugin is not working with it.

From the log:
Code:
Jan-15 12:06:01 PM	 	RainMachine	Authentication: The remote server returned an error: (417) Expectation Failed.
Jan-15 12:06:01 PM	 	RainMachine	APIVersion: The remote server returned an error: (404) Not Found.
If you can get the plugin to work with Gen1 and Gen2, it would be a great addition to HS3.

Thanks again.
Kevin
Reply With Quote
  #4  
Old January 16th, 2018, 01:48 PM
bpwwer bpwwer is offline
Super Seer
 
Join Date: Oct 2007
Location: California
Posts: 1,594
Quote:
Originally Posted by kevins669 View Post
Hi Bob,

Thanks for deciding to make the plugin for RainMachine. I have a 2nd Generation Touch, and you are correct, this plugin is not working with it.

From the log:
Code:
Jan-15 12:06:01 PM	 	RainMachine	Authentication: The remote server returned an error: (417) Expectation Failed.
Jan-15 12:06:01 PM	 	RainMachine	APIVersion: The remote server returned an error: (404) Not Found.
If you can get the plugin to work with Gen1 and Gen2, it would be a great addition to HS3.

Thanks again.
Kevin
Hi Kevin,

Thanks for trying it out. Looks like the authentication is one of the areas that's different between the hardware versions. I made some changes for version 3.0.0.1 to try and handle the newer hardware.

One "trick" that can help when debugging is to turn on developer mode for the plug-ins. It's a checkbox on manage plug-in's page. With that checked, a console window will open for each plug-in when it starts. I do output some additional debugging messages to that window so that will help track down issues.

With the override file in place, you should see version 3.0.0.1 now.
Reply With Quote
  #5  
Old January 16th, 2018, 04:14 PM
kevins669 kevins669 is offline
Seer
 
Join Date: Dec 2017
Location: Louisiana
Posts: 14
Quote:
Originally Posted by bpwwer View Post
Hi Kevin,

Thanks for trying it out. Looks like the authentication is one of the areas that's different between the hardware versions. I made some changes for version 3.0.0.1 to try and handle the newer hardware.

One "trick" that can help when debugging is to turn on developer mode for the plug-ins. It's a checkbox on manage plug-in's page. With that checked, a console window will open for each plug-in when it starts. I do output some additional debugging messages to that window so that will help track down issues.

With the override file in place, you should see version 3.0.0.1 now.
Bob,

I just tried the new version, and I get the same two errors in the log. In the developer window, I get the following (I will abbreviate, as I am not at home, and can't copy/paste):

Code:
Plugin Connected to HS
Host API = 3, HS 3.0.0.398 (4)
RainMachine Connected, waiting to be initialized...
CONFIG_CHANGE:  Events Saved    type = 1   ddd = 0   dac = 0
I am glad to test anything you need.

Thanks!
Reply With Quote
  #6  
Old January 16th, 2018, 05:29 PM
bpwwer bpwwer is offline
Super Seer
 
Join Date: Oct 2007
Location: California
Posts: 1,594
Hmm, I changed the error message for the authentication step so it should have been a bit different.

First, did you configure the IP address and account info? After the plug-in starts you'll need to go into it's configuration page to set those.

If you did set that information, then the second error you're seeing is really strange. The error is indicating that the IP address is wrong (or I'm really missing something basic for the newer hardware).

It should be simply accessing "http://<your RM IP address>/api/4/apiVer"

You can enter that URL in a browser and should get a response from the RainMachine. If that doesn't work try: "https://<your RM IP:8080/api/4/apiVer"

The docs show using https and port 8080 so maybe that's another difference.

Looking at some of the API changes in the docs, I suspect that there are going to be a lot more issues and I may need to actually have to account for the specific API version when parsing the responses from the RainMachine.
Reply With Quote
  #7  
Old January 16th, 2018, 07:07 PM
kevins669 kevins669 is offline
Seer
 
Join Date: Dec 2017
Location: Louisiana
Posts: 14
Quote:
Originally Posted by bpwwer View Post
Hmm, I changed the error message for the authentication step so it should have been a bit different.
Hi Bob,

My apologies on the message... it is similar, though!

Code:
Failed to get responst to authentication request: The remote server returned an error: (417) Expectation Failed.
I do get the API response, when using port 8080. I do always have to specify the port when logging in locally, so it looks like you would need to add it to the config screen. It is reporting as the current RM API, 4.5.

I appreciate your hard work on this. I have been really hoping someone would write a simple plugin to at least bring the basics to HS. I know you don't own a Gen 2 model, so anything you do to help does not go without thanks.
Reply With Quote
  #8  
Old January 16th, 2018, 08:13 PM
bpwwer bpwwer is offline
Super Seer
 
Join Date: Oct 2007
Location: California
Posts: 1,594
Quote:
Originally Posted by kevins669 View Post
Hi Bob,

I do get the API response, when using port 8080. I do always have to specify the port when logging in locally, so it looks like you would need to add it to the config screen. It is reporting as the current RM API, 4.5.
Is that with http or https? The docs seem to indicate that https is needed for newer hardware but not with my old hardware.

You can add the port along with the IP address in the config screen. Just use IP:PORT so something like 192.168.1.1:8080 will work. I can make that more clear on the screen. The port is another difference in the hardware versions, mine doesn't require any port as it's on the standard http port 80.

If using just http works, you should get a bit farther after adding the port number into the config option. Otherwise I need to all the queries to use (or allow) https since http is currently hard coded.
Reply With Quote
  #9  
Old January 16th, 2018, 08:20 PM
kevins669 kevins669 is offline
Seer
 
Join Date: Dec 2017
Location: Louisiana
Posts: 14
It needs HTTPS.

Getting more messages in the log, when adding port to the IP:

Code:
Plugin: RainMachine Instance:  3.0.0.1 starting...
RainMachine Connecting to server at 127.0.0.1...
RainMachine Connected to HomeSeer at IP address 127.0.0.1
     Host API version = 3 HomeSeer 3.0.0.398 (4)
     Callback API version = 3
RainMachine Connected, waiting to be initialized...
CONFIG_CHANGE: Events Saved  type = 1  ddd = 0  dac = 0
CONFIG_CHANGE: Event Trigger Added  type = 1  ddd = 11  dac = 3
CONFIG_CHANGE: Event Action Added  type = 1  ddd = 11  dac = 3
CONFIG_CHANGE: Group Added=Delayed Actions  type = 2  ddd = 430604794  dac = 1
CONFIG_CHANGE: Event Added  type = 1  ddd = 11  dac = 1
Unknown save_options = Submit
Thanks!
Reply With Quote
  #10  
Old January 16th, 2018, 09:10 PM
bpwwer bpwwer is offline
Super Seer
 
Join Date: Oct 2007
Location: California
Posts: 1,594
Ok, try 3.0.0.2 and see if you get some real (non-error) messages in the log. If the queries work you should get devices created for the zones and programs configured in the RM.

I'm not sure yet if I'll need to create separate queries for each API version or not.
Reply With Quote
  #11  
Old January 16th, 2018, 09:27 PM
kevins669 kevins669 is offline
Seer
 
Join Date: Dec 2017
Location: Louisiana
Posts: 14
Getting close, Bob!

Code:
Jan-16 7:21:57 PM	 	RainMachine	Failed to get responst to authentication request: The remote server returned an error: (417) Expectation Failed.
Jan-16 7:21:57 PM	 	RainMachine	RainMachine HW version: 3 SW version: 4.0.921 API: 4.5.0
Jan-16 7:21:12 PM	 	Plug-In	Finished initializing plug-in RainMachine
Jan-16 7:21:12 PM	 	Info	Plugin RainMachine has connected. IP:127.0.0.1:50272
Jan-16 7:21:12 PM	 	RainMachine	I have connected to HomeSeer.
Reply With Quote
  #12  
Old January 17th, 2018, 06:07 PM
bpwwer bpwwer is offline
Super Seer
 
Join Date: Oct 2007
Location: California
Posts: 1,594
It took some digging but I think I know what's wrong. The problem I'm having is that I can't reproduce it so I've added a couple of solutions into the code that should resolve it.

The problem is that the c# webclient code sees auth and/or login in the URL and adds a special expect-100 header. It seems like the server in the RM does't like that and throws the 417 error response. Neither the older firmware in my RM or even the simulated RM that's available for testing cares and both handle it fine.

So I've tried a couple of solutions that are supposed to prevent the webclient code from adding the expect-100 header, but without actually sniffing my network traffic I can't really tell if it worked. Anyway, try version 3.0.0.3 and let me know.
Reply With Quote
  #13  
Old January 17th, 2018, 06:18 PM
kevins669 kevins669 is offline
Seer
 
Join Date: Dec 2017
Location: Louisiana
Posts: 14
More progress:

Code:
Jan-17 4:13:19 PM	 	RainMachine	UpdateProgramInfo: The remote server returned an error: (401) Unauthorized.
Jan-17 4:13:19 PM	 	RainMachine	UpdateZoneInfo: The remote server returned an error: (401) Unauthorized.
Jan-17 4:12:19 PM	 	RainMachine	UpdateProgramInfo: The remote server returned an error: (401) Unauthorized.
Jan-17 4:12:19 PM	 	RainMachine	UpdateZoneInfo: The remote server returned an error: (401) Unauthorized.
Jan-17 4:11:19 PM	 	RainMachine	UpdateProgramInfo: The remote server returned an error: (401) Unauthorized.
Jan-17 4:11:19 PM	 	RainMachine	UpdateZoneInfo: The remote server returned an error: (401) Unauthorized.
Jan-17 4:10:19 PM	 	RainMachine	ISYInsteon Plug-in initialization complete.
Jan-17 4:10:19 PM	 	RainMachine	Device record verification complete.
Jan-17 4:10:19 PM	 	RainMachine	Verifying HomeSeer device records.
Jan-17 4:10:19 PM	 	RainMachine	UpdateProgramInfo: The remote server returned an error: (401) Unauthorized.
Jan-17 4:10:19 PM	 	RainMachine	UpdateZoneInfo: The remote server returned an error: (401) Unauthorized.
Jan-17 4:10:19 PM	 	RainMachine	Error The remote server returned an error: (401) Unauthorized. while reading https://192.168.1.26:8080/api/4/program?acess_token=XXXX
Jan-17 4:10:19 PM	 	RainMachine	Error The remote server returned an error: (401) Unauthorized. while reading https://192.168.1.26:8080/api/4/zone?acess_token=XXXX
Jan-17 4:10:19 PM	 	RainMachine	Got response: {"access_token": "XXXX", "checksum": "XXXX", "expires_in": 157680000, "expiration": "Mon, 16 Jan 2023 22:10:19 GMT", "statusCode": 0}
Jan-17 4:10:19 PM	 	RainMachine	Attempting to authenticate with https://192.168.1.26:8080/api/4/auth/login
Jan-17 4:10:19 PM	 	RainMachine	RainMachine HW version: 3 SW version: 4.0.921 API: 4.5.0
Jan-17 4:09:48 PM	 	Warning	Using updater override file: updtater_override.txt for updates!
Jan-17 4:09:48 PM	 	Plug-In	Finished initializing plug-in RainMachine
Jan-17 4:09:48 PM	 	Info	Plugin RainMachine has connected. IP:127.0.0.1:54559
Jan-17 4:09:48 PM	 	RainMachine	I have connected to HomeSeer.
I masked the token. Also, when disabling the plugin, the EXE crashes in Windows. It enables fine, afterward.

Again, very appreciative for your time, especially with having to have me test.

- Kevin
Reply With Quote
  #14  
Old January 17th, 2018, 08:29 PM
bpwwer bpwwer is offline
Super Seer
 
Join Date: Oct 2007
Location: California
Posts: 1,594
It's good that it finally authenticated. But I wasn't really expecting to see all the 401 errors. I'm still not sure that parsing the responses from your RM is going to work but that should generate different errors.

Too bad there's not a face palm smiley here. While staring at your log output I noticed that "access_token" was spelled wrong. Not everywhere in the code but most of them were wrong. However, even with the wrong spelling my RM was accepting it. I guess the older API has some bugs.

Anyway, I fixed the spelling and I'm expecting that to fix the 401 errors, but at this point, who knows
Reply With Quote
  #15  
Old January 17th, 2018, 08:53 PM
kevins669 kevins669 is offline
Seer
 
Join Date: Dec 2017
Location: Louisiana
Posts: 14
Success! It created the Zones and Programs!

The Status refresh is a little wonky, as when I click Stop, it does not seem to refresh the status. It does stop in the Android app I was monitoring.

Do have this error:

Code:
Jan-17 6:40:36 PM	 	RainMachine	Error The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. while reading https://192.168.1.26:8080/api/4/zone/1/stop?access_token=XXXX
But hey, this is a great start. I can provide feedback on UI and other operations, whenever/if ever you want to. Not sure how in depth you want to get with this. What else can I try? Just let me know.

Thanks so much, Bob.
Reply With Quote
  #16  
Old January 19th, 2018, 09:19 AM
Krumpy's Avatar
Krumpy Krumpy is offline
Seer Master
 
Join Date: Apr 2001
Location: Minneapolis, MN
Posts: 1,209
Funny... You guys are thinking about sprinkler systems, and we here in MN are trying to figure out how to get our teens to wear jackets because it is still so flipping cold here. Christmas week was the coldest in 132 years. Irregation is the last thing on my mind...

On the other hand, we don’t have to worry about massive fires.

Anyways, glad someone is working on this so when we actually can use sprinkler systems then all of this will be working....
Reply With Quote
  #17  
Old January 19th, 2018, 08:46 PM
bpwwer bpwwer is offline
Super Seer
 
Join Date: Oct 2007
Location: California
Posts: 1,594
Quote:
Originally Posted by kevins669 View Post
Success! It created the Zones and Programs!

The Status refresh is a little wonky, as when I click Stop, it does not seem to refresh the status. It does stop in the Android app I was monitoring.
Since it looks like the call is getting an error, that probably explains why you're not getting the status refreshed.

Also, the RM doesn't send status and has to be queried to get the current status, so it should update at the next query interval. I think I had the default query interval at 10 seconds as a compromise between getting updates quickly but not overloading the RM.

Quote:
But hey, this is a great start. I can provide feedback on UI and other operations, whenever/if ever you want to. Not sure how in depth you want to get with this. What else can I try? Just let me know.

Thanks so much, Bob.
Whatever ideas you have send them. I pretty much just let my RM run on it's own and don't really need it under the automation system's control. I wrote this mostly to see if I could create a plug-in for it. Thus, I'm open to any and all ideas.
Reply With Quote
  #18  
Old January 21st, 2018, 12:30 AM
ThomasFretwell2 ThomasFretwell2 is offline
Viewer
 
Join Date: Dec 2017
Location: California
Posts: 4
I just picked up My RainMachine will be installing it Sunday. Im Looking forward to this plugin. If I can Help I will Send info as well
Reply With Quote
  #19  
Old February 22nd, 2018, 11:34 PM
rileydogmi rileydogmi is offline
Seer Deluxe
 
Join Date: May 2004
Location: Kalamazoo, MI
Posts: 392
Just installed it - appears to create all the correct zones and programs for my gen 2 - I can't test anything until I use sprinklers (live in Michigan, few months) - but, is there a way to get "Paused" status as a device too? I put my machine into Paused mode for the 5 months as we don't water in the winter...

Can't wait to try this out in a few months!
Reply With Quote
  #20  
Old February 23rd, 2018, 01:45 PM
bpwwer bpwwer is offline
Super Seer
 
Join Date: Oct 2007
Location: California
Posts: 1,594
Quote:
Originally Posted by rileydogmi View Post
Just installed it - appears to create all the correct zones and programs for my gen 2 - I can't test anything until I use sprinklers (live in Michigan, few months) - but, is there a way to get "Paused" status as a device too? I put my machine into Paused mode for the 5 months as we don't water in the winter...

Can't wait to try this out in a few months!
I'm not sure what "paused mode" means. I see a "snooze for xx days" on my dashboard. Is that what you're setting? Or do you have other options in addition to setting the days?

The API shows the following restrictions:

Code:
  "hotDaysExtraWatering": true,
  "freezeProtectEnabled": true,
  "freezeProtectTemp": 2,
  "noWaterInWeekDays": "1001011",
  "noWaterInMonths": "000000000000",
  "rainDelayStartTime": 1479210751,
  "rainDelayDuration": 0
But doesn't explain how to interpret the results. I'm guessing yours may have the "noWaterInMonths" may have a value. Ah, those may be bit fields so the noWaterInWeekDays may mean no watering on sun, wed, fri, sat.

So are you looking for a HS device that just shows the overall status of the RainMachine? I.E. status = active vs. status = paused(inactive)?

I can understand not doing much watering in the winter in Kalamazoo, unless maybe you wanted to make some snow I grew up not too far from there ... the Pontiac/Flint area and my grandparents had a cottage just south of Kalamazoo new Three Rivers.
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
Plug-in support on Linux (Plug-in authors please read!) rjh HS3 Plug-In Development 40 December 29th, 2017 11:30 AM
RainMachine/Rachio/OpenSprinkler mulu Irrigation Discussion 1 December 30th, 2016 03:47 PM
Plug-in doesn't see PLM or Hub, HomeSeer plug-in does LouieD Insteon Plug-in (Mark Sandler) 27 July 19th, 2016 11:31 AM
Compare/contrast ACRF(2) plug-in and RFXCOM plug-in? NeverDie ACRF Processor (3P) 1 November 12th, 2013 11:18 AM
Insteon PLM Plug-in is moving to a licensed plug-in mnsandler Insteon Plug-in (Mark Sandler) 19 September 22nd, 2010 09:33 PM


All times are GMT -4. The time now is 07:18 AM.


Copyright HomeSeer Technologies, LLC