Linear NGDZ00-4 Garage Door

@hawk259 – you have the following, correct?

cover:
platform: zwave

Other than that, there’s nothing in my config… just put that entity in a group, and it should show up as a cover that can be opened/closed. See attached pics for everything I have.
On the hass page:

In the config:

On my page:

@josh – Yes, I have that in my config. I have everything working now, BIG THANK YOU!

I just got confused when it showed up as linear_unknown_type, because scrolling through the thread there were a few that show up with garage door in the name. I easily fixed that the with a friendly_name change and it is all good.

@josh sorry for being off topic, but how did you get that dark theme?

1 Like

I updated my patch for building a docker container based on 0.38.3:

http://www.brianfrance.com/software/home-assistant/barrier-0.38.3.diff

@hawk259
Just trying to work through this as well. For the OZWCP portion, do you happen to have a diff and base repo that you were working off of for that?

Thanks for taking the effort to put up the patches. It’s definitely a big boost getting started.

If any newcomers are using the hassbian image for raspberry pi, I’ve made changes to the install_openzwave.sh script which will apply the garage door opener (barrier_operator) additions to openzwave and openzwave-control-panel automatically before building and installing them. This should make things really simple for absolute beginners.

Here are instructions for those starting off from scratch:

  1. Download the hassbian image and follow the instructions, then verify that you can successfully browse to http://hassbian.local:8123 as mentioned.

  2. ssh into your Raspberry Pi and replace the existing install_openzwave.sh script. To make that modification, edit the existing script with nano:

    nano hassbian-scripts/install_openzwave.sh
    then replace its contents by holding down CTRL+K to remove everything, then pasting in the new script below (usually by right clicking, if using putty or Windows 10’s bash):

    #!/bin/bash

    echo
    echo “Open Z-Wave Installer for Hassbian”
    echo “Modified by Landrash for use with Hassbian.”
    echo “Remodified by unt1tled for use with Linear NGDZ00-4 (barrier_operator).”
    echo “Copyright© 2016 Dale Higgs https://gitter.im/dale3h
    echo

    if [ “$(id -u)” != “0” ]; then
    echo “This script must be run with sudo. Use “sudo ${0} ${*}”” 1>&2
    exit 1
    fi

    echo “Running apt-get preparation”
    apt-get update
    apt-get upgrade -y
    apt-get install -y make python3-dev libudev-dev python3-sphinx python3-setuptools libgnutlsxx28 libgnutls28-dev libssl-dev

    echo “Changing to homeassistant user”
    sudo -u homeassistant -H /bin/bash <<EOF

    echo “Activating virtualenv”
    source /srv/homeassistant/bin/activate

    echo “Installing latest version of cython”

    Currently locked to this version since build fails for later versions.

    pip3 install --upgrade cython==0.24.1

    echo “Creating source directory”
    mkdir -p /srv/homeassistant/src
    chown -R homeassistant:homeassistant /srv/homeassistant/src

    echo “Cloning python-openzwave”
    cd /srv/homeassistant/src
    git clone https://github.com/OpenZWave/python-openzwave.git
    chown homeassistant:homeassistant python-openzwave
    cd python-openzwave

    echo “Cloning openzwave”
    git checkout python3
    rm -rf openzwave
    git clone git://github.com/OpenZWave/open-zwave.git openzwave

    echo “Replacing openzwave source files to add barrier_operator support”
    wget -O openzwave/config/device_classes.xml https://raw.githubusercontent.com/OpenZWave/open-zwave/c808b7431fb6c28b408e7fdc5492e46420cb6926/config/device_classes.xml
    wget -O openzwave/cpp/src/command_classes/BarrierOperator.cpp https://raw.githubusercontent.com/OpenZWave/open-zwave/c808b7431fb6c28b408e7fdc5492e46420cb6926/cpp/src/command_classes/BarrierOperator.cpp
    wget -O openzwave/cpp/src/command_classes/BarrierOperator.h https://raw.githubusercontent.com/OpenZWave/open-zwave/c808b7431fb6c28b408e7fdc5492e46420cb6926/cpp/src/command_classes/BarrierOperator.h
    wget -O openzwave/cpp/src/command_classes/CommandClasses.cpp https://raw.githubusercontent.com/OpenZWave/open-zwave/c808b7431fb6c28b408e7fdc5492e46420cb6926/cpp/src/command_classes/CommandClasses.cpp

    echo “Building python-openzwave with barrier_operator support”
    make build
    make install

    echo “Deactivating virtualenv”
    deactivate
    EOF

    echo “Creating libmicrohttpd directory”
    cd /srv/homeassistant/src
    mkdir libmicrohttpd
    chown homeassistant:homeassistant libmicrohttpd
    cd /srv/homeassistant/src/libmicrohttpd

    echo “Downloading libmicrohttpd-0.9.19”
    wget ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.19.tar.gz
    chown homeassistant:homeassistant libmicrohttpd-0.9.19.tar.gz
    tar zxvf libmicrohttpd-0.9.19.tar.gz
    chown homeassistant:homeassistant libmicrohttpd-0.9.19

    echo “Building libmicrohttpd-0.9.19”
    cd libmicrohttpd-0.9.19
    ./configure
    make
    make install

    echo “Cloning open-zwave-control-panel”
    cd /srv/homeassistant/src
    git clone https://github.com/OpenZWave/open-zwave-control-panel.git
    chown -R homeassistant:homeassistant open-zwave-control-panel
    cd open-zwave-control-panel

    echo “Replacing open-zwave-control-panel source files with barrier_operator support”
    wget -O zwavelib.cpp https://raw.githubusercontent.com/legrego/open-zwave-control-panel/0925251a566a36543e0c6b5cb0b2c1498bddfa68/zwavelib.cpp

    echo “Building open-zwave-control-panel”
    rm Makefile
    wget https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/Makefile
    chown homeassistant:homeassistant Makefile
    make

    echo “Linking ozwcp config directory”
    ln -sd /srv/homeassistant/lib/python3./site-packages/libopenzwave-0.-linux*.egg/config
    chown -R homeassistant:homeassistant /srv/homeassistant/src

    echo “Linking Home Assistant OpenZWave config directory”
    cd /home/homeassistant/.homeassistant
    sudo -u homeassistant ln -sd /srv/homeassistant/lib/python3./site-packages/libopenzwave--linux*.egg/config
    chown -R homeassistant:homeassistant /home/homeassistant/.homeassistant

    echo
    echo “Installation done!”
    echo
    echo “If you have issues with this script, please contact @Landrash on gitter.im”
    echo “Original script by @dale3h on gitter.im”
    echo

