[SOLVED] Do I have to unplug my Z-Stick Gen 5 to include new devices?

I’ll explain… When you remove the Z-Stick, OH does not release the port (which it should! tut tut OH), so plugging the stick back in will have no effect because a) OH thinks its already connected, and b) the port is still in use by OH so inserting the stick gives it a different address.

This is also the reason you cannot simply restart the openhab service, because you will have to update the port address again in the binding config. Then when you restart the pi, the stick will revert to its original address and the binding wont find it again. All very annoying, I know.

1 Like

Thanks for the info. Okay, both devices showed up in the Inbox. Odd thing, it recognized both devices as smart plugs when one of them is a motion sensor.

So if you want to avoid having a different /dev/tty device when plugging the stick back in you can set a udev rule up to always load the same /dev everytime.

I use /dev/zwave as example on the z-stick thing:
/etc/udev/rules.d/99-zwave.rules

SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="zwave", GROUP="dialout"
2 Likes

Still doesn’t actually solve the problem. OH will never look for another stick as long at doesn’t detect the disconnection of stick in the first place.

Always restart the Pi.

1 Like

So apparently my Z-Stick has changed ports. How can I find which port it’s using now and update the config?

Quite common, at least with the latest build.

I had the same issue last week.

Inbox Shows Wrong Thing

That’s my post on the same problem.

1 Like

Before I had to move raspian to a USB stick (bad SD card purchase), I didn’t have any issues with removing and adding the usb stick; the only issue was that it would change the /dev/tty.

Fun fact running a raspberry pi this way makes it so that if you do not shut down when you remove the z-stick, the system freaks out as it seems to unload all usb devices. Some day I will hopefully have time to put things back on the SD card.

1 Like

SSH into the pi and issue the following command

ls /dev/ttyA*

My guess it will be 1 instead of 0; rebooting will revert back to 0.

1 Like

You can Include devices without removing the Z-Stick. The Z-Wave Scan function puts the Z-Wave Stick into Inclusion mode for 30 seconds. You can access this through HABmin, or PaperUI.

PaperUI - If you go to your Inbox, Click the antenna looking Scan Icon on the upper right. This will present a menu of Bindings. Select ZWave, this should put the Stick into Inclusion mode. Then activate your new device within 30 seconds and you should be good to go. It has to be in range of the network.

Instructions for HABmin

Z-Wave Inclusion Info - “To include a device in OpenHAB, you need to start the discovery process for Z-Wave. This will put the controller into inclusion mode for 30 seconds, and you then you then need to put the device into inclusion mode.”

2 Likes

Here’s what I got…

[22:16:05] openhabian@openHABianPi:~$ ls /dev/ttyA*
/dev/ttyACM0 /dev/ttyAMA0

It shouldn’t have, did you restart the Pi?

You probably have ttyUSB0, try ttyUSB1.

In fact, clicking the dropdown in the ZW binding will probably list the correct port.

1 Like

I never knew that!

I always thought it was strange that the controller properties had an option to exclude from the controller, but not include. Now I know why.

It’s not the most obvious feature, so don’t feel too bad. I can report that I just used this network inclusion the other day, so it works.

1 Like

Something is definitely amiss. As I have been learning OH2 I had the Z-Stick, Aeotech MultiSensor and a Smart Plug working to turn on a light when motion is detected. Now when I walk in front of the MultiSensor, nothing happens. It’s like the rule never fires off.

I would have to see the following things in order to offer any sort of assistance:

  • items file.
  • rules file.
  • log of the time period you are referring to.

Without that we are all guessing.

1 Like

I have added my items manually so I don’t have an items file.

When I walk in front of the motion sensor the log shows…
2018-02-14 23:12:26.249 [vent.ItemStateChangedEvent] - zwave_serial_zstick_80b4c831_serial_ack changed from 88 to 89
2018-02-14 23:12:26.256 [vent.ItemStateChangedEvent] - zwave_serial_zstick_80b4c831_serial_sof changed from 175 to 176
2018-02-14 23:12:30.527 [vent.ItemStateChangedEvent] - zwave_serial_zstick_80b4c831_serial_sof changed from 176 to 177
2018-02-14 23:12:30.544 [vent.ItemStateChangedEvent] - zwave_serial_zstick_80b4c831_serial_ack changed from 89 to 90
2018-02-14 23:12:30.558 [vent.ItemStateChangedEvent] - zwave_serial_zstick_80b4c831_serial_sof changed from 177 to 178
2018-02-14 23:12:34.613 [vent.ItemStateChangedEvent] - zwave_serial_zstick_80b4c831_serial_sof changed from 178 to 179
2018-02-14 23:12:34.629 [vent.ItemStateChangedEvent] - zwave_serial_zstick_80b4c831_serial_ack changed from 90 to 91

Here’s the rule…
var Timer myTimer_FR_Motion = null
val int timeoutMinutes = 2

rule "Family Room Motion"
when
// This is the Motion Sensor Item that will trigger to turn on the light. State “ON” means when the sensor detects motion.
Item FR_Motion changed to ON
then
// you will want to create a rule which determines when it is day and when it is night. once you have implemented
// day night states, you can enable the following line. remember to uncomment the last brace at the bottom too.
// if ( nightstate.state==on && lt_fr_table.state==off ) {

// this checks to see if there is currently a timer that exists.
if ( myTimer_FR_Motion===null ) {
logInfo(“FRMotion”, “motion detected in the Family Room, turning on lights for {} minutes.”, timeoutMinutes)

// This instructs the Smart Plug to turn ON.
FR_Plug_1.sendCommand(ON)

// This is where to add an additional Smart Plug to turn ON
// PLUGNAME.sendCommand(ON)

     myTimer_FR_Motion = createTimer(now.plusMinutes(timeoutMinutes), [|
     logInfo("FRMotion", "Timer expired... turning off lights")

// Change Smart Plug to be a Switch thing.
FR_Plug_1.sendCommand(OFF)

// This is where to turn OFF second Smart Plug
// PLUGNAME.sendCommand(OFF)

     myTimer_FR_Motion = null
     ])
  }
  else {
     logInfo("FRMotion", "Motion detected in Family Room rescheduling timer, adding {} minutes.", timeoutMinutes )
     myTimer_FR_Motion.reschedule(now.plusMinutes(timeoutMinutes))
  }

// Uncomment the following curly brace if you enable the first IF statement above.
// }

end

Did you by chance use a different USB port than before?

Is the ZWvave Controller still Online?

Did the ZWave Binding get uninstalled?

Go to the Control menu item, can you still activate the Light/Switch from OH PaperUI? If so most of the stuff I asked is fine.

1 Like

It would make things easier to post code and logs in code fences for easier readability.

OK, you have no bindings to those devices, all I see is controller communication (ACK, etc).

If you had any channels defined I would see those channels reporting changes or updates.

1 Like

See below…

Ok, now go to the Sensor Thing in PaperUI and check the Channels and their links to Items. Remember clicking on the Blue Circle?

1 Like