Can HA enable/disable IKEv2/IPSec PSK VPN on Samsung phone?

Hello!

I have not found any VPN-related sensors in the settings of the HA companion app.

Can I use HA to enable and disable an IKEv2/IPSec PSK VPN (no WireGuard) that I have set up on my Samsung phone?

Thanks for sharing your thoughts! :+1:

PS:
I want to enable VPN when disconnecting from my home Wifi, and disable VPN when connecting to my home Wifi, because leaving it on when connected to my home Wifi, slows down Internet connectivity. Or are there ways to leave VPN on all the time without unwanted side effects?

You can control an app but I don’t think that it’s possible to change embedded settings…

Alternatively, I will look into the app Tasker that can control WG tunnels.

In case you are switching to Wireguard, the companion app might be able to close it so you don’t need an additional app.

And how does the HA companion app close the WG app?

PS: Ah, via intent or automation. Not tested:

script:
  wireguard_on:
    sequence:
      - service: android.intent_send