Zwave Binding adding a second controller

Hi Guys

So, ive got 2 x Zwave Gen5 Aeo sticks.

One connected to OH2 (a new stick) via USB and the second via socat

I’ve just plugged in the second unit and it appears PaperUI wont display both controllers

Im running:

251 │ Active   │  80 │ 2.4.0.201809081506     │ ZWave Binding

I didnt think there was special configuration required to have 2 x Controllers running.

Is there?

After a restart of OH2, my old controller is visible with its Zwave devices online but PaperUI doesnt display the second controller.

The server sees it though:

This is in my /etc/default/openhab2 file

XTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0:/dev/ttyACM1


kris@openhab2:/etc/openhab2/items$ lsusb
Bus 002 Device 004: ID 04b4:4717 Cypress Semiconductor Corp.
Bus 002 Device 003: ID 0624:0402 Avocent Corp. Cisco Virtual Keyboard and Mouse
Bus 002 Device 013: ID 0658:0200 Sigma Designs, Inc.
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0624:0403 Avocent Corp. Cisco Virtual Mass Storage
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
kris@openhab2:/etc/openhab2/items$


kris@openhab2:/etc/openhab2/items$ ls /dev/tty*
/dev/tty    /dev/tty15  /dev/tty22  /dev/tty3   /dev/tty37  /dev/tty44  /dev/tty51  /dev/tty59  /dev/tty9       /dev/ttyS13  /dev/ttyS20  /dev/ttyS28  /dev/ttyS7
/dev/tty0   /dev/tty16  /dev/tty23  /dev/tty30  /dev/tty38  /dev/tty45  /dev/tty52  /dev/tty6   /dev/ttyACM0    /dev/ttyS14  /dev/ttyS21  /dev/ttyS29  /dev/ttyS8
/dev/tty1   /dev/tty17  /dev/tty24  /dev/tty31  /dev/tty39  /dev/tty46  /dev/tty53  /dev/tty60  /dev/ttyprintk  /dev/ttyS15  /dev/ttyS22  /dev/ttyS3   /dev/ttyS9
/dev/tty10  /dev/tty18  /dev/tty25  /dev/tty32  /dev/tty4   /dev/tty47  /dev/tty54  /dev/tty61  /dev/ttyS0      /dev/ttyS16  /dev/ttyS23  /dev/ttyS30  /dev/ttyUSB0
/dev/tty11  /dev/tty19  /dev/tty26  /dev/tty33  /dev/tty40  /dev/tty48  /dev/tty55  /dev/tty62  /dev/ttyS1      /dev/ttyS17  /dev/ttyS24  /dev/ttyS31
/dev/tty12  /dev/tty2   /dev/tty27  /dev/tty34  /dev/tty41  /dev/tty49  /dev/tty56  /dev/tty63  /dev/ttyS10     /dev/ttyS18  /dev/ttyS25  /dev/ttyS4
/dev/tty13  /dev/tty20  /dev/tty28  /dev/tty35  /dev/tty42  /dev/tty5   /dev/tty57  /dev/tty7   /dev/ttyS11     /dev/ttyS19  /dev/ttyS26  /dev/ttyS5
/dev/tty14  /dev/tty21  /dev/tty29  /dev/tty36  /dev/tty43  /dev/tty50  /dev/tty58  /dev/tty8   /dev/ttyS12     /dev/ttyS2   /dev/ttyS27  /dev/ttyS6
kris@openhab2:/etc/openhab2/items$

Any thoughts @chris

Thanks!

that’s a bit old (it shouldn’t matter for your issue though)

Which ports are being used?
local USB Stick: /dev/ttyACM0 ?
remote (over IP) USB Stick: ?

Did you try to add the second one manually on PaperUI?

Hi Dim,

Its odd. I even restarted the whole box.

ACM0 appears to be locally connected

dev/ttyUSB0 is the remote connected, which has ALL my zwave devices on it.

When I reboot, the USB controller displayed in PaperUI(It only ever displays 1) changes to the ACM0 connected one, and all my devices remain in a REQUEST_NIF state and fail to work…

