Installer for QNAP QTS series

zware support not depends on my package. My package is simply an automatic installer for QTS OS.

New release 1.0.3 is out:
Removed deprecates Optware dependency!!

1 Like

Amazing contribution, where were you when I went through hell to get it working :laughing:

Anyway, there is also another HA project (but probably abandoned by now) that was posted on european repository (I added to QNAP so easily visible there):
http://store.qnapclub.eu/

Problem with that package was that it used slightly older python (3.4 vs 3.5) and was missing some packages. Also it was created in virtual environment which I successfully broke so I require entware-ng
Also getting Z-wave was a hell to get working and I am still not fully satisfied with the way it works on QNAP, but it is ok for now. I do have whl package for z-wave if interested

1 Like

My package is only an installer. No virtual env and no included packages.
When a package is needed HA installs with pip.

How did you get zwave running on your qnap?

I used entware-ng to install dependencies (hell), then I built python package (wheel) of OZW and installed it.
However, USB stick wasn’t properly detected, so I had to mess with udev (semi-successfully).
If you connect USB stick to QNAP and run dmesg, do you get correct tty device?

no in my situation the usb isn’t detected at all, as a tty device. What i was hoping to do is to create a hass container in docker and map the tty USB device to the hass-container. I love docker but this way I cannot use hass to the full.

I contacted qnap support as well. They replied not supporting usb other than storage and printers at the moment and not sure when that changes.
See mail below:


Good morning.
Thank you for your email.

I will make a feature request for your request.
Unfortunately there is no workaround for this Issue.

This is why you didn’t find any answers.

I hope that this is possible for in the future.

I hope to have informed you.

Thank you.

Best Regards,

Faraz Malik
QNAP Systems, Inc.


Which Z-Wave stick do you use?

Also QNAP has very limited udev rules that prevent my AOETEC Gen5 USB Z-wave stick from being detected.

Here is a startup script I started working on to get it working, it is not perfect but should give you a start.

# Enable Z-Wave and UPS Monitoring
ZWAVE_Vid=(0658)
ZWAVE_Pid=(0200)

DEBUG_LOG="/tmp/usbdebug"	
/usr/sbin/lsusb | /bin/awk '{print $6}' > $DEBUG_LOG

cat $DEBUG_LOG | while read LINE
do	
    usb_idVendor=`echo $LINE | cut -f 1 -d ':'`
    usb_idProduct=`echo $LINE | cut -f 2 -d ':'`

    if [ "$ZWAVE_Vid" = "$usb_idVendor" ] && [ "$ZWAVE_Pid" = "$usb_idProduct" ]; then
        echo "Add kernel modules" >> $DEBUG_LOG
        /sbin/insmod /lib/modules/misc/usbserial.ko
        echo "Found Zwave: Copy udev rules" >> $DEBUG_LOG

	cat > /lib/udev/rules.d/90-zwave.rules <<EOF
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_interface", \
        ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", \
        DRIVER=="", RUN="/sbin/insmod /lib/modules/others/cp210x.ko"
SUBSYSTEM=="drivers", ENV{DEVPATH}=="/bus/usb-serial/drivers/cp210x", ATTR{new_id}="0658 0200"
KERNEL=="ttyUSB[1-9]",SUBSYSTEM=="tty",ATTRS{idVendor}=="0658",ATTRS{idProduct}=="0200",SYMLINK+="ttyZWAVE"
EOF

	touch /lib/udev/rules.d/90-zwave.rules
        /sbin/udevadm control --reload-rules
	/sbin/udevadm settle

        if [ ! -c /dev/ttyZWAVE ]; then
            echo "Test Udev rules to re-create link if missing" >> $DEBUG_LOG
            if [ -c /dev/ttyUSB1 ]
            then
                udevadm test `udevadm info -q path -n /dev/ttyUSB1`
            else
                udevadm test `udevadm info -q path -n /dev/ttyUSB2`
            fi
        fi
    fi
done

/opt/sbin/apcupsd

thnx, I will give it a try.

Nicely working!

