Multiple z-wave bindings

I’m thinking of adding z-wave devices on top of my knx installation.
My problem now is that I’ve got to cover 2 buildings. I’m thinking of installing 2 razberries for this purpose.

Is it possible to with openhab to have 2 z-wave bindings?
Or can this give problems?

You don’t want 2 bindings on one box - that wouldn’t buy you anything.
What you would need is 2 boxes with a zwave controller and IP connectivity each, another openhab instance on the second box, too, plus some means of logically connecting those two instances (MQTT, probably).

But I’d give it a second thought if that’s really what you need. Remember zwave can do (and will do automatically) routing at the radio layer so you can easily bridge distances between buildings way larger than your zwave controller’s radio range. Just put zwave devices physically inbetween.

My openhab runs on a seperate server.
So the razberries would be used a gateway?

I’ll have a look what you’re saying about the bridge distance. It’s not clear to me what you’re saying about the devices in between. Does this mean that with a door sensor on each corner of the buildings, it’ll be bridged? :blush:
My home (200m²) is about 10m from my second building (200m²).

Any mains powered zwave device acts as a radio bridge. They organize a routing mesh all by themselves.
Door sensors are battery powered, so they won’t participate, but if you deploy a relay or dimmer nearby, say for the doorlight, it’ll do.
Also, as you would be using recent devices (to support zwave plus), you can probably reach everything from a single controller anyway, but nobody can tell for sure in advance.

As you want to use the razberries as gateways, you’ll need to implement a MQTT or other link to your OH server anyway.
If you run OH elsewhere and don’t want to move it to the Pi, consider using an Aeon USB stick to plug into your existing server instead (same zwave routing story applies indoor here).

I’ve got now OH running on a virtual server in the second building. And the razberry is running in my home, and can communicate with the zwave devices. So far so good…

But if I understand it now correctly, the OH must be running on the machine with the zwave controller (in my case the razberry)? It’s not possible to let the OH make the connection to the Razberry for this ‘binding’?
A bit the same as with a KNX connection? Based on IP-address…
Or is this possible through the MQTT?

Sorry for maybe stupid questions, Openhab is quite new to me, and I didn’t found the time to dig in to the MQTT story.

Err, no. OH accesses the serial device. If you find some hack to tunnel that over IP, ok. But I haven’t heard of anyone running that successfully.
So you likely won’t get along without installing another OH instance on the RaZberry.
That being said, why don’t you move your OH server to the RaZberry? Remember it’s no fire-and-forget appliance, and it’s a single point of failure to your home automation, i.e. you will rely on it. So you will have to operate/backup/… it anyway, so where’s the point of operating another server ?

Yes, that would be the way to go if you insist on having separate servers.
As you would have OH running on both servers anyway, you could setup mosquitto on one of them and use the OH MQTT binding on both servers to send OH events to each other.

The server OH itself, was running on a virtual server machine, together with a bunch of other servers (samba, zoneminder, cacti, asterisk, backuppc…). The reason why I want to keep it together is that this server was on constant watch (monitoring, rack protected, Disk mirror, data remote backup UPS, strong hardware…).

I’ve moved the OH now towards the raspberry. If you don’t try it, you won’t know it. :wink:
But I must say that it’s day and night a difference for speed. :confounded:

For now, I’ll try to get the zwave card up and running and see how it goes…

That’s the right attitude :slight_smile:
(btw, as a professional, I’m a cloud/data centre designer).
Just put it on a UPS (a.k.a. smartphone battery extender) and watch out for SD card corruption. There’s some threads on this in the forum, and probably some more if you g**gle for it.
As you’ve got a samba server, easiest is to mount it on the Pi and do all writes there (logging, at least).
Speed ? Well, a lot of perceived sluggishness is at startup and during reorganisation after you change rules or the items file.
But as soon as you don’t change that any more that often, you’ll stop thinking of speed as an issue. In the long run, Pis are way powerful enough to run all home automation stuff.

hmmm, after fighting all day with the Pi and openhab, I’m back to the virtual server. :blush:
I think I’ve installed about 5 different versions (debian, noobs, razberry…) The Pi was extremely slow in my eyes (fe restart OH toke about 15 seconds?), the rules didn’t work (no idea why, on the virtual server they do), the connection between OH and the razberry card was not working (ttyAMA0 not found).

I’ve ordered now a new “Aeon Labs USB Z-Stick with battery GEN5”, and hope that the ranges will not be an issue. And the raspberry will be reinstalled for kodi purpose…

ps learned already a lot about openhab, zwave, knx… :stuck_out_tongue:

After testing with several components (Z-wave sirenes, dimmers, range extenders…) I come to the conclusion that the hopping story isn’t that wonderful. When I switch on a light, it takes sometimes 40 seconds before the light goes on?
With the KNX hardware, not even a second. And when the actor is direclty connected (in the same room), it goes fine.
Or my config is somewhere mixed up, or the hopping is not that great. In HABmin, I see a some interconnections that should be there, but I didn’t find any way to remove them.