try to add the second one from PaperUI -> Inbox -> Z-Wave Binding -> Search -> Add Manually
does this work?
do you see dev/ttyUSB0 as an option in the pull down menu for the Port Config?

It doesnt :frowning:

You may need to configure your linux O/S to persist USB device names
I will try to find the relevant post here… it’s somewhere
you also need to make sure that the user openhab has been added to the dialout group which usually has the rights to access serial (USB) stuff on the host O/S

what is the output of:

ls -al /dev/ttyACM0 /dev/ttyUSB0

kris@openhab2:~$ ls -al /dev/ttyACM0 /dev/ttyUSB0
crw-rw---- 1 root dialout 166, 0 Dec 7 20:44 /dev/ttyACM0
lrwxrwxrwx 1 root root 10 Dec 7 20:46 /dev/ttyUSB0 -> /dev/pts/0
kris@openhab2:~$

I can try and add it Manually using PaperUI?

did you change the default permissions on the /dev/ttyUSB0 ?
with these permissions on it, the user openhab should be able to access it

that is the output of:

ls -al /dev/pts/0

Ive made no changes, dev/ttyUSB0 worked just fine before

kris@openhab2:~$ ls -al /dev/pts/0
crwxrwxrwx 1 openhab dialout 136, 0 Dec  7 21:03 /dev/pts/0
kris@openhab2:~$
1 Like

so you can configure OH2 with the Z-Wave binding to use /dev/ttyUSB0 (it shows up in the list of Port config options) but:
i) the config is not kept and upon restart and it switches back the Controller to /dev/ttyACM0
ii) Auto Discovery does not find the second Controller if one is already present in the OH2 system

correct?

try to add the 2nd Controller manually

So auto discovery didnt find the device, but ive just added it manually and given the unit showing was the locally connected USB stick as ACM0, i added this (old stick) was USB0.

Then it showed all the old devices inside my Inbox, changing all their ID’s so I had to readd them ALL.

Its like all my devices have just swapped over.

previously, device 512 had all my zwave units. Now device b2b9207 has all my zwave devices! Rather annoying and strange.

not very clear :slight_smile:

how many ZW controllers do you have now on OH2?

Two! yeah its not at all logical whats just happened. All my zwave devices just flipped from my old controller (512) in the living room to this new controller b2bXXXX

you can fix these stuff, don’t worry :slight_smile:
worst case scenario: find and replace the Controller ID in your Items files :stuck_out_tongue:

I would:

  1. Remove both ZW controllers
  2. Add ACM0, let ZW Binding read the associated nodes and add them as Things
  3. Add USB0, let ZW read nodes and add them as Things
  4. Configure Items to link to both Channels of both Things (if Controllers have the same nodes registered on them)

I don’t know if any of the above will work because I don’t use a dual Controller setup.

The existing devices are registered to only one Controller, the USB one.

Nothing is on the second new controller, however I’ve just tried to pair a device and its yet to appear in PaperUI

Existing devices seem to be working again on the new Controller number. My newly pair one hasnt turned up on the new controller. Odd. 30minutes later, still no sign of the Aeotec Dimmer on the new controller.

8hrs later…nothing has shown up under inbox on this controller :confused:

Seems an issue with the second controller connected locallly.

It doesnt go offline when removing it and readding it i get this huge error


07:11:13.015 [INFO ] [ding.zwave.handler.ZWaveSerialHandler] - Stopped ZWave serial handler
07:11:13.023 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.thingUpdated()' on 'org.openhab.binding.zwave.handler.ZWaveSerialHandler@53833252': null
java.lang.IllegalMonitorStateException: null
        at java.lang.Object.notify(Native Method) ~[?:?]
        at org.openhab.binding.zwave.internal.protocol.ZWaveTransactionManager.shutdown(ZWaveTransactionManager.java:207) [251:org.openhab.binding.zwave:2.4.0.201809081506]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.shutdown(ZWaveController.java:118) [251:org.openhab.binding.zwave:2.4.0.201809081506]
        at org.openhab.binding.zwave.handler.ZWaveControllerHandler.dispose(ZWaveControllerHandler.java:253) [251:org.openhab.binding.zwave:2.4.0.201809081506]
        at org.openhab.binding.zwave.handler.ZWaveSerialHandler.dispose(ZWaveSerialHandler.java:133) [251:org.openhab.binding.zwave:2.4.0.201809081506]
        at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.thingUpdated(BaseThingHandler.java:206) [101:org.eclipse.smarthome.core.thing:0.10.0.201808242044]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [94:org.eclipse.smarthome.core:0.10.0.201808242044]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [94:org.eclipse.smarthome.core:0.10.0.201808242044]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
