by Anthony Bennett
Change AdGuard DNS server setting based on whether you are connected to your home WiFi network or not.
You need to create two DNS settings profiles in AdGuard:
1. home - this will be the name of the profile while connected to your home wifi network
2. mobile - this will be the name of the profile while connected to any other network (WiFi or cellular)
You then need to edit block 8 and set the homenetwork variable to the SSID of your home WiFi network.
You then need to edit block 22 to set the AGPINcode variable to your AdGuard automation PIN code (settings -> advanced -> automation). Note: this is case sensitive. If you get an intent error while changing WiFi network, triple check you have set this variable EXACTLY as per what AdGuard displays.
This currently doesn't handle turning WiFi on and off well. Assumes WiFi is left on and connects to you home WiFi network or other/no WiFi network.
I'm hoping to add support for enabling and disabling WiFi in a future version.