Linear NGDZ00-4 Garage Door

I’m still curious in how you did this. Maybe I can figure it out on Hassbian. Just reluctant to try the steps in the really old threads in case the branches they reference are too out of date.

Thanks.

I was able to get this working again with the following modifications to the script:

#!/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(c) 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/homeassistant_venv/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
cd openzwave

echo "Changing to openzwave Dev branch to add barrier_operator support"
git checkout Dev
cd ..

echo "Building python-openzwave with barrier_operator support\nStage 1..."
make build
make install

# Remove the 1.4 non-dev branched compile and replace with the 1.5 dev branch compiled version
rm -Rf openzwave-git/open-zwave-master/
cp -R openzwave/ openzwave-git/
mv openzwave-git/openzwave/ openzwave-git/open-zwave-master/
echo "Building stage 2..."
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
```

Modifications to __init__.py need to be done in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave

I made mine like this:
```
#REQUIREMENTS = ['pydispatcher==2.0.5', 'python_openzwave==0.4.0.31']
REQUIREMENTS = ['pydispatcher==2.0.5']
```

Make sure to clear `/home/homeassistant/.homeassistant/deps/` or just nuke the python_openzwave in there, either works.
1 Like

Thanks. Going to give it a shot.

I am able to see the proper cover in HA now but openzwave changed the way it handles the door status:

                    <CommandClass id="102" name="COMMAND_CLASS_BARRIER_OPERATOR" version="1" issecured="true">
                            <Instance index="1" />
                            <Value type="list" genre="user" instance="1" index="1" label="Barrier State Label" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" vindex="0" size="$
                                    <Item label="Closed" value="0" />
                                    <Item label="Closing" value="1" />
                                    <Item label="Stopped" value="2" />
                                    <Item label="Opening" value="3" />
                                    <Item label="Opened" value="4" />
                                    <Item label="Unknown" value="5" />
                            </Value>

This causes it not to work in HA and this is as far as I’ve be able to get so far.

Out of curiosity, since 0.46 and above are using their own OpenZwave files, is it possible to just replace a few config files to make this work?

I’m not sure, I used information from this thread as well:

I actually just updated/added the files (4 in total) following Josh’s post and compiled/installed OZW again. I’m still haven’t issues with HA not showing the cover control, but everything is working like it should under OZWCP.

Does your OZW_Log.txt say Openzwave 1.4xxxxxxxxxx or 1.5xxxxxx ?

It says 1.4xxxxxxxxxxx, but I only patched the files to the AIO release, I don’t assumed the version number would change.

1.5 is the Dev version that has Barrier support.

So is it possible to install the 1.5 dev version to get this working without a bunch of patches?

No it is not

I’ve got my NGDZ00-4 working now with the dev version of openzwave lib now. For anyone interested here’s the modified zwave.py file to allow it to work once you’ve compiled the dev version.

https://raw.githubusercontent.com/firstof9/home-assistant/dev/homeassistant/components/cover/zwave.py

Place it in your /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/cover/ directory.

@firstof9 I am assuming you have to add it securely for it to work, right?

Correct, you can do that from Home Assistant’s Zwave menu.

This works and currently only reports the door as “Opened” or “Closed”, I haven’t gotten around to modifying the code to show the fulls statuses reported by the library such as “Opening” and “Closing”.

1 Like

Can you tell me how to compile the dev version? I have only ever used the AIO installer and the Hassbian script when I moved over to it.

Thanks.

@gregg098

The easiest way is probably to run a pre-built docker with Openzwave patched already. Take a look at the post from Colin O Dell here: https://www.colinodell.com/blog/201705/compiling-openzwave-home-assistant-045-docker.

In a nutshell, install docker on your linux system. Copy your configuration.yaml, automation.yaml, etc to your /home/homeassistant/.homeassistant directory and then run the below:’

docker run -d --name=“home-assistant” -v /home/homeassistant/.homeassistant:/config --restart=always -itd --privileged --device /dev/ttyACM0 -v /etc/localtime:/etc/localtime:ro --net=host colinodell/home-assistant-with-barrier

I posted a script a few posts above:

Should do the trick.

1 Like

Still no luck here. Had to change a few things to make it work with my Hassbian install, but no go.

What is your OZW_Log.txt showing on the first line?

And you made the modifications to the init.py file in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave and cleared the /home/homeassistant/.homeassistant/deps/ directory as well?