07:11:13.037 [INFO ] [smarthome.event.ThingUpdatedEvent    ] - Thing 'zwave:serial_zstick:512' has been updated.```

Rebooted, tried to make a change to the second controller by removing option ‘Controller is Master’ in PaperUI, another huge error:


07:28:23.132 [ERROR] [est.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/zwave:serial_zstick:512/config'
java.lang.IllegalMonitorStateException: null
        at java.lang.Object.notify(Native Method) ~[?:?]
        at org.openhab.binding.zwave.internal.protocol.ZWaveTransactionManager.shutdown(ZWaveTransactionManager.java:207) [251:org.openhab.binding.zwave:2.4.0.201809081506]
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.shutdown(ZWaveController.java:118) [251:org.openhab.binding.zwave:2.4.0.201809081506]
        at org.openhab.binding.zwave.handler.ZWaveControllerHandler.dispose(ZWaveControllerHandler.java:253) [251:org.openhab.binding.zwave:2.4.0.201809081506]
        at org.openhab.binding.zwave.handler.ZWaveSerialHandler.dispose(ZWaveSerialHandler.java:133) [251:org.openhab.binding.zwave:2.4.0.201809081506]
        at org.openhab.binding.zwave.handler.ZWaveControllerHandler.handleConfigurationUpdate(ZWaveControllerHandler.java:346) [251:org.openhab.binding.zwave:2.4.0.201809081506]
        at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.updateConfiguration(ThingRegistryImpl.java:92) [101:org.eclipse.smarthome.core.thing:0.10.0.201808242044]
        at org.eclipse.smarthome.io.rest.core.internal.thing.ThingResource.updateConfiguration(ThingResource.java:436) [111:org.eclipse.smarthome.io.rest.core:0.10.0.201808242044]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) [163:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) [163:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) [163:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) [163:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) [163:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) [163:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) [163:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) [163:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [163:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [162:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [162:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [162:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [162:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [162:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [162:org.glassfish.jersey.core.jersey-common:2.22.2]
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [163:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [163:org.glassfish.jersey.core.jersey-server:2.22.2]
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) [160:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) [160:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) [160:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) [160:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) [160:org.glassfish.jersey.containers.jersey-container-servlet-core:2.22.2]
        at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) [15:com.eclipsesource.jaxrs.publisher:5.3.1.201602281253]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [78:org.eclipse.jetty.servlet:9.3.21.v20170918]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [78:org.eclipse.jetty.servlet:9.3.21.v20170918]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [175:org.ops4j.pax.web.pax-web-jetty:6.0.9]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [77:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [75:org.eclipse.jetty.security:9.3.21.v20170918]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [77:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [77:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [175:org.ops4j.pax.web.pax-web-jetty:6.0.9]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [78:org.eclipse.jetty.servlet:9.3.21.v20170918]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [77:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [77:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [77:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [175:org.ops4j.pax.web.pax-web-jetty:6.0.9]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [77:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.Server.handle(Server.java:534) [77:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [77:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [77:org.eclipse.jetty.server:9.3.21.v20170918]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [69:org.eclipse.jetty.io:9.3.21.v20170918]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [69:org.eclipse.jetty.io:9.3.21.v20170918]
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [69:org.eclipse.jetty.io:9.3.21.v20170918]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [80:org.eclipse.jetty.util:9.3.21.v20170918]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [80:org.eclipse.jetty.util:9.3.21.v20170918]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [80:org.eclipse.jetty.util:9.3.21.v20170918]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [80:org.eclipse.jetty.util:9.3.21.v20170918]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [80:org.eclipse.jetty.util:9.3.21.v20170918]
        at java.lang.Thread.run(Thread.java:748) [?:?]

Anyone? :frowning: