Setting up openHAB 2 on Synology + Z-Wave (beginner here)

zwave
synology
aeonzwavestick
Tags: #<Tag:0x00007f014b2aec68> #<Tag:0x00007f014b2ae998> #<Tag:0x00007f014b2ae678>

(acs) #1

Updated: I’ve cleaned this up after giving it another go with “2.1.0.004-SNAPSHOT-DSM6

Hi,
I’m using this post as a record of my migration from using a micasaverde VERA 2 as a controller in a very simple Z-wave network. It has been pretty much successful so far.

  • My home network consists of only 6 Z-wave devices and I’ve also fiddled with other OpenHAB 2 bindings:

  • 1 un - Aeon Labs/AEOTEC Z-Stick Gen5 USB Z-Wave Controller

  • 3 un - Fibaro Rollerblind controllers FGR221 (no power sensors)

  • 2 un - Fibaro Rollerblind controllers FGRM222 (newer versions)

  • The first step was to add the Z-Stick to my original network and then move the Z-wave network (controller shift) from the Vera to the Z-Stick. I later checked with desktop software (zensys, etc) that it appeared to be ok, and after that removed the Vera altogether from the network

  • While preparing to make OpenHAB 2 actually run on the Synology NAS, I determined that I was necessary to:

  • Create folders /volume1/public/OpenHAB2/addons and /volume1/public/OpenHAB2/conf (not configurations)

  • Create dialout and uucp user groups to the DSM and adding the openhab2 user as a member of those two groups

  • Solve the “Serial Error: Port /dev/ttyACM0 does not exist” Z-Wave binding issue with ssh’ing:

