Beginners Recipe: Z-Wave Breakfast

Intro:
This is a basic tutorial on how to prepare a very simple Z-Wave breakfast (installation) with your OpenHab 2.

Serves: 2
Cooks in: 30 minutes
Difficulty: Not too tricky

Ingredients:

  • 1 kilogram of Computing Host (we use a Debian Jessie Laptop in this recipe but any Host will do like Raspberry or Windows PC)
  • 1 tablespoon of OpenHab 2 (we use the OH2-Snapshot #594 in this recipe but any OH2 >= Beta 4 will do)
  • 1 slice of Z-Wave USB Stick (we use the Aeotec Z-Stick Gen5 P/N: ZW090-C in this recipe but any Z-Stick will do)
  • 2 cups of Z-Wave devices (we use the Fibaro Motion Sensor P/N: FGMS-001 v2.7 in this recipe but any Z-Wave node will do)

___ +___

Directions:
a) Preheat the Computing Host to medium and connect the slice of Z-Wave USB Stick
Cook for 1 minute and check the USB Devices:

root@host:~# lsusb 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 04f2:b52d Chicony Electronics Co., Ltd 
Bus 001 Device 002: ID 8087:0a2a Intel Corp. 
Bus 001 Device 005: ID 0658:0200 Sigma Designs, Inc.    <--------------------
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@host:~# dmesg
[...]
[953182.952017] usb 1-2: new full-speed USB device number 5 using xhci_hcd
[953183.136781] usb 1-2: New USB device found, idVendor=0658, idProduct=0200
[953183.136784] usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[953183.137122] cdc_acm 1-2:1.0: This device cannot do calls on its own. It is not a modem.
[953183.137173] cdc_acm 1-2:1.0: ttyACM0: USB ACM device

root@host:~# ls -al /dev/ttyACM0 
crw-rw---- 1 root dialout 166, 0 Nov 18 10:41 /dev/ttyACM0

b) Stir in the openhab user by adding him to the dialout group:

root@host:~# adduser openhab dialout
Adding user `openhab' to group `dialout' ...
Adding user openhab to group dialout
Done.

c) Place the Z-Wave binding into the pan: Open OH2 PaperUI and go to Extensions -> Bindings -> Install Z-Wave Binding (binding-zwave - 2.0.0.SNAPSHOT)

d) Flip OH2 over (Restart OH2) and let the other side brown for a few seconds.

e) Dry Fry the Z-Stick: From OH2 PaperUI go to Inbox -> Search for Things -> Z-Wave Binding
Set the serial port used to access the Z-Wave Stick to /dev/ttyACM0
The Z-Stick is cooked when it appears as Online in Configurations -> Things

f) Break the egg (open the Fibaro Motion Sensor) and put it in Z-Wave network inclusion mode by pressing the B-button 3 times.

g) Place the egg in the pan and fry it: From OH2 PaperUI go to Inbox -> Search for Things -> Z-Wave Binding
The egg is cooked when it appears as Online in Configurations -> Things

If undercooked, it will appear as:

h) Repeat (f) & (g) for the second egg (Fibaro Motion Sensor):

Your breakfast is ready for serving…

To manually define your items, you can use the following example (for the FGMS-001):

Number	FibEye01_Movement	"FE01 Movement: [%s]"			<present>		(gZWave)	{channel="zwave:device:ZW090C:node2:sensor_binary"}
Number	FibEye01_Alarm		"FE01 Alarm: [%s]"				<fire>			(gZWave)	{channel="zwave:device:ZW090C:node2:alarm_general"}
Number	FibEye01_Lux		"FE01 Lux: [%.2f Lux]"			<sun>			(gZWave)	{channel="zwave:device:ZW090C:node2:sensor_luminance"}
Number	FibEye01_Bat		"FE01 Battery: [%d %%]"			<battery>		(gZWave)	{channel="zwave:device:ZW090C:node2:battery-level"}
Number	FibEye01_Temp		"FE01 Temperature: [%.2f °C]"	<temperature>	(gZWave)	{channel="zwave:device:ZW090C:node2:sensor_temperature"}

Number	FibEye02_Movement	"FE02 Movement: [%s]"			<present>		(gZWave)	{channel="zwave:device:ZW090C:node3:sensor_binary"}
Number	FibEye02_Alarm		"FE02 Alarm: [%s]"				<fire>			(gZWave)	{channel="zwave:device:ZW090C:node3:alarm_general"}
Number	FibEye02_Lux		"FE02 Lux: [%.2f Lux]"			<sun>			(gZWave)	{channel="zwave:device:ZW090C:node3:sensor_luminance"}
Number	FibEye02_Bat		"FE02 Battery: [%d %%]"			<battery>		(gZWave)	{channel="zwave:device:ZW090C:node3:battery-level"}
Number	FibEye02_Temp		"FE02 Temperature: [%.2f °C]"	<temperature>	(gZWave)	{channel="zwave:device:ZW090C:node3:sensor_temperature"}

Note: Change the channel="" stuff with the info that you get from your system
(PaperUI -> Configuration -> Things -> Edit the FibEye Thing -> copy the channel name!)

More recipes soon !

BR,
Dim

5 Likes

Nice writeup :grin:, but sometimes you have more than one recipe for preparing breakfast:

Instead of creating the items and link them through a GUI you also can directly link them to the channels:

Switch FibEye01_Movement "FE01 Movement: [%s]" <present> {channel="zwave:device:1587db82cfc:node2:sensor_binary"}

Then they just “appear” as linked channels in PaperUI (or Habmin or whatever)

1 Like