Overwrite the existing file by hitting CTRL+X, then Y to save changes.

3. Now run the new script with this command:

sudo ./hassbian-scripts/install_openzwave.sh

and wait (and wait) for it to complete.

4. If your NGDZ00-4 is already paired, then you’ll need to re-add your security key to your options.xml. Or if this is your first time pairing it, you’ll need to generate a new security key.

Either way, follow the instructions here and modify your options.xml by entering:

 nano /srv/homeassistant/lib/python3.4/site-packages/libopenzwave-0.3.2-py3.4-linux-armv7l.egg/config/options.xml 

(note to people in the future: the version numbers in this path may have changed)

5. Also, you’ll need add the zwave and cover platforms to your configuration.xml:

Edit the configuration.xml by entering
nano /home/homeassistant/.homeassistant/configuration.yaml

Then append the following on the bottom:

zwave:
  usb_path: /dev/ttyACM0
  config_path: /srv/homeassistant/lib/python3.4/site-packages/libopenzwave-0.3.2-py3.4-linux-armv7l.egg/config/

cover:
  platform: zwave

6. Reboot the pi by entering sudo reboot and then, if required, securely add your NGDZ00-4 device with zwave.add_node_secure. If done correctly, you’ll have your shiny new automated garage door opener working under a “cover” device like this:

From here, refer to the documentation on customizing the name, etc.

Cheers!

3 Likes

Would you be willing to write a step by step guide just like this for those of us with existing installations? I have had to keep my wink hub up solely for my linear garage door opener because I was unable to get it to work with OpenZWave Controlpanel.

I used the all-in-one installer and would likewise be interested in any guidance on how to patch the existing open-zwave install that was part of the AIO install…

1 Like

I would also really appreciate someone doing a guide for this. I can see the device in OZCP but cant control it from there and I can also see it in HA AIO install.

would be interested in a step by step guide for existing installations as well

I got bored and grabbed another SD card to start over and give the steps described and I’m stuck on #4, I cannot locate my options.xml nor do I know how to generate or re-add my security key (my NGDZ00-4 is already paired to the stick)

Any insight anyone can offer me?

Sorry for the confusion. I meant that you follow the steps under ADDING SECURITY DEVICES from the provided link to add or update your security key.

From the link above:

ADDING SECURITY DEVICES

Security Z-Wave devices require a network key before being added to the network using the zwave.add_node_secure service. You must edit the options.xml file, located in your python-openzwave config_path to use a network key before adding these devices.

Edit your options.xml file:

<!-- <Option name="NetworkKey" value="0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F 0x10" /> -->

Uncomment the line:
<Option name="NetworkKey" value="0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10" />

You can replace these values with your own 16 byte network key. For more information on this process see the OpenZwave wiki article Adding Security Devices to OZW

An easy script to generate a random key:

cat /dev/urandom | tr -dc ‘0-9A-F’ | fold -w 32 | head -n 1 | sed -e ‘s/(…)/0x\1, /g’

