Multiple z-wave bindings

Hi Chris

Just FYI: Running multiple instances of OpenHAB using ZWave controllers on different COM ports was no problem at all. Everything is contained with in each OpenHAB directory - so there’s no need to mess around with any folders or files.

I haven’t been able to test the MQTT forwarding yet though - if there’s a way to event bus forward all ZWave events, or if I need to create duplicate item declarations - one in each OpenHAB. The reason is that I only have one single US ZWave device - and I can’t get that one included (it seems it is not in the ZWave database). Silly showstopper. :frowning:

I have a shopping cart resting on Amazon with a bunch of other US ZWave devices in it - but I won’t pull the trigger until I get this to work.

But I’m so very fortunate that you are already in the thread where I posted that problem, which makes me very confident that it will get solved sooner or later. :slight_smile: https://github.com/openhab/openhab/issues/4274

Regards
/P

Hi guys!

I know that is too hackish and that Chris is not going to like it, but I have recompiled the ZWave binding several times to use different ZWave networks in the same openHAB instance. I have also modified HABmin so that you are able to control the ZWave networks at the same time. Here you have the different .jars and a installation script:

Hope you find it useful and if you need any help, just ask! :wink:

Best regards,

Aitor

1 Like

Hey Aitor!

I’d be happy to try that out. Even if I get things to work the way I want with two OpenHAB instances, I would of course rather only have one.

However - I have a Fibaro FGMS-001 type 801 device - which would require a newer ZWave binding jar than the one you have patched. See https://github.com/openhab/openhab/issues/4274

Any chance you could download the latest 1.9.0 snapshot and update your GitHub site?

I’m running on Windows (only because it is a greater challenge), so I can’t use your install script - but I read it, and there’s nothing in it that I can’t reproduce on Windows.

Regards
/P

I don’t mind, but just to note that it’s not supported, so if there are any issues, I can’t support them - sorry. Also, you will need to support any updates to the database if needed…

you will need to support any updates to the database if needed…

I guess he just noted… :slight_smile:

Chris: Everything worked fine, but (as I thought) I had to add the items in both instances. The events have to end up on the event bus for the MQTT event bus binding to pick them up, and they won’t end up on the event bus unless there is an associated item.

The config, in case anyone is interested:

OH1 openhab.cfg:

mqtt:Mosquitto.url=tcp://localhost:1883
mqtt:Mosquitto.clientId=OpenHAB
mqtt:Mosquitto.user=User
mqtt:Mosquitto.pwd=Password
mqtt-eventbus:broker=Mosquitto
mqtt-eventbus:commandPublishTopic=OpenHAB/${item}/command
mqtt-eventbus:stateSubscribeTopic=OpenHAB2/${item}/state

OH1 items (no binding config needed - they will automatically pick up the bus events):

Number eye_lux "Lux: [%.2f Lux]"
Number eye_temp "Temp: [%.1f °C]"
Contact eye_motion "Motion: [%s]"
Number eye_batt "Battery: [%d %%]"
Switch eye_basic "Basic: [%s]"
Contact eye_alarm "Alarm: [%s]"

OH2 openhab.cfg:

mqtt:Mosquitto.url=tcp://localhost:1883
mqtt:Mosquitto.clientId=OpenHAB2
mqtt:Mosquitto.user=User
mqtt:Mosquitto.pwd=Password
mqtt-eventbus:broker=Mosquitto
mqtt-eventbus:commandSubscribeTopic=OpenHAB/${item}/command
mqtt-eventbus:statePublishTopic=OpenHAB2/${item}/state

OH2 items:

Number eye_lux "Lux: [%.2f Lux]" {zwave="6:command=sensor_multilevel,sensor_type=3"}
Number eye_temp "Temp: [%.1f °C]" {zwave="6:command=sensor_multilevel,sensor_type=1"}
Contact eye_motion "Motion: [%s]" {zwave="6:command=sensor_binary"}
Number eye_batt "Battery: [%d %%]" {zwave="6:command=battery"}
Switch eye_basic "Basic: [%s]" {zwave="6:command=basic"}
Contact eye_alarm "Alarm: [%s]" {zwave="6:command=alarm"}

