Using Tasker to establish a WireGuard tunnel before starting the Home Assistant Companion app

Hi @Stephenn

Although technically not strictly HA-related, care to share how you implemented this? I tried to set up a similar approach, but my Tasker fails to start the Wireguard tunnel when disconnected from the home WiFi. I get this error:

Not allowed to start service Intent { cmp=com.wireguard.android/.backend.GoBackend$VpnService }: app is in background

Automatic stopping of the tunnel when the phone connects to the home WiFi works like a charm though :rofl:

OnePlus 7T, OxygenOS 12.1 (Android 12), latest Tasker and Wireguard apps, both not optimised for battery.

Thanks!
Evripidis