[OBSOLETE] Enhanced Z-wave garage door opener code (for Linear GD00Z and variants)

I just installed my Linear GD00Z-4 garage door opener. The ST hub found and installed it, but as others noted it only acted as a open/close switch thru my phone. It didn’t integrate the tilt sensor with the switch to allow for apps to use it properly. I used Gary D’s script and it solved the problem. Great job on that script!

Thanks,
Chris

I’m new to ST but I’m using the Linear Garage Door controller as well (from my Nexia system). I used the script and I think everything is working properly, though opening and closing the door still seems hit or miss sometimes.

Right now the door is still showing in Things - not Doors. Is there a way to change that? Or did I mess something up?

Much appreciated.

[quote=“adamzeis, post:22, topic:9389”]
Right now the door is still showing in Things - not Doors.
[/quote]It will always show up in “things.” Every single device should show up there regardless of where else it might also appear.

To have it show up in “doors & locks”… go into “doors and locks” and tap the gear icon on the top. “add a door”, give it a name, change the door type to “garage door”, and tap “next.” Select “edit door name and devices”, and ensure that the new garage door thing is selected for BOTH the “open/close sensor”, AND the “garage door controller.” Tap “DONE” for the screen on changing the name/devices. Select “know if its open or closed”. Set any options you might want, and tap DONE a few times.

At this point, it seems to take a while before the thing shows up in “doors and locks.” I have no idea why. I’ve found that after opening and closing it a couple times that it shows up, but others (read this thread) have had to wait a bit.

Awesome. Many thanks for that!

GARY D, I just wanted to say, “Bravo!” I’ve only been “live” with SmartThings for two days now and am extremely pleased with my lighting automation (I installed several GE in-wall dimmers and toggles). However, I was more than a little annoyed that the Linear GD00Z-4 was not yet fully supported. I really wanted to set up presence detection open/close and now I can thanks to your code. After a little trial and error on my part, I can report that it works brilliantly!

1 Like

I’ve submitted this to ST to hopefully replace the existing “z-wave garage door opener” device type that’s built in.

4 Likes

Replying to a message from @TobinKrueger in a different thread…

Okay, I looked over that log and at least the GD00Z device thinks that something is amiss. Do you have more than one of these devices? If so, does another one show the same oddities?

This isn’t a device type issue - the device type appears to be reacting properly to the messages that the device is sending it (I’d PREFER if it was a device type issue, as I can fix that with code.)

So, the next step is the hardware. IF you are sure that your power is stable, then my Best Guess would be that something in the GD00Z hardware is having an issue. (Could be the brick, the main unit, or the tilt sensor. The z-wave messages lead me to believe that its NOT the tilt sensor.)

How long has this unit been installed? Can you exchange it for another unit?

Hi Gary. Sorry for the delay in responding to this. I just installed the unit. But what I found out is that if I give it a minute or so between the time I open and close the door everything works fine. When I installed it and I was testing it, I would open the door and then close the door right away. Then I would open it again right away and close it again right away. This is when things got out of synch. I realize this isn’t normal use, but since I was testing it, that it what I was doing. There seams to be a race condition or something like that. If I open the door, wait a minute and close the door, wait a minute and open the door etc… it works just fine. This is more of a real life use case.

I looked at your code and saw the delay in there. Not sure if that has anything to do with it. It has been a while since I wrote code. ( I must say, your code is pretty awesome. Great structure, great use of functions, modular. Really nice!
its better than text book!)

Thanks for all of your help. It is much appreciated!

private secureSequence(commands, delay=200) {
delayBetween(commands.collect{ secure(it) }, delay)
}

I have experienced the issue also. In fact when I remotely open/close the door and can’t watch it I make sure I wait a few min before sending another open/close command. If not it gets into this unknown state. I am not sure the issue is with the device code. I suspect the unit itself gets confused when the tilt sensor sends commands.

Looking at the code I don’t see secureSequence being used anywhere. It is defined but never called. So the delay may not be the issue.

