Difference between revisions of "Trigger: VPN State"
| Line 1: | Line 1: | ||
| − | <pre | + | <pre class="header-style">This trigger will fire when a VPN (Virtual Private Network) is connected or disconnected. It monitors network connectivity changes to detect VPN state transitions.</pre> |
| − | This trigger will fire when | + | |
| − | </pre> | + | ''' Options ''' |
| + | |||
| + | * '''Enabled''': Trigger when a VPN connection is established | ||
| + | * '''Disabled''': Trigger when a VPN connection is terminated | ||
| + | |||
| + | ''' Requirements ''' | ||
| + | |||
| + | * Requires Android 5.0 (Lollipop, API 21) or higher | ||
| + | |||
| + | ''' Configuration ''' | ||
| + | |||
| + | Select whether to trigger when a VPN is connected (Enabled) or disconnected (Disabled). The trigger monitors network connectivity changes to detect VPN state. | ||
| + | |||
| + | ''' Examples ''' | ||
| + | |||
| + | <pre class="trigger-style">Triggers | ||
| + | |||
| + | VPN State (Enabled)</pre> | ||
| + | <pre class="action-style">Actions | ||
| + | |||
| + | Notification: VPN Connected | ||
| + | Your connection is now secure | ||
| + | Set Variable: [vpn_status] = Connected</pre> | ||
| + | |||
| + | ''Notify when VPN connection is established.'' | ||
| + | |||
| + | ---- | ||
| + | |||
| + | <pre class="trigger-style">Triggers | ||
| + | |||
| + | VPN State (Disabled)</pre> | ||
| + | <pre class="action-style">Actions | ||
| + | |||
| + | Notification: VPN Disconnected - Warning! | ||
| + | Your connection is no longer protected | ||
| + | Speak Text: VPN has disconnected</pre> | ||
| + | |||
| + | ''Alert when VPN disconnects unexpectedly.'' | ||
| + | |||
| + | ''' Notes ''' | ||
| + | |||
| + | * The trigger works with any VPN app that uses standard Android VPN APIs. | ||
| + | * Detection is based on network connectivity changes, so there may be a brief delay between the actual VPN state change and trigger activation. | ||
| + | * Useful for security-conscious workflows that require awareness of VPN connection status. | ||
| + | * Consider pairing with a VPN constraint to ensure actions only run when VPN is in the desired state. | ||
| + | * Works with both system VPN connections and third-party VPN applications. | ||
| + | |||
| + | ''' See Also ''' | ||
| + | |||
| + | * [[Constraint:_VPN_State|VPN State Constraint]] | ||
| + | * [[Trigger:_Wifi_State_Change|Wifi State Change Trigger]] | ||
Revision as of 22:01, 7 January 2026
This trigger will fire when a VPN (Virtual Private Network) is connected or disconnected. It monitors network connectivity changes to detect VPN state transitions.
Options
- Enabled: Trigger when a VPN connection is established
- Disabled: Trigger when a VPN connection is terminated
Requirements
- Requires Android 5.0 (Lollipop, API 21) or higher
Configuration
Select whether to trigger when a VPN is connected (Enabled) or disconnected (Disabled). The trigger monitors network connectivity changes to detect VPN state.
Examples
Triggers VPN State (Enabled)
Actions
Notification: VPN Connected
Your connection is now secure
Set Variable: [vpn_status] = Connected
Notify when VPN connection is established.
Triggers VPN State (Disabled)
Actions
Notification: VPN Disconnected - Warning!
Your connection is no longer protected
Speak Text: VPN has disconnected
Alert when VPN disconnects unexpectedly.
Notes
- The trigger works with any VPN app that uses standard Android VPN APIs.
- Detection is based on network connectivity changes, so there may be a brief delay between the actual VPN state change and trigger activation.
- Useful for security-conscious workflows that require awareness of VPN connection status.
- Consider pairing with a VPN constraint to ensure actions only run when VPN is in the desired state.
- Works with both system VPN connections and third-party VPN applications.
See Also