So I would like to try following setup now:

  • Main Server (VMWare) with Z-Wave Aeotec GEN5 USB stick and openhab, mosquitto server… (is running fine now)
  • Second Server (Raspberry) with razberry card (the zwave smart home app is running great)

What do you think? Just installing openhab on the second server and a mosquitto binding towards the Main server? Or am I missing something?

ps is it a good idea to start configuring all this with openhab? Or should I use direclty openhab2? I just want to avoid double work later on if openhab2 starts to become ‘in production’…

Hey Ben… did you get any clarification on whether it is possible to run multiple ZWave controllers on the same server? I have a mix of EU and US ZWave devices, so I need one controller for each region - and I want to avoid having to setup multiple servers.

It’s not possible under OH1 to have two zwave sticks running on the same instance of OH. This is something that should be possible under OH2, although it will need some small updates to actually make it work.

Thanks for the clarification.

I’m running OH in a virtual server, forwarding the USB connections (ZWave, Tellstick, BT, WiFi) from the physical host over TCP to the OH virtual server. I could setup another virtual server, and forward the second USB ZWave stick to that server. What would be the easiest setup to get those devices to end up on the OH server?

I could of course do this by setting up a second OH server, and use REST to have the two OH servers talk to each other, but I want as little configuration on the second server as possible - as much as possible should reside on the existing OH server. Ideally, I wouldn’t even want nodes to be configured on the second server - just tell it to forward anything whatsoever from any node to OH. Is that possible?

Preudo code:

Item * changed
sendCommand(same item on OH server, value)

I think this is the only option. If you’re running on a VM, then you would need to run two instances of OH and find a way for them to communicate (probably using MQTT).

If I understand you correctly you’re trying to find a way to forward two sticks to the same OH instance, but you can’t run two ZWave bindings on the same server, and the ZWave binding wont support multiple sticks - this is the ultimate problem.

Hi Chris

Not necessarily forwarding the actual stick - forwarding all the events would be enough. But I would like to avoid having to define all the devices and command classes as items etc.

Item-less devices would end up in the log as:

NODE 15: No item bound for event, endpoint = 0, command class = SWITCH_BINARY, value = 0

That is enough information to reflect what happened in the other OH - but it would raise a couple of obstacles:

  1. How to transfer the information to the other OH.
  2. How to receive the information in the other OH, to be able to map it to items and valid states.
  3. How to transfer commands in the other direction.

My guess is that I will have to at least create the items - but some kind of a single generic rule to forward every change for every device would be very nice. I want to avoid having to create hundreds of rules for each and every possible combination of device, command and value.

Ben: Sorry for hijacking your thread - let me know if I should create a new one.

This is the same thing - the binding can’t handle more than one stick. The only way to do this is to configure a separate instance of OH and then use something like MQTT to communicate between the two.

So this should be acheivable using the method above. Define all the items, configure all the command classes (which is part of the item definitions) and then use MQTT to forward every item update to the second instance of OH. I’m not an expert on MQTT, but there are many threads here on how to configure it, and people will help with this I’m sure…

Hi Chris

There would only be one ZWave binding in the first OH. All devices on the second OH (i.e those from the other region) would be MQTT items in the first OH.

I know what you describe in the second paragraph is perfectly achievable - but that is exactly the double work I’m trying to avoid.

MQTT event bus binding:

“In addition to configuring MQTT publish/subscribe options for specific openHAB items, you can also define a generic configuration in the openhab.cfg file which will act on ALL status updates or commands on the openHAB event bus.”

That looks promising, but:

“The variable ${item} will be replaced during publishing with the item name for which the state was received.”

That indicates that it only acts on items. I want it to act on everything, no matter if there’s an item or not (to avoid having to create all the items and command classes in the second OH too).

So I guess I’m narrowed down to a single question:

Can the MQTT event bus binding, or any other binding in one way or another, catch and forward the event below:

“NODE 15: No item bound for event, endpoint = 0, command class = SWITCH_BINARY, value = 0”


PS. I found this thread about the same kind of solution that I am looking for:

“I need this to be implemented in the most generic way (i.e. no need to re-configure anything when I add/remove z-wave devices). I don’t want to maintain any mapping-files.”

I don’t think there’s anything that will do what you want, but I might be wrong. Certainly, the ZWave binding won’t do this. I suspect that using MQTT is going to be your best bet, but as I don’t use it myself, I can’t comment - as I said earlier though, there are a lot of people using it so I’m sure if you post what you’re up to, someone should be able to point you in the right direction.

Good luck :slight_smile:

1 Like

Hi Chris (or anybody else that knows)

Can I run two instances of OH on the same machine? Then I could let them use one COM port each, for each ZWave dongle.


I would guess this is possible with some messing around with folders etc to ensure there is no clash with config files, logfiles, IP ports etc. Another option which might make it easier is to run in a container.

1 Like