To use this, Tasker needs to be granted permission to Write Secure Settings on your device
Install the Tasker Permissions app and follow the prompts.
adb shell pm grant net.dinglisch.android.taskerm android.permission.
If you're on a mac write
./adb shell pm grant net.dinglisch.android.taskerm android.permission.
Note: On MIUI devices you may have to open developer options and enable the USB debugging (Security Settings) setting (and the Disable permission Monitoring setting in some cases) to be able to run the above command.