troychasey Posted July 18, 2016 Posted July 18, 2016 (edited) I know people keep saying "why would you want to do this?" For me it is cats and my raised garden beds. Would love any input you all have. GOAL: trigger my garden sprinkler zone for 30 seconds any time there is motion sensed on my insteon motion detector. Addition to goal: deactivate program by keypad button. problem 1: could not get the isy to communicate with rachio's servers...I think related to ssl issues? my solution: write a simple php script that CURLs the rachio server on one of my servers, and trigger the link on my server when motion is detected. my php fyi <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://api.rach.io/1/public/zone/start"); $data = array( 'id' => '[MYDEVICEID]', 'duration' => 25, ); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $headers = array(); $headers[] = 'Authorization: Bearer [MYAUTHID]'; $headers[] = 'Content-Type: application/json'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $server_output = curl_exec ($ch); curl_close ($ch); print $server_output ; ?> Obviously, this is sloppy, so if anyone has any tips on getting the rachio servers directly, I would love to hear them. https://rachio.readme.io/v1.0/docs problem 2: I did not know the motion sensor wouldn't work through a big window...oops my solution will be to try to weatherproof the sensor a bit and put it outside. problem 3: [FIXED BY LeeG] the isy always throws an error every time I try to set options...the settings seem to actually take, but it can't read the current settings so communication error keeps popping up. solution was: I needed to press set button before trying to set options. Edited July 18, 2016 by troychasey
LeeG Posted July 18, 2016 Posted July 18, 2016 The Motion Sensor is asleep because it is battery powered. Press Motion Sensor Set button for approx 4 seconds. Motion Sensor Red LED should now be blinking. Now the Motion Sensor is awake and the Options can be set for approx 4 minutes..
troychasey Posted July 18, 2016 Author Posted July 18, 2016 The Motion Sensor is asleep because it is battery powered. Press Motion Sensor Set button for approx 4 seconds. Motion Sensor Red LED should now be blinking. Now the Motion Sensor is awake and the Options can be set for approx 4 minutes.. ugh...thank you...I had done this during syncing, but didn't get that I had to do this every time I set options...that worked great.
paulbates Posted July 18, 2016 Posted July 18, 2016 problem 2: I did not know the motion sensor wouldn't work through a big window...oops my solution will be to try to weatherproof the sensor a bit and put it outside. The insteon motion sensor is sold as indoor/outdoor and can take cold and heat all day long. For me that's ~-20F to ~105F. However... heavy, continuous downpours knock them out...for good. I believe water comes through the lens seal as well as where the case and battery door pull apart. Mount it under the eves, or provide cover for the unit from above, out and over the front Paul
troychasey Posted July 18, 2016 Author Posted July 18, 2016 The insteon motion sensor is sold as indoor/outdoor and can take cold and heat all day long. For me that's ~-20F to ~105F. However... heavy, continuous downpours knock them out...for good. I believe water comes through the lens seal as well as where the case and battery door pull apart. Mount it under the eves, or provide cover for the unit from above, out and over the front Paul Well that makes it easier...I have just the place in mind...right at cat level!
paulbates Posted July 18, 2016 Posted July 18, 2016 Well that makes it easier...I have just the place in mind...right at cat level! I have one on a stake under my deck as a "critter detector" (primarily skunks at night). It triggers photonic beam weaponry ...e.g. a landscape flood light. I thought about the sprinkler angle, but over time it triggers less and less. I think they've gotten the message Paul
troychasey Posted July 18, 2016 Author Posted July 18, 2016 I have one on a stake under my deck as a "critter detector" (primarily skunks at night). It triggers photonic beam weaponry ...e.g. a landscape flood light. I thought about the sprinkler angle, but over time it triggers less and less. I think they've gotten the message Paul At night we have raccoons playing in the yard, which I love, but it is just this one cat that loves to sleep in my garden...day or night. Just realized I will have to modify my goal to include using a keypad button to disable the program, so I can actually work in the beds without getting wet!
troychasey Posted July 19, 2016 Author Posted July 19, 2016 Goal mostly complete! Would still like to talk to the rachio servers directly, if anyone has tips. https://rachio.readme.io/v1.0/docs But, I have a working cat sprinkler.
paulbates Posted July 19, 2016 Posted July 19, 2016 (edited) Congrats! Because rachio requires an oauth2 based token, the ISY is unable to talk to it directly. A "middle man" interface is needed to manage the token. I have the rainmachine and it has the same ISY challenge One common developer approach: Using ISY V5 firmware and a creating a nodeserver. The nodeserver is an interface that talks to your rachio on one end, and ISY devices it creates on the other. This is becoming the common approach for this exact type of technical requirement. The primary language for nodeservers is Python, and the ISY Python support framework is named Polyglot. If you are handy in linux/python, there are a number of examples and members in that part of the forum that would be happy to help out if you post there. Polyglot requires studying the link topics, but is one of the straightest paths to meet your requirement Note that ISY V5 Firmwares are considered alpha/beta depending which version you use. Paul Edited July 19, 2016 by paulbates
troychasey Posted July 19, 2016 Author Posted July 19, 2016 Congrats! Because rachio requires an oauth2 based token, the ISY is unable to talk to it directly. A "middle man" interface is needed to manage the token. I have the rainmachine and it has the same ISY challenge One common developer approach: Using ISY V5 firmware and a creating a nodeserver. The nodeserver is an interface that talks to your rachio on one end, and ISY devices it creates on the other. This is becoming the common approach for this exact type of technical requirement. The primary language for nodeservers is Python, and the ISY Python support framework is named Polyglot. If you are handy in linux/python, there are a number of examples and members in that part of the forum that would be happy to help out if you post there. Polyglot requires studying the link topics, but is one of the straightest paths to meet your requirement Note that ISY V5 Firmwares are considered alpha/beta depending which version you use. Paul Thanks Paul, I actually was just trying to directly call the url via https in a network resource... In theory, all I need to call is the url in my phpcurl and my [MYDEVICEID] and [MYAUTHID] which are hard coded in my scripts. I'll certainly check out the Polyglot stuff you talk about...might be right up my alley
Recommended Posts