android icon indicating copy to clipboard operation
android copied to clipboard

Determine home network based on whether url can be reached

Open tag6 opened this issue 11 months ago • 1 comments

Is your feature request related to a problem? Please describe.

The current detection of external or internal URL usage is not appropriate to the problem. As a user of DNS66 I'm always using a VPN. But if I change VPN to WireGuard, I'm virtually in my home network. I'm not using an ethernet adapter (although I have one in the drawer), but if I would, I'd do that as well as home as somewhere else where I'm not at home. So both criteria do not really help to tell if internal URL usage is possible. You even may come to a place where the public WLAN is named like your home WLAN!

The current logic does not help me, but it also does not seem to be anywhere near a logic and general solution. It gets more and more complicate, without solving things.

See also https://community.home-assistant.io/t/wth-does-the-app-not-connect-internally-if-vpn-is-being-used/815767/2

Describe the solution you'd like

There is no reason to check hardware, Ethernet, WLAN, anything to decide if internal or external URL is to be used. Easy logic:

  1. It is stored what is the "current connection" (internal or external)
  2. On any network change (IR, Bluetooth, WLAN, Ethernet/USB whatever) it is to be checked if the internal URL is reachable. The result determines the new "current connection". From that moment all traffic goes there.

Result: The companion app shall not manage connections. The OS is responsible to route your network packets to the interface it decides. The name of the WLAN, if network traffic is managed via WLAN, VPN, IR, Bluetooth - please don't care! Only check if and how HA is reachable. This is all the companion app should need to know for maximum comfort of the users.

Describe alternatives you've considered, if any

Currently I'm not using Home Assistant with internal URL when not at home but using VPN. I'd like to change that, but the current situation is fine also. But please stop unnecessarily complicating things.

Additional context

tag6 avatar Feb 06 '25 15:02 tag6

I also have this problem on ios.. My external URL is accessible from outside the network. Internal from inside the network. Unifi for some reason if connected via VPN does not loop back out to use the external vpn (even though dns resolves to the ddyns. I'd be happy for this to be behind a checkbox (try internal if external is not responding). and build it to check in parallel.

haydonryan avatar Nov 17 '25 00:11 haydonryan