Types of OpenHAB setupsI can use for sending z-wave data to OpenHAB?

Hello all,

I’ve heard of an OpenHAB setup called mutliple master installation. Are there other types of installations OpenHAB allows. The reasons for me asking this is because I want to use OpenHAB such that I have only 1 OpenHAB installed on my home server (I have a static IP and I have a VPN server at my gateway to my home network) and I want to have z-wave devices at a remote location (outside my home beginning at our summer cottage). I want to have these z-wave devices at our cottage send this data to my one OpenHAB server at my home and I don’t want to have OpenHAB running at the cottage. From the OpenHAB wiki I read the following: https://github.com/openhab/openhab/wiki

It is important to note that openHAB is not meant to reside on (or near) actual hardware devices which would then have to remotely communicate with many other distributed openHAB instances. Instead, openHAB serves as an integration hub between such devices and as a mediator between different protocols that are spoken between these devices. In a typical installation there will therefore be usually just one instance of openHAB running on some central server.

So my question is…how do I connect my z-wave devices at my cottage and send this data to my one OpenHAB server at home? My thought was that I could use a Raspberry Pi (or multiple Pi’s) at my cottage to be a gateway for all my z-wave sensors and devices and it would be this Raspberry Pi that would talk to my OpenHAB server. But finding the documentation on how I get the Raspberry Pi to talk to my OpenHAB server is the part I’m not finding.

I hear that MQTT can be used…but what exactly am I doing with MQTT and what would I need to install on my Raspberry Pi and my OpenHAB server so that MQTT would work? I will have my Raspberry Pi at the cottage connect to my VPN server at home.

I’m not looking for someone to do the work for me on this setup…but I’m hoping someone can explain to me what I need to setup and perhaps point me in the right direction on documentation so I can learn how I do this and begin testing.

Thanks in advance for any pointers or assistance you can provide me.

Openhab can be a good gateway too.
The easiest setup is if you install one RPI with Z-Wave controller in your Remote Cottage and setup Z-wave and MQTT event bus binding there, so that it would act like Z-wave<->MQTT bridge. And then on your home server you setup your main OH installation with MQTT event bus binding, so that it would listen to MQTT messages from your cottage installation and send MQTT commands, which would be listened by cottage OH instance.
This should work.

Hello @Artyom_Syomushkin and thank you for this reply to my questions.

I’m still learning the different lingo with regards to protocols used in IOT and I just read up on MQTT brokers and clients. So let me see if I understand what you are suggesting.

  • At my cottage I install my z-wave sensors.
  • Also at my cottage I install a Raspberry Pi (3 is what I’m using) and on this Pi I’ll be using a RaZberry addon hat and I’ll install a MQTT broker (mosquito is the one I read about).
  • At my home I will install an OpenHAB server (probably CentOS) and on this server I will also install a MQTT Client that will be listening to my MQTT broker on the cottage Raspberry Pi.
  • At my home I have a VPN server at my gateway so also on the Raspberry Pi at the cottage I will install a VPN client and connect to my VPN server at my home. It is through this VPN connection that my MQTT broker and client will talk to one another. I suppose to put this properly…my OpenHAB server with the MQTT client will be listening for MQTT messages from the broker.

Does this sound like I have the understanding of a proper setup now?

Thanks!

Correct

On this RPi+Razberry you need to install Openhab, with z-wave and MQTT add-ons. Openhab MQTT client will connect to MQTT broker, which can be located on same RPi(like Mosquitto) or on your home server.

Yes. You install Openhab with MQTT addon on this machine also - like in your cottage, but without z-wave. You can also host broker on this server, instead of cottage - just what is easier to admin.

Yes it should work. If you want to avoid VPN, you can use cloud MQTT broker - there are some free services in internet. In this case both your openhab instances will simply connect to it. This is easier to setup and one of the advantages of MQTT - it can pass firewalls easy this way.

1 Like

Sorry, I just found, that you got similar answer already in your other topic:


Why did you create another one?

Hello @Artyom_Syomushkin,

Couple of more questions for you if you don’t mind:

#1:
I was hoping to not have to install OpenHAB on my cottage Raspberry Pi at all. Although others have done this successfully I really hoping only use a MQTT at the cottage and have the Raspberry Pi connect to my OpenHAB at my home (running the MQTT client). Putting OpenHAB on a Raspberry Pi SD card is not something I want to have to do since it will eventually kill my SD card (my opinion…I may be wrong). But if that is the only way or the best way to have my main OpenHAB at my house then of course that’s the route I will take.

#2
So at the cottage Raspberry Pi I install the RaZberry add on to have my Pi collect data from the zwave devices. Do I install the MQTT broker on the Raspberry Pi or the MQTT client?

#3:
At my home server where I install OpenHAB, what MQTT do I install there…the client or the broker?

Thanks for the suggestion of using a MQTT cloud broker. I’ve not heard of these before but will investigate them further.

While George was very helpful in the other thread I wanted to focus in on the terminology I need to use and research (such as MQTT brokers and clients) as well as get an answer as to whether or not I needed to have OpenHAB on my cottage Raspberry Pi. Also that post didn’t confirm for me how to do what I needed to do with zwave devices since George didn’t use zwave. I apologize if opening this new post was not warranted

The problem is that I’m not aware of any Z-wave-MQTT bridge, other than Home automation software. It doesn’t have to be Openhab, but can be something else, like ioBroker, Home Assistant, FHEM etc. Anyway any of these will kill your SD at some point, if you don’t do couple of things on your RPi. But these things are very simple, so you shouldn’t be affraid.

In MQTT all nodes, which publish or consume messages are clients. Broker is only used to pass message, published by one client to other clients, subscribed to this message. Thus all clients are connected to the same broker and you need only one in your system.
So… you need only one MQTT broker - where you will install it - it’s your choice. I know that Mosquitto is very easy to install on RPi and don’t know how easy it is on CentOS. What needs to be considered - MQTT clients initiate TCP/IP connections to Broker, so it has to be accesible from your client devices.
For MQTT Clients - every Openhab instance will need a client. So you will need it on RPi and on Home Server.