The weakness of this unit is the door sensor. I wish they made one with a better battery that could be polled instead of making a sensor that only sends an event when the door state changes. I can tell you however that once you stop playing with it and use it normally you don’t have issues. Do do have to be careful about not deciding to switch from open/code too quickly as you have found.

The power outage issue is also known, I have mentioned before that I fixed this by putting a $40 UPS on my GD00Z so it never loses power.

I don’t have the code in front of me. The “200” as a delay between commands is probably 200 milliseconds. That’s 0.2 seconds.

If you send multiple commands from zwave (from the hub, from your phone, etc) to the device, one after the other, it will result in an “ApplicationBusy” message internally. That can be seen around line 275-280 in the device type code. If you’d like to see that in your activity stream, change line 279 from:

createEvent(displayed: true, descriptionText: "$device.displayName is busy, $msg")

to this:

createEvent(isStateChange: true, displayed: true, descriptionText: "$device.displayName is busy, $msg")

(You’re just adding the “isStatechange: true” to the map)

Or, are you referring to the device getting out of whack when hitting the physical garage door opener button (not related to the GD00Z, ST, etc)?

Is it typical for 5 minute delay before seeing a change in open/closed state? Whether I open the door via ST or the existing button the open/closed status isn’t updated unless I force a refresh in the things page, or wait >5 minutes.

Ideally I’d like it to be instant, or fast enough to update while pulling a car in and closing the door immediately.

Using the linear tilt sensor included with a GD00z-4.

No, it’s not typical. Are you using ONLY the tilt sensor, or are you using the entire GD00Z kit?

If you go to the IDE and watch the “live logging”, you should see the updates from the GD00Z device as they come in. While I have seen cases where it takes several minutes for ST to notice that the door is open or closed, that is NOT typical.

I have the same problem. I noticed, however, that if you look at the brief summary page (don’t know what it’s called) it may not display the correct state of the garage door; but if you hit “preferences” the application DOES know the correct state of the door. It somehow does not make it to the summary page. Additionally, if you are in the “in between” state where you have just given the command to “open” or “close” you cannot do it from the circle. You have to the OPEN and CLOSE commands on the side and that usually works even if the correct state is not displayed.

Yes, using the full kit. I’ll try to debug this weekend and watch the live logging page. Everything else seems to be working fine, just takes quite a while to update open/closed if I don’t force refresh it.

You may have already figured this out, but Linear won’t process controller requests that are less than 30 seconds apart to prevent physically bouncing the door.

And if you send too many, it will lock you out until you do one full cycle using the manual controls.

See section 9 in the installation guide:

http://www.linearcorp.com/pdf/manuals/GD00Z_Install.pdf

2 Likes

I read this differently. It says it will lock if the door fails to open twice. My understanding of that wording is if the door is blocked or fails for some reason when the unit tried to open it, it will allow you to try again.

The 30 second bullet says once a command is received, commands will be ignored for 30 seconds. This does explain why we see strange behavior when we try to use open/close too quickly but iI don’t think it will lock out if you send several commands. And I have never had my device lock out.

1 Like

Oh btw, I completely removed both the device and the device type from smartthings and re-added everything: works great now. Thanks.

Apologies for a new-b question but after succesfully adding the linear controller with the new device type, it shows up under ‘things’ as it did previously. However, I cannot find a way to get the ‘doors & locks’ category to show on my home screen. I do not have any smart locks and I tried making a ‘test lock’ from the ide’s device list screen. Any help would be appreciated. Thank you again for the script

Does this help?

Thank you that is a neat feature I was unaware of. When I go to the locks section under action and then choose ‘add a connected lock to an existing or new door…’ and i choose a garage door and then go to select a device the linear controller does not show up. If I understood the script correctly (i’m no groovy dev) this is supposed to allow the bypass of the sometimes finicky tilt sensor that is included with the main linear controller and essentially make it a switch so that it will open / close as if you were using a normal garage door button opener. If I am incorrect please let me know. Thanks again for your help.