Hello,
I created an installer for QNAP QTS Nas series.
The project is allocated at https://github.com/sanmibuh/qnap-homeassistant
This is my first qpkg project. All suggestions are welcomed.
Hello,
I created an installer for QNAP QTS Nas series.
The project is allocated at https://github.com/sanmibuh/qnap-homeassistant
This is my first qpkg project. All suggestions are welcomed.
Nicely done!
In would highly recommend moving this to the Share your Projects category so it can be properly highlighted.
Hello,
Thanks for de advice. I’ll move it
Kinds regards
I will definitely try this out! Does it have zwave support?
I tried your qpkg, but I got stuck on the optware requirement. I tried with entware but still requires optware. Since optware is dead because of the openssh issue is it possible to build it based on entware?
Or am I doing something wrong.
Cheers.
This week I will change the dependencies to remove Optware.
I´m migrating from TS-210 to my new TS-251 and until the end of this week I haven’t operative the NAS for test the change:
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!!
Amazing contribution, where were you when I went through hell to get it working
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
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
Can you provide a simple how-to, to get started?