Remote access to two HA instances

Hi,
I’m sure there are similar questions out there already. But I don’t have enough knowledge about this topic in order to understand what I should be searching for.

I have one RPI4 at home running HassOS.
Connected to the internet via fibre and using Nabu Casa to access remotely.

I have another RPI4 that I intend to install in my caravan. I bought a portable 4G modem/router that I connect my caravan RPI4 to.

My 4G provider does not give me a public IP.

I’d like a setup where I can access my home and caravan HA from remote.

One idea I have is using the HACS integration “Remote Home-Assistant”, use my home setup as the host and create a separate view for my Caravan devices.

My problem is I’m not sure how to get there.

With both RPIs on my home network, it works fine, I just tried it to get a feeling for “Remote Home-Assistant”. But with one RPI on a different network, that’s when the challenge begin.

I tried setting up DuckDNS… but I don’t get it to work. I now understand that with my 4G not getting a public IP, port forwarding won’t work.

I then heard of VPN. But do I need an app on my phone to access it?
Do I use VPN + DuckDNS? Or do VPN replace the need for DuckDNS?
Can VPN work with HACS integration “Remote Home-Assistant”?
Or am I even on the right track with VPN?

Help, please :slight_smile:

I am in the same situation: two sites running HA but on different networks, one connected on fast internet, the other one with a 4G connection (without public address)…
So to solve the problem, I installed a VPN solution called Wireguard (on a separate raspberry Pi on each site) but it is also a add-on in Hass.OS (I do not think that you can create a site to site VPN, but just a Wireguard VPN server).
The 4G site is the client and it is connecting to the server using the DuckDNS name of the server site (so no need for a DuckDNS name for the 4G site). The fast internet site is the server (also running as I mentionned on a separate raspberry Pi). There is a script to run on the raspberry pi to install Wireguard and customize it.
Look at the following video, explaining how to do it…

The only difficulty in my case was to create static routes between the two networks as Wireguard is running on two Pi’s (so they “see” each other through VPN) but as HA instances are running on different nodes with other IP addresses on each LAN, I had to add static routes on the Wireguard Pi’s as well as on the modem routers on each sites…

The two HA instances are now connected using “Remote Home-Assistant”, the fast connection is the server (master where all the remote entities you need are replicated) and the 4G site is the remote.

Now I can also access remote IP address just by typing their local LAN Ip addresses…

1 Like

This sounds very interesting.
But do I understand correct that it takes 2 pies just to set up the VPN link?
Ie, I would come to a total of 4 RPIs to get this working? 2 HA RPIs and 2 VPN RPIs?

I love the last sentence of your reply :smiley:
The part above it at this point in time above my skills… but I will look at the video to perhaps get a better understanding.

Any other ways forward are most appreciated.
If I don’t have to invest in more RPIs that would also be super

You can investigate to activate the Wireguard add-on included in Hass.OS… One can be activated as the server for sure (on the fast internet connection having a DynDNS), I am not sure about activating the other as a client on the other HA instance (4G site)…
I took the choice to install on separate Pi’s as I can still access the remote sites (both ways) even if one of the HA instance is down… I have more than just HA on the remote site: NAS, Camera, Alarm system,…

1 Like

@Piffis If you don’t need to connect the two HA instances, but just need remote access to the caravan instance, you could look at Tailscale. There is an HA add-on, and it is very easy to set up.

1 Like

I will give it a try, thanks for this suggested option!

@Anwen
Many thanks for this. I’ve set up Tailscale so that I have remote access to my caravan in the companion app. I’ve added an extra server and pointed towards the Tailscale 100.x.x.x. IP address I got.
So far so good, any like you say, if I’m happy swapping between the servers, I would be done.

But I also tried taking it the next step;
I installed Tailscale add-on on both HA instances and tried adding the 100.x.x.x IP address using Remote Home-Assistant in my “Home HA”, in order to connect it to the Tailscale “Caravan HA”.
For some reason I can’t get this to work.
Is there a network limitation that I’m not aware off preventing this?

Thanks

1 Like

I have not used Remote HA so unfortunately I can’t help with that. I keep my two instances separate and don’t have a need to combine them for my use case. Maybe someone with experience with that integration will have some ideas.

Are you able to ping the remote HA ip address (caravan) from a “Home HA” terminal ?
If not this means that probably your two Tailscale implementations are not seeing each other (no tunnel between the two) and therefore no possibility to create a remote Home-Assistant node…
I don’t know Tailscale to create this tunnel but I have searched on google and this could be possible maybe using ACL’s… but cannot help more on this part…

@browetd
Spot on… I tried to ping the “Caravan Tailscale” IP from my “Home tailscale” IP… there was no reply. :cry:

1 Like

did you manage to resolve this? Currently heading down the same path

Hi @uSlackr ,
Not in the way I wanted unfortunately.
I ended up running my home via Nabu Casa.

The caravan has a RPI4 running on the 12v caravan battery and internet access is via Wi-Fi to a separate 4G modem that has a battery and is also charged by the caravan 12v.
We have a solar panel, so the battery will not drain.
The Caravan HA is setup with Tailscale and I need to swap between the servers in the HA companion app.
It works ok, but not in the way I originally wanted.

I haven’t setup any notifications yet. This is potentially an area where I’ll run into trouble. Not sure if I’ll get notifications from my caravan server if I have my home server active in the app (and vice versa)…

I did try to install Tailscale on both my home and caravan servers. But the Tailscale plug-in doesn’t seem built for communicating with other Tailscale servers.
I can only get the IP data etc from my caravan server on my home server, ie the data and entities coming from Tailscale itself, but the other entities available on my caravan server is not available to my home server :roll_eyes:

1 Like

Thanks. Feeling the same pain here. I feel there is a solution, but so far I’ve not found it.
Re: Notifications - I believe you are right so far a mobile app notification go. There are other methods like Telegram that could work.

Check this discussion. Frenck is open that this approach is simply a wrong way to solve our problem. The VPN client<>server has to be on a higher level, not between HA instances, between the machines.

WireGuard as a VPN client · hassio-addons/addon-wireguard · Discussion #95 · GitHub

1 Like

Hi,
So, anyone with a good solution for a pi to pi VPN for remote home assistant yet?
Just about to setup a pi with HA at my mother in laws cabin and there I only have a pretty simple TP-link 4G router without any VPN client capabilities. Here the 4G Carrer used virtual sub ip networks so it’s impossible to host any servers over 4G even with dyndns.

At home I however is running unifi so I have a simple L2TP VPN server running on the router.

Any suggestions for a simple lan to lan VPN solution? Is there any VPN clients for HA that can set up site to site? Feels wrong as it should be the gateways but that option is gone in my current situation.

Best
Fredric

1 Like

Hmm, is this supposed to work??

I SOLVED IT finally.

There seems to be a bug. I use Tailscale vpn tunnel integrated in home assistant. The bug seems to be that you have to enable and disable the feature called “Userspace networking mode” in the configuration dialog of the addon. So enable, save, restart. Then disable it, save, restart. Since then, the tailscale is able to open the vpn. Remote HA from HACS starts working.

2 Likes

You are a wizard! Confirmed this is still working Sept 2024. Tailscale & Remote HomeAssistant.

1 Like