And the way to edit options.xml is with the nano command I provided:

nano /srv/homeassistant/lib/python3.4/site-packages/libopenzwave-0.3.2-py3.4-linux-armv7l.egg/config/options.xml

As you can see, it includes the path of the options.xml as the parameter.

The two problems I’m having in following the steps is that 1) inside the /srv/homeassistant/lib/python3.4/site-packages/ there is not the “libopenzwave-0.3.2-py3.4-linux-armv7l.egg” showing up at all. I’m wondering if I’m missing some of these steps that needs to be done first before moving on to your step 2 (replacing existing script)?

INSTALLATION

To allow Home Assistant to talk to your Z-Wave USB stick you will have to compile the OpenZWave library and install the related python-OpenZWave package. This can be done as follows. (Note: The Home Assistant docker image and the All In One installer have support for Z-Wave already built-in!)

Make sure you have the correct dependencies installed before running the script:

$ sudo apt-get install cython3 libudev-dev python3-sphinx python3-setuptools git
Make sure you have at least version 0.23 and at the most 0.24.1 of cython.

$ sudo pip3 install --upgrade cython==0.24.1
Then get the OpenZWave files and switch to the python3 branch:

Do not use root to build python-openzwave as it will surely fail.

$ git clone https://github.com/OpenZWave/python-openzwave.git
$ cd python-openzwave
$ git checkout python3
$ PYTHON_EXEC=$(which python3) make build
$ sudo PYTHON_EXEC=$(which python3) make install
Instead of make install, you can alternatively build your own python-openzwave package which can be easily uninstalled:

$ sudo apt-get install -y checkinstall
$ sudo PYTHON_EXEC=$(which python3) checkinstall --pkgname python-openzwave --pkgversion 1.0 --provides python-openzwave
With this installation, your config_path needed below will resemble:

/usr/local/lib/python3.4/dist-packages/libopenzwave-0.3.0b8-py3.4-linux-x86_64.egg/config
If you followed along with setting up a virtual environment, your path will be:

/srv/homeassistant/python-openzwave/openzwave/config

  1. Forgive me, I’m still a little bit new, but where do I find my security key so I can re-add it?
  1. The replacement script, install_openzwave.sh from step 2/3 will download, patch, and install the libopenzwave-0.3.2-py3.4-linux-armv7l.egg package once it successfully executes. Then the options.xml file will be in the location mentioned.

  2. The security key is a randomized set of numbers that you can generate if you’re setting it up for the first time. If you’ve set it up before, you would have had to have a backup of it (an older options.xml, for example).

If you’re following the steps correctly, it could be that the script is failing to execute. I can double check later today on a new sd card to verify that it works.

I’m pretty sure I did everything correctly the first time, I’m probably too much of a newbie to be able to figure out what went wrong. I’ll wait to see what comes of this for existing installs and go back to my other SD card for now. Thanks for the prompt replies though!

Hi
I am 2 week old with hass, just setup a light and thermostat, and just paired my gocontrol/linear garage door opener to my aeon z-stick, but i dont see this opener in my hass screen.

did you say my all-in-one-script (virtualenv) on raspberry has everything that it should show my linear? or do i have to follow the instruction to setup?

please help thanks

@balajeek The OpenZwave files need to be patched before building. The All in One installer does not apply the necessary patch for the Linear Garage door as it is being built. The AIO installed version is not necessarily an easy version to apply the patch and build OZW separately.There is a modified script to install the patch version to the Hasbian version at message 115 which means you would need to start over. As much as it will be a pain, I would suggest reading through the whole thread.

If i start all over and get the garage door sensor working does future Home Assistant update would break in any way. I really had spent a lot of my time setting up the Home Assistant using All-in One installer with following, first dimmer switch, theromostat and SSL and MQTT with OwnTracks and now working on TLS for MQTT.

Would this be fixed in future Home Assistant updates so i can wait. If not then i have no option and i have to start all over again (if the garage door is going to work for sure)

Thanks.

There are no guarantees that a future update wouldn’t break something. One would hope that the changes would eventually make it to an update, but it has been quite some time if you go back to earlier posts in this thread.
While I suggested that you should start over, it doesn’t mean your current configuration can’t survive. You can simply move your configuration back to the proper location on the new install. I can’t speak for every zwave stick, but most if not all retain the devices they have been paired with. If you install to a new SD card and copy your configuration to the folder it may not take much to get things up and going reasonably quickly. You would still have the old install that you can swap back in if things didn’t go well.

thats a good idea to backup the config and to try it on different SD card. I will try that
So i have to install the hassbian image for raspberry pi 2 and follow the instructions by “untitled” posted 15d ago to get this working?

I beleive i will have to install MQTT server (becaz All-inOne script already have built it)

Thanks.