sudo chmod 777 /dev/ttyACM0
  • Notice that when you disconnect your USB stick from the NAS it will reconnect in the next “slot”, so the port will most likely now be /dev/ttyACM1. You can either a) change the serial port in the thing properties within OpenHAB 2 or b) unplug it and maybe it will reconnect on the other port. To check you can just issue ls /dev/ttyACM0 to check if it exists or not. Side note: this issue also happened with Domoticz, it’s probably difficult to get it working automatically.

  • I found that the script I had here before doesn’t make any difference now. If it doesn’t work after you check you’re using the right port, just restart the OpenHAB 2 package.

  • At this time I had OpenHAB2 running on yournas:8080/start/index:

  • After adding the Z-Wave binding I was able to add the Z-Stick controller as a new Things and quickly after that I had 5 other Things detected

  • Note that before adding Items you should have edited each _thing´_s name so that the channel id will be more legible. That will be useful later on, for more complex tinkering.

  • The other thing to consider is that unlike previous OpenHAB 2 versions, channels are no longer created automatically (although you can switch that under PaperUI > Configuration > System > Item Linking > Simple Mode. I prefer to leave unmarked as you can be more selective on which items you actually add to the system.

  • The Z-Stick was not accurately detected: it shows up as Z-Wave Serial Controller, it has 5 fields with a Value label, a couple of those have numbers floating around and the other 3 do not have any info. But it does work.

  • The network doesn’t respond to networks with the same reliability of Domoticz. With Domoticz everything just worked, unless an update broke it. With OpenHAB 2 what happens is that there are some instances where the commands aren’t issued, up to a point where a restart is necessary.

  • The Z-Wave Fibaro Roller Shutter modules were for the most part detected. I finally was able to reset one that was being stubborn and wouldn’t run, although it isn’t working as it should (more on this below). Here’s my network diagram (from HABmin > Tools )

  • Additional OpenHAB2 Bindings / Services / Etc I’m using:

  • YahooWeather (for local weather temperature, humidity and pressure information)

  • Astro Binding (for getting sunset/sunrise time)

  • Network Binding (to detect my Mobile Phone when connected to my Wi-Fi network)

  • HomeKit (installed but I’ve yet to understand exactly what to do with it to make it work)

  • HABmin and Panels UI

Except for HomeKit and UI’s, all these others are to be used in the future, as soon as I understand how to use them in blockly instructions.

Hope this helps someone.


(22 March 2017) Currently I have two issues to tackle:

  • I have no idea on how to create a control/switch for a group of items other than adding a button on the Panels UI. I find this is necessary so that I actually have an item that can be detected by i.e. mobile apps or even in the “Basic UI”. Groups and scenes are concepts kind of different from of other platforms and the documentation is not straightforward. I understand how to add devices to a Group (create a Group item and edit each Item by adding it to that Group), but not how to actually have something like a “switch channel” associated with that Group.

  • Node 5 (FGRM222 Roller Shutter) is isolated as seen in the network diagram, and after many trials to heal the network and the node itself, it still doesn’t route to any neighbour other than the controller (Node 7):

  • I actually had to move the USB Z-Stick (temporarily) closer to it in order to successfully remove and add it from the network, and most importantly, make OpenHAB2 recognise and fully initialise it.

  • The network is physically similar to the drawing although nodes 3 and 6 are the ones closer to node 5.

  • All the nodes are at similar distances from the Z-Stick controller on its usual location, although there are some additional walls between that position and node 5.

  • Here’s my network diagram:

  • And here’s a schematic of the physical layout (black lines are walls):


(27 March 2017) I went back to Domoticz, for the time being. OpenHAB2 is no way as stable as Domoticz is and not as easy to use when it comes to creating scenes / groups. I was losing connectivity from time to time (days), and that alone is enough to put it aside for now.


Synology and Zwave
(acs) #2

Pretty much solved here:


(Jeremy) #3

just wanted to say thanks for listing the steps simply to get a Z-Stick working with a Synology NAS and openHAB2.

I found a lot of confusing threads on how to configure it, only yours provided everything I needed to get it setup in under 5 minutes. Tis a Christmas miracle.


(Dustin Thurston) #4

I’ve been trying to configure openhab2 on my synology server as well. I don’t use Z-Wave, but use another serial interface to communicate with sensors. This post is very promising as I couldn’t figure out how to access the serial port.

I’m familiar with adding openhab to the dialout group in linux, but what is the uucp group? Do I simply need to add the groups or is there additional configuration?


(acs) #5

I just added the groups to the Synology user database, nothing special about it.


(acs) #6

I rewrote the original post so that it can be of some use to someone else using OpenHAB 2 on a Synology, using the latest SPK released on github (2.1.0.004-SNAPSHOT-DSM6 on openhab/openhab-syno-spk). In any case I still have some questions that may be simple for non-beginners, if someone can help I’d be thankful:

  • I have no idea on how to create a control/switch for a group of items other than adding a button on the Panels UI. I find this is necessary so that I actually have an item that can be detected by i.e. mobile apps or even in the “Basic UI”. Groups and scenes are concepts kind of different from of other platforms and the documentation is not straightforward. I understand how to add devices to a Group (create a Group item and edit each Item by adding it to that Group), but not how to actually have something like a “switch channel” associated with that Group.

  • Node 5 (FGRM222 Roller Shutter) is isolated as seen in the network diagram below, and after many trials to heal the network and the node itself, it still doesn’t route to any neighbour other than the controller (Node 7):

  • I actually had to move the USB Z-Stick (temporarily) closer to it in order to successfully remove and add it from the network, and most importantly, make OpenHAB2 recognise and fully initialise it.

  • The network is physically similar to the drawing although nodes 3 and 6 are the ones closer to node 5.

  • All the nodes are at similar distances from the Z-Stick controller on its usual location, although there are some additional walls between that position and node 5.

  • Here’s my network diagram:

  • And here’s a schematic of the physical layout (black lines are walls):


(Matthew) #7

Wait, so did you connect the AEOTEC Z-Stick USB Z-Wave Controller to the USB port on the Synology NAS?


(Martin Tamke) #8

Thanks a lot - this post helped to get the Z-wave uzb1 stick running on the synology NAS. Especially the ssh assignment was important


(Holgi) #9

I guess it is kinda late, but as this thread is coming up among the first ones on a Google search with Z-Wave and Synology, I wanted to add that this information finally helped me getting the stick working after reboot (chmod 777 /dev/ttyACM0 always worked only until next reboot):


(acs) #10

Sorry, had notifications disabled. Yes, I do, currently on OpenHab 2.3.0


(acs) #11

I’m doing the same with a script, but I also added the script to a scheduled task in DSM so that I can run the it manually from DSM UI - i.e. triggering it manually without rebooting.

Using:

/bin/sh /usr/local/etc/rc.d/S98openhabzwave.sh start


(Mr. Wiseman) #12

Here’s the script I run, just once, on the Synology for the USB port.

# UDEV rules directly echoed to the target file
echo 'ACTION=="add", KERNEL=="ttyACM[0-9]*", MODE="0660", OWNER="openhab", GROUP="dialout"' >> /lib/udev/rules.d/99-aeon-z-stick.rules
chmod 755 /lib/udev/rules.d/99-aeon-z-stick.rules
# Start up script directly echoed to the target file
echo -e '#!/bin/sh\nstart_modules(){\n\techo ls -l /dev/tty[AU]* >> /volume1/public/zwavelog.txt\n\tchown -R root.uucp /run/lock\n\tchmod -R g+w /run/lock\n\tchown -R root.uucp /var/lock\n\tchmod -R g+w /var/lock\n}\nstop_modules(){\n\techo "do nothing"\n}\ncase "$1" in\n\tstart)\n\t\tstart_modules\n\t;;\n\tstop)\n\t\tstop_modules\n\t;;\n\t*)\n\t\techo "usage: $0 { start | stop }" >&2\n\texit 1\n\t;;\nesac\nexit 0' >> /usr/local/etc/rc.d/S98openhabzwave.sh
chmod 755 /usr/local/etc/rc.d/S98openhabzwave.sh
# Set owner of device once
chown openhab /dev/ttyACM0
reboot

I have 2 Synology’s in a HA pair (active/passive) with mirrored Aeotec zWave controllers in each.

Best, Jay