I have a Raspi running openhabian 2.3 for my house.
I want to install some devices in my basement that is too far from home to be reached by wifi or ethernet, so I’m thinking of using a 4G router with dedicated sim card, with another Raspi with openhabian acting as slave connected over the internet.
I know it might seem confusing, but I really need someone to point me in the right direction knowing that:
I need to install some devices like door sensors, lights, temperature sensors and so on
I think we need a bit more information. Are you using Zigbee and Zwave devices primarily? If so you don’t need a separate OH server in the basement. Both of these create a mesh network and as long as devices are within 4 hops (I think) to the controller everything should work just fine. So even if your wifi doesn’t reach to the basement, so long as you have one or two zwave or zigbee devices that can reach to the basement, all the devices in the basement will route their messages through those devices.
Since Hue is Zigbee, you don’t need wifi to reach those devices. You just need enough devices to form a good mesh across the whole house. You will have to buy extra hardware anyway. You may as well spend that money buying devices that actually do something instead of extra Hue hubs, controllers, or coordinators.
However, if you are using wifi based devices then Dim’s approach is probably going to be the best. You can use CloudMQTT as your broker (there is a tutorial for how to import the CA so you can encrypt the message traffic) for the two instances of OH to reach each other. Or you can set up an OpenVPN connection between the two and they can see each other as if they were on the same network.
There is a special configuration file for MQTT named mqtt-eventbus.cfg. This can be configured to automatically publish all the events that occur on the Items on the slave to a standardized set of topics. On the master your can also configure it and those incoming events will automatically be published to the Items with the same name. Commands and updates can go both directions. There is no need to set up MQTT configs yourself, though you certainly can do it that way.
In the upcoming 2.4 version of the binding the event bus will go away but there will be an alternative approach.