Just for completeness, I added few lines to my script.
I placed it as part of Entware pkg ( /share/CACHEDEV1_DATA/.qpkg/Entware-ng/etc/init.d/ )

[code]ZWAVE_Vid=(0658)
ZWAVE_Pid=(0200)

DEBUG_LOG="/tmp/usbdebug"
/usr/sbin/lsusb | /bin/awk ‘{print $6}’ > $DEBUG_LOG

cat $DEBUG_LOG | while read LINE
do
usb_idVendor=echo $LINE | cut -f 1 -d ':'
usb_idProduct=echo $LINE | cut -f 2 -d ':'

if [ "$ZWAVE_Vid" = "$usb_idVendor" ] && [ "$ZWAVE_Pid" = "$usb_idProduct" ]; then
    echo "Add kernel modules" >> $DEBUG_LOG
    /sbin/insmod /lib/modules/misc/usbserial.ko
    /sbin/insmod /lib/modules/others/cp210x.ko
    
    echo "Found Zwave: Copy udev rules" >> $DEBUG_LOG

cat > /lib/udev/rules.d/90-zwave.rules <<EOF

SUBSYSTEM==“usb”, ENV{DEVTYPE}==“usb_interface”,
ATTRS{idVendor}==“0658”, ATTRS{idProduct}==“0200”,
DRIVER=="", RUN="/sbin/insmod /lib/modules/others/cp210x.ko"
SUBSYSTEM==“drivers”, ENV{DEVPATH}=="/bus/usb-serial/drivers/cp210x", ATTR{new_id}=“0658 0200”
KERNEL==“ttyUSB[1-9]”,SUBSYSTEM==“tty”,ATTRS{idVendor}==“0658”,ATTRS{idProduct}==“0200”,SYMLINK+=“ttyZWAVE”
EOF

echo $ZWAVE_Vid $ZWAVE_Pid > /sys/bus/usb-serial/drivers/cp210x/new_id

touch /lib/udev/rules.d/90-zwave.rules
/sbin/udevadm control --reload-rules
/sbin/udevadm settle


    if [ ! -c /dev/ttyZWAVE ]; then
        echo "Test Udev rules to re-create link if missing" >> $DEBUG_LOG
        if [ -c /dev/ttyUSB1 ]
        then
            udevadm test `udevadm info -q path -n /dev/ttyUSB1`
        else
            udevadm test `udevadm info -q path -n /dev/ttyUSB2`
        fi
    fi
fi

done[/code]

@Tomek985 Thanks for sharing this script. Can you confirm that this is still working for you correctly. I added the script to run on startup (using this tool on my Qnap) and got some output in the log:

1c05:2074
0658:0200
1005:b155
1d6b:0002
1c05:3074
1d6b:0003
26bd:9917
Add kernel modules
Found Zwave: Copy udev rules
Test Udev rules to re-create link if missing

But the device is not being detected correctly. Any tips on debugging?

@Tomek985 Not to worry. It would seem Qnap is currently shipping an old version of Docker which needed to device to be passed into the container in a different way. Thanks again for sharing this script. It seems to be working well :slight_smile:

Can you provide a simple how-to, to get started?

Download the latest release at https://github.com/sanmibuh/qnap-homeassistant/releases and install it with QNAP App Center

Thanks, I tried that, but couldn’t figure out how to configure it.

Ended up doing the Docker install.

The configuration is the same way on my build and on docker. See home-assistant documentation for more info.

Note that docker version is preferred if your qnap support it.

Thanks, I’m running it in the Container Station, I think that’s a more simple way for management purposes.

I successfully installed HA on my tvs-682 to container station the other day, but I haven’t tried connecting a zwave usb antenna yet. Any advice on which one to get?

Also, I’ll be getting the monoprice six zone amp/controller for whole home audio. Its the same/similar to the Russound CAA66 and supports rnet over rs232. Any suggestions on a compatible usb to rs232 adapter?

Hi Johnny,

How did you get the zwave working? I’m stuck trying to get a zooz zst39 working.