Current as 09/25/16
So like many of us getting started I couldn’t figure out how to REALLY get the SmartThings (ST) and Garage Door Controller to work. After help from other users I figured I’d put together a nice spoon fed thread on how to get it working.
First off we’re talking about the GD00Z Garage Door Controller, there are MANY different companies that make this device, mine is a NuTone (NGD00Z), there’s a version by GoControl, Linear, Iris (Lowes) etc. My understanding they are all Linear devices just rebranded. With the unit you should find a small sensor with an arrow.
Installation is VERY easy, tape / screw the the small sensor onto the garage door, I placed mine in the middle of the TOP garage door segment all the way to one side. Reason: I BELIEVE it will ensure that the door will show Closed only when the door is FULLY down. If I placed it on the bottom of the garage door it could give a false Closed when the door is 1/4 down. While I don’t think I’ll run into a problem, this is a little peace of mind.
Once that’s done mount the main unit close to the garage door motor, as you’ll need to run the single 2 wire strand to the motor control board. You’ll also need to make sure to place the receiver unit close to a 120v power outlet.
This is what mine looks like installed next to my Garage Door Motor.
After everything is plugged in and powered up, open your ST app and “Connect New Device”, while it’s searching press the small button on the side of the GD00Z. The unit should beep and flash a red LED, hopefully your ST app will locate a “Z-Wave Garage Door Opener”. After its found enter any information you wish to change (name, location etc) At this time do not worry about installing any SmartApps etc, just get it seen by ST.
Once you’ve got it in ST go into the Garage Door Opener menu, most likely your garage door will show as “Unknown” status. Just open your garage door as normal, this will cause the sensor to sync up with the controller. You should now see it shows your garage door as open. On the APP issue a Close command, in a few seconds your GD00Z should beep and blink for 5 seconds then start to close the door. Confirm it closes without any problems and confirm in ST that the door shows as Closed.
Note 1/30/2016 I have switched to a Ecolink Z-Wave Wireless Tilt Sensor (about $30 on Amazon) I did this back in October as I do NOT like the passive tilt sensor that comes with the GD00Z. This sensor is somewhat “active” and allows me to be sure of the current state of the garage door. To be honest I’m VERY happy that I switched to this tilt sensor, more of a peace of mind over anything else.
High Five You now can control your Garage Door from your phone.
If you’re like me that’s only 1/2 the problem solved, what you really want is it to let you know IF it’s left open and or close it when you’ve forgotten about it.
Next up is the software magic half.
Open up a tab and head to http://developer.smartthings.com/ and login.
Open up ANOTHER tab and head to https://github.com/gouldner/SmartThingsPublic/blob/master/devicetypes/gouldner/rg-linear-gd00z-garage-door-opener.src/rg-linear-gd00z-garage-door-opener.groovy - GitHub is how people build software. With a community of more than 11 million people, developers can discover, use, and contribute to over 27 million projects using a powerful collaborative development workflow. (Their words not mine) Pretty much Github is a software depot where community members write code AND they share it for others to help write, improve etc.
In this case I’m using different device handler for the Z-wave Garage Door Controller built by @Ron who has (from my understanding) enhanced code from @garyd9 [Original code located here: https://github.com/garyd9/smartthings/blob/master/my_z-wave_garage_door_opener.groovy ]
What you want to do is get the “Raw” code so you can import, when you click on the “Raw” button it will take you to the raw code (plain text), from there Control-A (Select ALL text) and copy it to memory (Control-C / Command-C for you MAC users).
Remember that other tab you have going? It’s time to jump into that tab.
1st thing we need to do is create a new Device Handler, pretty much we’re going to load an enhanced driver for the Z-Wave Garage Door Controller, just like you needed to install a new driver for a printer etc.
Click on “My Device Type” then the green box that says “+ New Device Type”
Click on “From Code”
Next paste all the text you copied from Github then click “Create” at the bottom.
Hopefully there are no errors, if so go back to the Raw code and select all / copy then select all / delete / paste and click Create again.
If everything goes correctly you’ll be taken to this new page.
Note Be careful in here, placing unneeded text could cause errors and could break this driver / Device Handler.
Next up click Save at the top, then "Publish and click on “For Me”, as long as there’s no errors you’ll get a nice friendly green box at the top of the screen.
Once that is done go and confirm that you see the new Device you just created.
Now click on “My Devices” and click on your Garage Door Controller, in my case it’s called “Garage Door Opener”
Scroll down and click on “Edit”
On the next screen change the “Type” from “Z-Wave Garage Door Opener” to your newly created Device.
From:
Select - “RG Linear GD00Z Garage Door Opener”
Your Type should now read “RG Linear GD00Z Garage Door Opener”
Click Update at the bottom, it should update the screen and show a green box at the top.
Congrats! You’re using the updated driver, not there YET but you can see the finish line!!!
Final steps are to load the the SmartApp that will allow you be text / alerted to an open garage door and / or close it for you.
Update 9-25-2016
I’ve added a github with the current code I’m using. You can find the code here: https://github.com/trinitron79/SmartThings-Garage-Door/blob/master/smartapps/smartthings/automated-garage-door-open-close.src/automated-garage-door-open-close.groovy
You should also be able to add it as a repository as well.
Click on “My SmartApps”, “Settings”, “Add new repository”, from there you should be able to enter:
Owner: Trinitron79
Name: SmartThings-Garage-Door
Branch: Master
After clicking Save you should be able to select “Update from repo” then “SmartThings-Garage-Door (Master)”
From there you should be able to add a check box next to the “New”, then click “Execute Update”.
Once that is done you should see the app under My SmartApps and should be able to go into the app and click publish, For Me.
/Update 9-25-2016
Click on My SmartApps, then on the right side the green box that says “+ New SmartApp”, from there click on “From Template”, Change the “All Categories” to “Convenience” scroll down a towards the bottom and select “Ridiculously Automated Garage Door” then click “Create” on the bottom.
Once the create completes you’ll be placed into a screen that looked just like the driver screen we saw earlier.
At this point you can Save, Publish - For Me the new SmartApp.
Auto Close setup after this next section
To load the new SmartApp go into ST, Marketplace, SmartApps and scroll to the bottom and you’ll see “+ My Apps”
Note this is how Android currently looks
Select + My Apps and you should see your published Ridiculously Automated Garage Door.
Once you select the app it will ask you a set of questions as to which Sensor, Switch, time before warning and if you want a text. After you have everything entered press Done in the top right corner. I currently just use the 1st 4 options. Sense, Switch, Minutes and text message.
Pic shows how the default Door Sensor looks
Pic shows how it looks with a 3rd party sensor (Using a Ecolink Z-Wave Wireless Tilt Sensor)
BOOM! You’re done! Now go run outside and open your garage door then wait for a text and alert to let you know it’s open.
But I don’t want to know it’s open, I want to know it WAS open and now closed!!!
I hear ya! So did I!
WARNING The next part is VERY simple coding, you need to be careful as it could make your SmartApp NOT work if incorrect.
Head back to the developer site and go into My SmartApps and select your Ridiculously Automated Garage Door.
On the left hand side you’ll see #s, these are the line #s.
What you want to look for is the start for the Door Open Check - def doorOpenCheck()
From here you’ll notice { and } brackets. Think of these as blocks, you NEVER leave a block open. If you have a { you’ll have a } to close the block out. What we’re looking for the line of code that reads
"
else {
state.openDoorNotificationSent = false
}
"
Under this code press enter and place the following text, if you look at the next screen shot you’ll see there are 2 } AFTER the new code.
/### Code to close door if it’s left open./
closeDoor()
log.info “Closing {doorSwitch.displayName} because it has been open for {thresholdMinutes} minutes”
sendPush(“Closing {doorSwitch.displayName} because it has been open for {thresholdMinutes} minutes”)
def msg2 = “Closing {doorSwitch.displayName} because it has been open for {thresholdMinutes} minutes”
sendSms phone, msg2
/### End of Code to close door if it’s left open./
When it’s all said and done your whole “def doorOpenCheck()” should look like this.
NOTE I have done PowerShell coding before so some of this made sense, however I am VERY VERY VERY new to “Groovy” language so my code is VERY simple. It works, it makes ME happy, in the future as I learn I’d like to create a option that has Enabled or Disabled, so you can select if you want to door to shut or not. From there I’d like to write a CHECK that will send you a text / alert AFTER the door is confirmed closed. Future ideas, if I get it done I will update THIS thread, if someone else does it SWEET! Thanks you! and I’ll make sure to update this thread.
Ok so NOW you’ve updated the code, Save, Publish - For Me.
You’re about to cross the finish line!!!
Since you’ve made a change to the SmartApp go back into ST and update your new SmartApp under your Garage Door Opener “Thing”, if you haven’t loaded the SmartApp, follow the directions above. Once everything is loaded, run outside and open your garage door, hang out for a little bit and HOPEFULLY you’ll receive a text message (2 total) and Alert (2 Total) next up you hope that your GD00Z starts to Beep and flash, 5 seconds later your garage door should be shutting.
I have tested this with the ST app running, not running, normal button pushing to open etc. It constantly monitors your garage door, and if it’s left open it will shut it. If you have a light beam (most do) sensor at the bottom that stop the door, it will still continue to work, on the next door open check (I believe it runs once every minute) it will see the door is still open and try to shut it.
PLEASE PLEASE PLEASE Test , retest and TEST again before you trust it. I make ZERO guarantee this will work 100% time EVERYTIME. I’ve had VERY good luck with this code, driver combo.
If everything is working, crack a beer and show the wife / kids / neighbors and bask in the glory that is House Automation.
I hope this “guide” helps anyone getting into this, once again I have to say thanks to the ST Community and @Ron and @garyd9 for writing a FANTASTIC device handler that makes this SmartApp AWESOME!