Remote Home Assistant integration challenge

I have the following challenge:

I have 2 HA instances running on RPI’s on a similar setup. Now I like to integrate them using Remote Home Assistant integration.
The main one is running flawless and is connected remotely via NabuCasa Cloud. Using it for years now and is not creating any issues.
I like to extend my activities to a second building using the second instance on a different network using a different router as well.
Is it possible to integrate both instances from a different network us Remote Home Assistent where one is main and the other one is the remote node?

I have tried to configure it but I consistently get a failure to connect to server.

I do not think you can connect them through NabuCasa.
You need a direct connection between them, like a VPN tunnel.
Then it should be easy to connect one as a slave to the other.

Hi Wally, thank you for your reply. I know now in which direction I now have to go although I have no clue what a VPN tunnel entails.

I dive into it.

I find the documentation very brief. It doesn’t explain very well how this connection should be established if your are not on the same network.

VPN is a method to establish an encrypted connection between two device through insecure networks, like the internet.
You need a VPN server and a VPN client.
The VPN client makes the connection to the VPN server.
VPN clients and servers can be run as part of HA, as separate devices or sometimes even directly on the routers, if they support such features. It can be a mix of these, so it does not have to be router to router, but can easily be HA addon to router or any other combination.

Some VPN clients only connect to a hardcoded set of servers on the internet, which is not what you want.
Ask a new question on the forum about setting up a VPN between two HA installations and you will probably get many different answers to choose from.

By coincidence just looking at this:

Home Assistant Community Add-on: WireGuard

I was unsure about whether that was for hardcoded servers or if it allowed custom configured ones too.
There is a VPN software called Tailscale too, but again I am unsure of its setup.
There might be more for HA, but also look into what you router might be capable of.