Hmmm - not exactly ideal I guess…

Your other option as above is to look at OH2 which should (in theory) support multiple sticks out of the box - although as stated above, it probably needs a little bit of thought to avoid the xml files overwriting each other, but this is relatively manageable. I know at least one person has tried this, so it does broadly work.

It’s good enough. It’s a one time configuration (or… at least a one time per each device configuration…)

I guess at some point I will move over to OH2. But I’m not there quite yet.

Yeah, sure Chris, sorry for not making it more clear in my post:

WARNING: This jar files are not officially supported by Chris Jackson, so don’t open any issue ticket in the official ZWave repository if you are having problems with them!

1 Like

Hi @Pal !

It’s great to see that there is some interest in the project! Unfortunately, until the end of the next week I’m away from my development PC, so for now I can’t recompile the binding to add the new version of the Fibaro motion sensor. Anyway, how many ZWave networks are you planning to use? Is the new Fibaro device going to be present in all the ZWave networks or just in one of them? If it’s the second case, you can use the official ZWave binding as the, let’s call it, “ZWave1” binding, because my script doesn’t install the first ZWave binding.

Oh, don’t worry if you are using Windows, you will only need to follow this steps:

  • Stop openHAB
  • Download, from the zwave folder of the github repository, the zwave2, zwave3,… bindings that you are interested in. Remember that you need to install the zwave (zwave1) binding using the official version provided by Chris. Place all the jar files in the openhab addons folder. You don’t need to replace the official zwave binding.
  • If you are going to use 2 zwave networks, download, from the habmin folder of the github repository, the habmin_zwave2 .jar file. For 3 zwave networks, download habmin_zwave3 .jar file, and so on :wink: Remove the habmin jar file from the addons folder and place the habmin_zwaveX file that you have downloaded.
  • Download the habmin.zip file from the habmin folder of the github repository and unzip it in the webapps folder of your openhab installation directory.
  • Edit the openhab.cfg to add the zwave2:port, zwave3:port,… parameters.
  • Start openHAB
  • Enjoy! :wink:

Give it a try and don’t hesitate to ask any question if you need help!

Best regards,

Aitor

Ah, true. I only have two ZWave networks - one for EU devices and one for US devices. The Fibaro Eye is US, so I just need to run the official jar for the US network, and one of your jars for the EU network.

I’ll give it a try and let you know.

[quote=“chris, post:27, topic:10716, full:true”]
Your other option as above is to look at OH2 which should (in theory) support multiple sticks out of the box - although as stated above, it probably needs a little bit of thought to avoid the xml files overwriting each other, but this is relatively manageable. I know at least one person has tried this, so it does broadly work.[/quote]

Since my 2 buildings are to far from eachother, my zwave network isn’t that ideal. Some (far) devices sometimes work, sometimes they don’t. Not very reliable for security sensors. :blush:

So I guess I’ll order myself an second Z-wave Stick Gen5, and some USB over UTP extenders. And since I’m already running OH2, and noticed a second serial in items file for the zwave serial controller, it should be a good starting point, no?

Can you tell me if I need to pay attention to special things (hardware, configs…)?
Or should it be pretty straight forward?

Before I start buying things… :wink:

Okay, took the risk, and won!!!

I’ve got now following setup:

  • Openhab 2
  • 2x Aeon Labs USB Z-Stick GEN5

One Z-stick is connected directly to my server. And one Z-stick via an “Aten interfaceadapter: USB 2.0 Extender”. This way, my usb stick is now connected over an ethernet cable of about 40m.
(I took me some head worries to exclude/include all nodes from one stick to another. But finally, everything is in. And I’m very happy to say that at first sight, they all work…)

@chris
Another prove why to use OH2 … :wink:

Just a word of caution. At the moment, the binding doesn’t save the node files in a network specific way. So, if you have node 2 on both sticks, then there will be a problem. It’s probably ok in that the binding will check the home id is consistent when restarting, and it should sort itself out, but just letting you know in case you see anything strange happening! :slight_smile: .

I will change the way this works (it’s actually already done in one of my development branches) and there’s an open issue on it.

1 Like