Linear NGDZ00-4 Garage Door

WHEW ok it DOES indeed work once I build the libraries correctly. python-openzwave I think was where things may have gone awry and, in fact, the Makefile re-checks out and rebuilds the open-zwave library (which blew away my patches). Once I re-sorted all that out and went into OZWCP to re-read the Linear oepner, then saved the config and fired up HAAS, there it was!

The opener is not currently installed properly so I’ll take care of that tomorrow and try to make it actually open/close the garage door (it’s sitting in my laundry room right now) and report back. If it works, here’s hoping OZW folks apply the patch to mainline because building it correctly is indeed a bit of a bear.

2 Likes

This is great work! Thanks for sharing.

So I properly installed the Linear. I look some pics if anyone wants to see that but since installation of the device itself wasn’t the focus, I thought I would instead share the Home Assistant bits I used to get it all working:

groups.yaml:
misc:
name: Misc Switches
entities:
- switch.front_porch_light_switch_27
- switch.laundry_light_switch_13
- cover.garage_door_opener_open_20

automation.yaml:
- alias: “Slack Garage Door Open”
trigger:
platform: state
entity_id: cover.garage_door_opener_open_20
# from: ‘closed’
# to: ‘open’
state: ‘open’
for:
minutes: 1
action:
service: notify.slack
data:
message: “Looks like you left the garage door open again, human.”

