Any experience with RainMachine integration?

Posted on
Wed Mar 04, 2020 3:45 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Any experience with RainMachine integration?

siclark wrote:
I've looked to see if there are hookups to other HA systems, especially where we could leverage via mqtt or node-red but consensus seems to be they are happy to let it run locally and no need. ... ...I definitely want the ability to run a zone on demand as some will be connected as required to sprinklers or hoses. However as the Pro has homekit and I can ask Siri on the Apple watch that probably covers most use cases.

I think your assessment is pretty accurate. It seems the API is primarily intended to aid in programming the RainMachine rather than controlling it is regular use.

I also have the need to run zones on demand for special reasons. For example, my pool refill line is controlled by the RainMachine and sometimes I want to give a zone a little extra water, or, for testing and working on the system. That is why I created the script I posted in this thread. For me, that does around 90% of what I need. The only feature missing is the ability to have Indigo know when a zone is on. That can be done by frequently polling the RainMachine, but that's really not the best way to do it so I am looking into some means (RainMachine SDK) of having the RainMachine push a notification when a zone changes state.

On a philosophical note, personally, I do not see why someone would spend the money for a completely automatic irrigation controller and then want to control it completely from some other system, like Indigo. If someone wanted that level of control, then why not buy a relay board and 24vac transformer and write their own system. But, that is just my opinion, but perhaps I am missing something.

BTW, I have the Touch-HD and, while not advertised as supporting HomeKit, it does.

Posted on
Tue Dec 15, 2020 10:24 pm
geoffsharris offline
Posts: 45
Joined: Nov 26, 2012

Re: Any experience with RainMachine integration?

I'm a total hack and not any sort of python programer, but I do have a prototype rainmachine plugin that allows for basic functionality. I have not put int he work to update device states on the server, do robust error handling, etc. It does allow you to log into devices multiple devices and turn on and off both zones and programs.

https://github.com/geoffsharris/Indigo-Rainmachine

Feel free to give it a test. Would welcome some experienced help on maturing it into a more robust solution.

Posted on
Wed Dec 16, 2020 12:17 pm
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Any experience with RainMachine integration?

This is great, been waiting awhile for a RainMachine Plugin! :D

Installed, crashes upon starting plugin. :(

Posted issue on Github as well.

Code: Select all
 Starting plugin "RainMachineDev 0.1" (pid 31700)
   RainMachineDev Error            Error in plugin execution InitializeMain:

Traceback (most recent call last):
  File "plugin.py", line 18, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/RainMachineDev.indigoPlugin/Contents/Server Plugin/client.py", line 6, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/RainMachineDev.indigoPlugin/Contents/Server Plugin/controller.py", line 8, in <module>
ImportError: No module named urllib3

   Stopping plugin "RainMachineDev 0.1" (pid 31700)
   Stopped plugin "RainMachineDev 0.1"

--
Korey

Posted on
Wed Dec 16, 2020 2:39 pm
geoffsharris offline
Posts: 45
Joined: Nov 26, 2012

Re: Any experience with RainMachine integration?

Will look into this. I'm not sure of all of the python libraries that are part of Indigo. I would expect urllib3 would be available, but not sure. Perhaps Jay or Matt could suggest how this can be resolved.

Posted on
Wed Dec 16, 2020 4:23 pm
geoffsharris offline
Posts: 45
Joined: Nov 26, 2012

Re: Any experience with RainMachine integration?

Check and see if you have urllib3 installed/access following the thread below but using the urllib3 import instead of requests in an indigo script. If it comes back with failure to import, I will need to see how a library gets added to a plugin. You may also need to import urllib3 and/or requests if you have the problem described in the thread. Beyond my ability to help.

viewtopic.php?f=108&t=23041&p=182942&hilit=urllib3#p182942

https://urllib3.readthedocs.io/en/lates ... guide.html

Open a schedule and do a server script and test.

import requests

r = requests.get('https://api.github.com/events')
indigo.server.log(str(r.status_code))

Should give 200 in the log

so should this:

import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'http://httpbin.org/robots.txt')
indigo.server.log(str( r.status))
Last edited by geoffsharris on Wed Dec 16, 2020 6:28 pm, edited 1 time in total.

Posted on
Wed Dec 16, 2020 5:42 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Any experience with RainMachine integration?

Indigo is using the macOS Python 2.7 install, so whatever that includes (which can vary, unfortunately, based on macOS version) is available. Urllib2 should definitely be there, but I don't think urllib3 will be.

