VPN detection in similar way to WIFI detection in companion app

Is there a way that the companion app can detect the VPN being used in the same way that wifi is used to select which url to use? This is a source of constant frustration when I log in to my house vpn to do other work and the companion app then ceases to connect because it is using the external url but unable to connect to it due to the vpn.

Example scenario would be that I am checking configs locally on devices using the vpn then need to check if the config has updated in homeassistat correctly. I must disconnect the vpn losing any connection i have to the devices.

A further scenario which I was reminded of today when I was upgrading homeassistant remotely was that to ssh in I need to use the vpn, but then need to drop the vpn to check if homeassistant has updated.

Any comments most welcome


The network type sensor changes to vpn when connected to a VPN on my phone

Or you can use a sensor to detect the public IP of the app.

Useful to know that the network type changes, I am sure the app could detect when it is on a vpn connection (I’m sorry I don’t know enough about android or the app to know how it would find a list of vpns) but on my current phone (samsung note ultra 20) the vpn connections are listed in the phone network settings.


VPN is for apps just a network, like WiFi or ethernet. No real options to detect it unless you have special access to the OS.
VPN can even be set up to be application specific.
My VPN only affect my HA companion app.

On my iPhone, it shows my Wi-Fi network but not my (Wireguard) connection.