Not much more to it really. Took me a while to figure out how to get the state of the opener (still not sure what most of the sensors on the thing do, but for opening and closing the garage door, it seems to do the trick.

I haven’t yet setup automation for it yet. Still trying to figure out the best way to do that, since I don’t think I want a permanent state to track (e.g. whether I am home or not) but would rather just want to execute a scene. Only trouble with that is it looks like scenes don’t work with delay (or I couldn’t find any examples there). I want to say have a “I’m home” sort of scene/automation which opens the garage door, turns on my garage entry light for say 10 minutes and then turns it off (and, optionally, if it’s dark, turn on some other lights around the house). But that’s beyond this I suppose.

Point is, it does indeed work! Now I just have to remember not to touch any of the OZW and OZWCP code until all this gets hopefully in mainlines of those projects.

Just to add to the above (sorry kinda doing lots of additional posts), here is the script I’m using to open the garage door and do things like turn lights on:

scripts.yaml:
return_home:
sequence:
- service: cover.open_cover
data:
entity_id: cover.garage_door_opener_open_20
- alias: Turn On Laundry Light
service: switch.turn_on
data:
entity_id: switch.laundry_light_switch_13
- alias: Wait to come inside
delay:
minutes: 5
- alias: Turn Off Laundry Light
service: switch.turn_off
data:
entity_id: switch.laundry_light_switch_13

Being able to control the garage door via scripts required switching to the development version of HA but otherwise it seems to work like a champ! I don’t have my configuration files setup in a way that can be shared just yet but I hope to do that at some point so I have a more complete example folks can work from.

I just fired up my HA machine today after letting it lie dormant for a couple of months. I was on .26 and after an upgrade to 0.29.6, my previous config worked and I have the new “cover”. I am now able to open/close the garage with the Linear. The only wonky part is that the up arrow seems to both open and close it, and the status icon is not super intuitively clear about whether it’s actually opened or closed, but it does change at least. I’m sure some tinkering with the config this week will sort things out, but I wanted to report that the linear garage door opener DOES work in HA. Yay! Great work guys.

I added the Linear Garage door controller to my HA and I see 4-5 new sensors. I am not seeing any cover component. Do I need to do anything else?

Dim the lights and settle in for a long read of this thread because the answers are sort of strewn about here but you can make it work. Check josh’s post from Jul 26th up above and also be sure to properly compile python-openzwave. The stable version of HA supports opening/closing the garage door but you need to be on the dev version to be able to use it in scripts. My last few comments over the last few days may help as well.

You know it’s working when you see something like cover.garage_door_opener_open_## when you go to the States list in the GUI. If you’re just seeing sensors, then barrier mode isn’t working in HA.

m00dawg, thanks for sharing your work. Honestly, I’m a complete noob at Linux, HA, GIT, and OZW (basically everything). I think I’m stuck where you were…I’ve got OZWCP able to see the Linear and can use the Open toggle there but no switch in HA. I have no clue how to properly rebuild the OZW library in my virtualenv, I couldn’t figure out how to apply the patch so modified the 2 files manually and created other 2 files. Obviously this didn’t work since I’m not able to see it in HA.

I tried to apply patch by using curl and copying the patch to /tmp/z.patch, but this is what I get when I try to apply it.

Any help would greatly be appreciated!

What version of Home Asst are you running?

Are you able to run open z-wave control panel, and use it to open/close the door?

Thanks for the reply @josh. I’ve just upgraded to the latest build and yes, I am able to open/close in OZWCP (Thank you so much for your instructions). Ok, so I think I messed up by installing HA and Python OZW in a virtual using a service account and then installing OZW and OZWCP with my user account. I think I might have patched Python OZW but can’t get it to recognize the Linear as being added securely even though I can open/close with OZWCP. I’m making sure I’m not running HA and OZWCP at the same time, but after the update that’s been tough as it no longer stops/restarts in a timely manner.

Any suggestions as how to unscrew-up my mess would be most helpful.

This is what I’m seeing in the OZW_Log.txt from HA.

2016-10-03 22:53:27.112 Info, mgr, Driver with Home ID of 0xdb49adb8 is now ready.
2016-10-03 22:53:27.112 Info,
2016-10-03 22:53:27.113 Info, Node002, AddCommandClass - Unsupported Command Class 0x66
2016-10-03 22:53:27.113 Info, contrlr, Received reply to FUNC_ID_SERIAL_API_GET_INIT_DATA:

No longer getting messages that the node wasn’t securely added or the likes. Am I running the ‘wrong’ version of HA? I did the update this morning, perhaps I need to be on a dev build that I’m not aware of? From reading m00dawg’s comment, it appears the “barrier mode isn’t working in HA”. If anyone can point me in the right direction (I probably missed the clues that are already there) I would be very grateful.

Woohoo! Finally got it working :smile:

Big Thanks to @josh and @m00dawg for sharing their knowledge! It definitely works and the info was there…just needed to figure out the actual steps (I’m guessing mostly bc I’m new to the whole non-Windows environment.

1 Like

Heya that’s great! Yeah figuring out how to make this easier is something that needs to be done. I’m about to go on vacation but I want to put together better documentation, even if to preserve my own sanity :slight_smile: But beyond that, curious why the OZW folks aren’t pushing in the changes. I have a similar problem with the ‘radiotherm’ library. Not HA’s fault but it definitely impacts the project I think.

1 Like

I wanted to better document the process too as I know I’m going to forget most of this by next week. Also it’ll be great to share so others aren’t struggling as well. Not sure if I’d get it right though since I had started from a bad place already (installing HA and python-ozw in virtualenv as service account and then accidentally ozw and ozwcp as user account and outside of the virtual).

Did either of you use the AIO installer for the Raspberry Pi?

Thanks again to @josh and @m00dawg as their info was invaluable. Same goes to AndrewL.

For those still struggling with the Linear GCZ004 and getting OZW to work with it, I’ll share how I finally got mine to work. Keep in mind that I’m a noob and have no clue what I’m talking about and whatever I say may in fact break your machine.

Since you’re still reading this, it’s safe to assume HA is not seeing your Linear as cover element. The key point is that even though you can open your garage door via OZWCP it does not necessarily mean OZW is set up properly so that HA can see it. m00dawg’s comment on this was quite helpful to me as it led me on the correct path.

So if you’ve read my previous posts, I pretty much screwed up the installs for OZW and OZWCP. It was a combination of being new to Linux and trying to follow directions randomly around the interwebs. Keep in mind, this worked for my set up, which is installing HA to virtualenv as detailed here. (I’m starting here bc I assume most people
have already installed OZW)

So now you’ve got a service account (hass), HA, and Python-OZW installed on virtualenv. Next is the install of OZWCP. So my f#ck up is following the instructions on this site without considering that what I did previously. Don’t make the same mistake I did. Here’s a modified version of what you should run if you went the virtualenv route like I did. First, open a 2nd terminal window (you’ll want the previous one where you’ve activated the virtualenv and as hass). In the 2nd terminal window:

Download, build and install libmicrohttpd (this part should still be fine, I never had to redo this part)

cd

wget ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.19.tar.gz

tar zxvf libmicrohttpd-0.9.19.tar.gz

mv libmicrohttpd-0.9.19 libmicrohttpd

cd libmicrohttpd

./configure

make

make install

Now switch back to the 1st terminal window where you command line starts with (hass)$…

If you left off at the end of the building the virtualenv and installing Python-OZW, you should be in /srv/hass/src/python-openzwave. Go back up a level to /srv/hass/src

Download open-zwave-control-panel

cd

git clone GitHub - OpenZWave/open-zwave-control-panel: UNMAINTAINED - We are looking for someone to maintain ozwcp! The OpenZWave Control Panel (ozwcp for short) is an application built on the OpenZWave library that permits users to query, manage and monitor Z-Wave nodes and networks. It provides a web based user interface using AJAX principles.

cd open-zwave-control-panel

Now a tweak to modifying the Make file.

Open the Makefile and find the following lines:

OPENZWAVE := …/

LIBMICROHTTPD := -lmicrohttpd

Change it to:

OPENZWAVE := /srv/hass/src/python-openzwave/openzwave

LIBMICROHTTPD := /usr/local/lib/libmicrohttpd.a

We also need to uncomment the Linux lines and comment out the Mac lines in the Make file as follows since it is setup by default for Mac:

# for Linux uncomment out next three lines
LIBZWAVE := $(wildcard $(OPENZWAVE)/*.a)
LIBUSB := -ludev
LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB) -lresolv' 

# for Mac OS X comment out above 2 lines and uncomment next 5 lines
#ARCH := -arch i386 -arch x86_64
#CFLAGS += $(ARCH)
#LIBZWAVE := $(wildcard $(OPENZWAVE)/cpp/lib/mac/*.a)
#LIBUSB := -framework IOKit -framework CoreFoundation
#LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) -pthread $(LIBUSB) $(ARCH) -lresolv`

At this point you should I’m going to PAUSE on building OZWCP bc we need to patch them per @Josh’s post from July 27th (please scroll up for his post and follow links for patching). If you’re Linux savvy this part is a breeze for you. If you’re like me, I had no clue how to patch the files. I believe I got the patch for OZWCP to work using curl and I kept getting errors for OZW and also didn’t know how to patch Python-OZW via that link. So from the Github pages modified the files manually, which was not too bad since OZW was modifying 2 files and creating 2 new files. OZWCP was just modifying the 1 file. For the OZW patch, since I had Python-OZW the file locations were from here /srv/hass/src/python-openzwave/openzwave/ on down. File path for OZWCP is /srv/hass/src/open-zwave-control-panel/

Now that the files are set, we go back to the terminal window with our virtualenv activated

cd -

cd python-openzwave

PYTHON_EXEC=`which python3` make uninstall

PYTHON_EXEC=`which python3` make build

PYTHON_EXEC=`which python3` make install

Ok, I’m not sure if it was all necessary but that’s how I finally got it to work…so don’t judge me! Next we’ll go back to building OZWCP that we never finished.

cd –

cd open-zwave-control-panel

make

Now if you want to do the symlink, then you’ll want to change the path as follows:

ln -sd /srv/hass/src/python-openzwave/openzwave/config

At this point, reread your node or remove/re-add in OZWCP, and save your xml’s. Then copy them to your .homeassistant folder and cross your fingers.

1 Like

I did not as I’m not using a Rasberry Pi…thought it probably would have been easier.

I also am not using an rPi (for HA anyway). I run it in an LXC container on my custom Linux NAS and installed it via the virtualenv method.

Thanks guys. I might try a parallel Pi with a manual install to get this working. I really don’t want to mess with what is working now so I might also wait until OZW is updated. There are indications that the patch has been applied in the dev branch.

Hey everyone,
Just started with HA. New to linux and python, too. So please have patience with my noob questions :slight_smile:

My HA is version 0.30.2 using the all-in-one installer for the Raspberry Pi 3.

Here’s what Open Zwave control panel sees:

and here’s what the HA dev-info page sees:

So i think i’m stuck at what @m00dawg said earlier:

How can I convert from sensor to cover? How can I make sure that the barrier mode is working on HA??

Thank you all!