Use Siri to Configure Your ASUS Router - Part 4
Part 1 - Capture the commands
Part 2 - Setup Linux and Create Scripts
Part 3 - Install and Configure TriggerCMD
Part 4 - Configure iOS Shortcuts and use Siri
Configure Shortcuts in iOS and use Siri
Compliments of MNPG who posted the process at https://www.triggercmd.com/forum/topic/347/trigger-from-shortcuts-ios
You will need three pieces of information.
- Token - triggerCMD token assigned to your account, found here.
- CN - Computer Name
- TriggerName - Trigger Name
Open the Shortcuts App in your iOS device, and select Create Shortcut
Select Add Action > Web > URL. Enter in the following URL
https://www.triggercmd.com/api/run/triggerSave
Click the blue plus icon. Select Get Contents of URL.
Click Show more, and set the Method to POST
Under Headers, click add new header.
Add the following two headers:
- Key: authorization | Text: Bearer {token}
- Key: content-type | Text: application/json
Under Request Body, add two fields of type Text:
- Key: computername | Text: {CN}
- Key: triggername | Text: {TriggerName}
Click Next
Provide a name for the Shortcut (Enable or Disable VPN). Then click Done.
The shortcut should look as follows, note that your triggers and computer name may differ. Your token will be unique to your account.
Repeat this process for the Disable VPN Shortcut, making sure to set the trigger name to Disable VPN
Once completed, you should have two shortcuts.
Click on the Enable VPN action and ensure the setting was enabled in your router. Wait 60 seconds and then try the Disable VPN connection, ensure the VPN setting was disabled. If so, everything is set correctly. Now, all you need to do is say "Hey Siri, Enable VPN" and the setting should be applied.
Connecting to VPN Service
In MacOS and iOS, connect using the Cisco IPSec option. When prompted, enter in the IP address of your home router (this may change over time, which is why it's also a good idea to register with noip, or purchase a static IP from your ISP). Also include the username, password, and shared secret defined earlier in this guide. If everything was done successfully, you should now be able to enable/disable VPN on your home router using Siri, and connect to VPN from iOS/MacOS. This will also work for non-Apple devices, but you will need to follow that devices instructions for configuring IPSec VPN.
I hope you found this guide helpful, thanks!