Difference between revisions of "Trigger: IP address Change"
m |
|||
| Line 1: | Line 1: | ||
| − | <pre | + | <pre class="header-style">The IP Address Change trigger fires whenever the locally assigned IP address is updated. No configuration is required - the trigger automatically monitors for IP address changes on the device.</pre> |
| − | + | ||
| − | </pre> | + | ''' Options ''' |
| + | |||
| + | This trigger has no configurable options. It automatically fires whenever the device's local IP address changes. | ||
| + | |||
| + | ''' Examples ''' | ||
| + | |||
| + | ''Example 1: Log IP Address Changes'' | ||
| + | <pre class="trigger-style">Triggers | ||
| + | |||
| + | IP Address Change</pre> | ||
| + | <pre class="action-style">Actions | ||
| + | |||
| + | Set Variable - last_ip = {ip} | ||
| + | Popup Message - IP changed to: {ip}</pre> | ||
| + | |||
| + | Logs and displays a notification whenever the IP address changes. | ||
| + | |||
| + | ''Example 2: Notify When IP Changes'' | ||
| + | <pre class="trigger-style">Triggers | ||
| + | |||
| + | IP Address Change</pre> | ||
| + | <pre class="action-style">Actions | ||
| + | |||
| + | Send SMS - To: [contact] - Message: Device IP changed to {ip}</pre> | ||
| + | <pre class="constraint-style">Constraints | ||
| + | |||
| + | WiFi State: Connected</pre> | ||
| + | |||
| + | Sends an SMS notification when the WiFi IP address changes. | ||
| + | |||
| + | ''' Notes ''' | ||
| + | |||
| + | * On Android 7.0 (API 24) and above, the trigger uses the NetworkCallback API for efficient network monitoring. | ||
| + | * On older Android versions, the trigger monitors the CONNECTIVITY_ACTION broadcast. | ||
| + | * The trigger compares the new IP address with the previous one and only fires if there's an actual change. | ||
| + | * The trigger will not fire if the IP address cannot be determined (shown as "?"). | ||
| + | * The previous IP address is stored in settings to detect changes across app restarts. | ||
| + | * The trigger fires for IPv4 address changes. | ||
| + | |||
| + | ''' Use Cases ''' | ||
| + | |||
| + | * Updating dynamic DNS services when your IP changes | ||
| + | * Notifying external services of your new address | ||
| + | * Logging network changes for troubleshooting | ||
| + | * Triggering reconnection logic when network changes | ||
| + | |||
| + | ''' See Also ''' | ||
| + | |||
| + | * [[Trigger:_Wifi_State_Change|WiFi State Change Trigger]] | ||
| + | * [[Trigger:_Data_Connectivity_Change|Data Connectivity Change Trigger]] | ||
| + | * [[Magic_text#Current_IP_address|Magic Text]] - [Magic Text ip] | ||
Revision as of 10:59, 6 January 2026
The IP Address Change trigger fires whenever the locally assigned IP address is updated. No configuration is required - the trigger automatically monitors for IP address changes on the device.
Options
This trigger has no configurable options. It automatically fires whenever the device's local IP address changes.
Examples
Example 1: Log IP Address Changes
Triggers IP Address Change
Actions
Set Variable - last_ip = {ip}
Popup Message - IP changed to: {ip}
Logs and displays a notification whenever the IP address changes.
Example 2: Notify When IP Changes
Triggers IP Address Change
Actions
Send SMS - To: [contact] - Message: Device IP changed to {ip}
Constraints WiFi State: Connected
Sends an SMS notification when the WiFi IP address changes.
Notes
- On Android 7.0 (API 24) and above, the trigger uses the NetworkCallback API for efficient network monitoring.
- On older Android versions, the trigger monitors the CONNECTIVITY_ACTION broadcast.
- The trigger compares the new IP address with the previous one and only fires if there's an actual change.
- The trigger will not fire if the IP address cannot be determined (shown as "?").
- The previous IP address is stored in settings to detect changes across app restarts.
- The trigger fires for IPv4 address changes.
Use Cases
- Updating dynamic DNS services when your IP changes
- Notifying external services of your new address
- Logging network changes for troubleshooting
- Triggering reconnection logic when network changes
See Also
- WiFi State Change Trigger
- Data Connectivity Change Trigger
- Magic Text - [Magic Text ip]