App won't connect over VPN, Web does, a re-do and manual IP works

This is more of a “why did it not work” than “help me make it work”…

I have HA on a local network of course, and use Wireguard for VPN when on the road. Wireguard puts remote clients on a different subnet but one that has full access to the same subnet as HA.

I only recently tried the mobile app, and set it up in the default way and it worked fine from home, on the local subnet.

I was travelling for the first time and I connected via wireguard, and all my other local stuff worked (e.g. web view of video cameras), but the HA app would hang, give me an error about refreshing URL’s… never connected.

I tried web access to HA – worked fine. “Local” web over VPN – I do not use nabu casa for remote access.

In the settings of the HA app it listed a server IP and it was correct. I tried this several times.

Finally I deleted the instance, created a new HA Mobile instance, hit manually enter the IP, and did so with the same IP and port – it connected and worked fine (over wireguard).

But here’s my question – I am absolutely, positively certain the initial instance worked locally, and absolutely, positively sure the IP address shown in the options was correct (also port).

What could have been wrong that it would not work over VPN, when Web did, and when a newly created (while over VPN) did?

Also, now that I’m home I created yet another instance, and tested, and do not have the issue.

I realize there’s not much data here, but … anyone have any idea how this could come to be?

Linwood

PS. Yes, it would have been nice to save the original instance, but I was both in a hurry and not even aware if it would support multiple instances (though I guess obvious from the “add server” button).

The companion app allows for two settings (internal and external), chances are you had set the home assistant IP as internal and not external which is why it worked locally but not remotely.

OK, I see now there is a “URL” (which I assume is external) and “Internal URL”.

I did not know about those, thank you.

I did some experimenting and it appears impossible to remove the URL (external). It also appears impossible to set the internal URL on purpose without an external URL. When you manually enter the IP (as I had to), it appears to always go into the external URL.

I cannot imagine I would have separately entered an internal URL, especially since it also requires a home network setup to get there, and I had never seen that screen before (at least as best this aging memory recalls).

So to work my (external) “URL” must have been right, as it was working. And I am pretty sure the internal URL was missing.

But even if the internal URL was not missing – the only workable URL is the right IP. And if connected over VPN with a different SSID (even if that was set up) it would have used the external slot as well.

So… I quite literally cannot find a path through here to reproduce this, other than purposely to set up the home SSID, which permits setting up a local URL, and then to set that right and go back and set the (external) "URL to be incorrect. And it HAD to be correct at first or I couldn’t get to the settings screen at all.

So… I am now much better educated as to how these URL’s work, though I am still baffled what happened. However, the server setting is gone so I can’t actually tell what was happening.

By the way – my HA does not auto-discover if I start over, even when on the same LAN. Not sure why. But on a clean setup on the local network I had to manually enter the IP. If it auto-discovered this might have behaved differently. I wonder why I can’t auto-discover?

Thanks for the pointer. I remain confused, but better educated now!

Linwood

You will need to check your network and ensure mDNS can work.

The network carries mdns fine (lots of cast devices for example on that subnet).

But I think this was the clue I needed, I looked through my configuration.yaml, and I have zeroconf turned off. That was probably done many years ago, just to make it less chatty. That’s probably the culprit.

Though it emphasizes that I must have entered the external URL properly in the first place since it can’t set up automatically.

Weird. Thanks for the prompt.

And yes, it was the lack of zeroconf in the configuration.yaml. But it configured it automatically exactly as I had manually, so still puzzled, but can’t debug unless it happens again.

Thanks again.