Image

Posted on
Thu Dec 17, 2020 12:10 am
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Any experience with RainMachine integration?

geoffsharris wrote:
Check and see if you have urllib3 installed/access following the thread below but using the urllib3 import instead of requests in an indigo script. If it comes back with failure to import, I will need to see how a library gets added to a plugin. You may also need to import urllib3 and/or requests if you have the problem described in the thread. Beyond my ability to help.

viewtopic.php?f=108&t=23041&p=182942&hilit=urllib3#p182942

https://urllib3.readthedocs.io/en/lates ... guide.html

Open a schedule and do a server script and test.

import requests

r = requests.get('https://api.github.com/events')
indigo.server.log(str(r.status_code))

Should give 200 in the log

so should this:

import urllib3
http = urllib3.PoolManager()
r = http.request('GET', 'http://httpbin.org/robots.txt')
indigo.server.log(str( r.status))


urllib3 installed now, plugin runs! :D

Will not log into my HD 16 locally, updated Github issue.

--
Korey

Posted on
Thu Dec 17, 2020 10:34 am
geoffsharris offline
Posts: 45
Joined: Nov 26, 2012

Re: Any experience with RainMachine integration?

Sent you note on Github. Since MAC address from the rain machine has been received, it should be ready to go. There isn't a corresponding successful login message.

Create a schedule or trigger event and then under devices on the actions tab you should see RainMachineDev Controls
Screen Shot 2020-12-17 at 8.24.24 AM.png
Screen Shot 2020-12-17 at 8.24.24 AM.png (259.56 KiB) Viewed 3896 times


Screen Shot 2020-12-17 at 8.23.48 AM.png
Screen Shot 2020-12-17 at 8.23.48 AM.png (325.04 KiB) Viewed 3896 times

Posted on
Thu Dec 17, 2020 12:18 pm
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Any experience with RainMachine integration?

Correct you are, it will control the unit! nice work! :D :D :D

--
Korey

Posted on
Thu Dec 17, 2020 12:24 pm
geoffsharris offline
Posts: 45
Joined: Nov 26, 2012

Re: Any experience with RainMachine integration?

Awesome. Let me know how it goes. It is a pretty raw first attempt, so it may have some issues. Will try to update a few UI features and get a working beta going shortly.

Posted on
Sat Dec 19, 2020 12:18 am
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Any experience with RainMachine integration?

Plugin is running great (v0.4) Thanks for this Geoff!

Fantastic addition to the Indigo ecosystem! 8) 8)

There is no better place on the Internet than the Indigo community ! :mrgreen:

--
Korey

Posted on
Mon Dec 21, 2020 12:41 am
rhanson offline
Posts: 192
Joined: Apr 30, 2013

Re: Any experience with RainMachine integration?

Installed here and working fine so far! Great job!

This has been on my to-do list for over a year, but the hassle of porting 3.x -> 2.7 and async kept pushing it down the list. Thanks for taking care of it! :-)

Since the controller should adjust its schedule based on weather automatically, I'm most interested in just knowing when it watered, and how much for each zone.

You might consider adding some states per zone:

zone_01_start : 2020-12-20 22:21:45.999999 (timestamp)
zone_01_stop: 2020-12-20 22:24:45.999999 (timestamp)
zone_01_duration: 180 (int, seconds)
zone_01_name: Some flowers, but mostly sidewalk

These could be determined by using his "stats" function, or as observed by the plugin as current_zone changes.

Thanks again!!

Posted on
Wed Apr 07, 2021 8:49 am
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Any experience with RainMachine integration?

Hey Geoff!

Your plugin (v.04 ) has been running flawlessly for months. 8)

Might I suggest it's time to change if from "Dev" to official and add it to the Indigo Plugin Store? :D :D

The more Plugins the better!

Thanks again!

--
Korey

Posted on
Mon May 24, 2021 7:27 pm
farberm offline
Posts: 393
Joined: Feb 24, 2008

Re: Any experience with RainMachine integration?

Any chance we can get other states such as usage and flow meter clicks?

Posted on
Thu Nov 24, 2022 4:41 pm
geoffsharris offline
Posts: 45
Joined: Nov 26, 2012

Re: Any experience with RainMachine integration?

I have updated the plugin to the API3 which should support python3 and work going forward. Feel free to test and see if it works for you.

Who is online

Users browsing this forum: No registered users and 6 guests