Server settings in the companion app

Hi, I need to set up the app so that Home Assistant logs in when I’m at home on Wi-Fi and when I’m away and connected through a VPN. Currently, I have it set up so that I have to switch between servers in the app settings. The app doesn’t automatically recognize when to log in via Wi-Fi to one server and via VPN to another server. I have to manually activate it in the app settings.
thank you