SmartThings Community

Ryobi modular smart garage door opener


@madj42 I used the Live Logging feature of SmartThings and it appears that its sending Status Refresh for the GDO about every 6 minutes. Not exact but withing about 30 seconds. Is that the correct behavior or is it supposed to be a live refresh like the Ryobi App does?

(Rob74lee) #64

Great thread guys! I have been following this for about a couple of months and I am still stumped. A video or how to would be appreciated! I can create the doh but it shows the door as always closed. When I try to open it it pops on then back closed quickly. Between the GDO and my Vivint alarm they are the last 2 pieces to a completely automated home via HomeKit, SmartThings, Homebridge and the raspberry pi. This is addictive to say the least! Thank you all for your hard work! Wolf hunter, Madjd42 and Skydroid! I’m hooked to this thread!

(Justin Dybedahl) #65

I made a mistake and posted the wrong saved version of the DTH. I’ve posted the version of the device handler I’ve been running since my last post with some tweaks I made tonight. This should up the auto refresh time to around a minute or less and removes the api key and door Id parameters. Also it switches the email and password parameters to the types that they should be (allows for validation of the email address and masking of the password field).

@Wolfhunter1043 I’m not sure what the auto refresh time was for the last version as I didn’t have anything figured out for that. I’ve been slowly trying to iron out the issues as I find some time. Let me know if the update time is any better. While one minute is not great, it should help.

@rob74lee if you turn the light on in the ryobi app, then open the device handler and press the refresh, does it eventually come back with the light on status? You may also want to check your password as it may have some characters that are not translated well. If the password is the issue, please let me know in a PM what characters they were and I’ll look into it.

(Rob74lee) #66

@madj42 Thanks for the reply! I deleted the DTH and copied it in again. I can now get the app to show up in SmartThings but it does not work. I wonder if I am going about it wrong. Here are my steps today:

I copied the DTH from the ryobi.groovy file.
I changed the email address and password in the new DTH.
I also went into the settings on the app and added the email address and password into the fields.
I went back and changed the values for app key, door I’d and open address to false. When true they would not allow me to save my username and password in the actual SmartThings app. I haven’t figured out how to utilize the other .js file with any success. I know that my error is in technique on my end but I can’t figure out what I’m doing wrong.

(Justin Dybedahl) #67

@rob74lee Have you installed the necessary node.js server on a raspberry pi or windows machine? That is required for this to work as the device handler interfaces with this for the majority of the calls.

I’ve added a quick and dirty README to the repository that outlines the majority of the basic steps for getting the proxy working on the RPi along with the majority of the DTH setup in the IDE. I haven’t gone through the Node.js setup on Windows or Mac OS but I’m assuming once done, it should be similar as to running the proxy js file.

(Rob74lee) #68

Thanks for the readme! This has helped me tremendously! I have the DTH working correctly and I reinstalled the node on my raspberry pi. I can’t run the script for some reason and I keep getting this error code after running:
pi@raspberrypi:~ $ node RydobiGDOProxy.js
throw err;

Error: Cannot find module ‘/home/pi/RydobiGDOProxy.js’
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3

I copied the proxy over to the pi hosts but it seems that I always end up right here with this error…

(Rob74lee) #69

@Marcus_Pugh, @madj42 I think that once you get this working in Smartthings there isn’t anymore tinkering that needs to be done in Homebridge. Once I got the DTH correctly inputted into Smartthings I ran it through my smart apps and included it into my json Smart app not json.config) it immediately showed in my Home app as a garage door accessory! I did not add any further platforms or accessories into config.json. I configured the new app id and access token and it showed up. I think that I am at the final stages of getting this working thanks to some aid and assistance from @madj42! Marcus compared to all of the tinkering involved in setting up Homebridge this does not seem to be as intense. Once I get my GDO up and running in Smartthings I will detail the steps to add it into the iOS Home app. @Marcus_Pugh have you been able to get your Nest token to work with Homebridge? I can’t get mine to work but by putting in the developer code I have it working through Homebridge. I don’t think it touches the Smartthing app at all. Thoughts?

(Justin Dybedahl) #70

@rob74lee were you able to get past the node error? Sorry, was a busy day and didn’t have time to respond until now.

(Rob74lee) #71

@madj42 thanks for the response. I am still stumped here. I even got the same error on my Mac desktop and the only thing they both have in common is the fact that I have installed Homebridge on both the Mac and the Rasberry Pi. I may wipe my desktop to see if a fresh install yields the same result. I can see the device in SmartThings and in my IOS home app but it is performing the same when I activate the device.

(Justin Dybedahl) #72

Do you have a node_modules directory under your /hoke/pi directory? Also, try running the node command with sudo. While it shouldn’t be required, I’m wondering if it works with root permissions. The proxy service code does use some npm modules. However, I’m not seeing in your error anything referring to any of them. It almost looks like it can’t find the js file. Can you check the permissions on the file?

(Rob74lee) #73

@madj42 I see the node_modules directory in my pi directory. I have tried with sudo command and copied the files in a few different places. I’m still getting the same result…can’t figure it out.

(Rob74lee) #74

@madj42 permissions have been changed for now to allow anyone access until I can get this thing working.

(Justin Dybedahl) #75

I see a spelling error in the name of the js file based on the error in your previous post. It should be RyobiGDOProxy.js. Please check the filename.

(Rob74lee) #76

@madj42 just tried to run it again. Here is the error:
pi@raspberrypi:~ $ node RyobiGDOProxy.js
throw err;

Error: Cannot find module ‘ws’
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/home/pi/RyobiGDOProxy.js:11:17)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
pi@raspberrypi:~ $

(Rob74lee) #77

I placed the entire folder as well as the RyobiGDOProxy file in the home/pi folder. I even tried to execute the file as well.

(Justin Dybedahl) #78

Ok, this one makes more sense. Try doing the following commands:

npm install ws

npm install request

Let me know if it complains about http and url. If so you’ll have to install them with the same command. Once you confirm this worked, I’ll update the Readme when I get home.

(Rob74lee) #79

@madj42 you are the man!!! As soon as I ran these nom installs the door opened right up!!! I owe you brother! This has been haunting me for over a year!!! Thank you!

(Justin Dybedahl) #80

No problem. Glad it worked. Did you have to do anything other than install ws and request? Adding those to the Readme now but wanted to make sure you didn’t have to do anything else.

(Rob74lee) #81

@madj42 didn’t have to do anything! I’m currently working on a script to automate the .js file on the raspberry pi to make sure it runs on boot. Your work is so clean that it literally works right out of the box with Homekit. I have a slight issue with the battery percentage but I think it was already noted and discussed per you and @projectskydroid. That is minor in comparison to the overall project actually working!! The Homekit UI is super clean and organized. Hell Ryobi should just pay you for the Homekit integration that they have been working on for a year or so! This is awesome! Ryobi should pay you for the integration to Homekit!

(Justin Dybedahl) #82

Thanks and I’m glad it’s working with homekit too. If you want me to look at the battery issue you’re having, download the DebugGDOProxy.js file from GitHub and run it in place of the normal node js file in the console. After doing so, open the door or turn on the light using the device handler. It should output a bunch of stuff to the console that will help troubleshoot. Send me a PM with all the info and I’ll see if there’s something that sticks out. I’ve added the instructions for making the service start at boot to the README.