MQTT in layman’s terms, best practices, use cases?

A. I recommend Share Z-wave dongle over IP (USB over IP using ser2net / socat ) guide. This will make the shed controller appear as if it were plugged into the main OH.

B. I recommend using a cloud-based MQTT broker like CloudMQTT. You will need to set up Items that mirror your Caravans openHAB in your main openHAB and use the MQTT Event Bus. You could go through the work of exposing your own broker to the internet but given the level of the questions I would not recommend that.

Another approach is to set up a VPN (I use OpenVPN) between your remote and home networks in which case both networks will be able to see each other. Depending on the nature of the devices in the remote environment you may be able to do it all with just one OH. If not, then your remote OH will be able to see your already existing broker.

Problem A

  1. You need only one broker that all your clients can see. So just reuse the broker you already have.

  2. Yes.

Problem B

  1. and 2. I don’t understand the question.

The MQTT Broker is the central communication point. Clients publish and subscribe to topics on a central broker. When a client publishes a message, the broker makes sure that all the clients who are subscribed receive the message. There are ways to get brokers to talk to each other but from the client’s perspective, that is transparent.

The MQTT EventBus configuration will create a set of topics for all of your Items in OH and it will publish and subscribe to those topics. Consequently, all the events that occur on one OH get published and read on the other OH and vice versa. This is appropriate for your use case.