Difference between revisions of "Trigger: IP address Change"

m
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<pre style="background-color: #EEEEEE; color: Black; border-radius: 10px; padding: 10px;">
+
<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>
This trigger will fire whenever the locally assigned IP Address is updated.
 
</pre>
 
<br>
 
'''Example Usage'''<br/>
 
  
<pre style="background-color: #AC2424; color: white; border-radius: 10px; padding: 10px;">
+
''' Options '''
Triggers
 
  
 +
This trigger has no configurable options. It automatically fires whenever the device's local IP address changes.
  
</pre><br>
+
''' Examples '''
<pre style="background-color: #1665B0; color: white; border-radius: 10px; padding: 10px;">
 
Actions
 
  
 +
''Example 1: Log IP Address Changes''
 +
  <pre class="trigger-style">Triggers
  
</pre><br>
+
IP Address Change</pre>
<pre style="background-color: green; color: white; border-radius: 10px; padding: 10px;">
+
  <pre class="action-style">Actions
Constraints
 
  
 +
Set Variable - last_ip = {ip}
 +
Popup Message - IP changed to: {ip}</pre>
  
</pre><br>
+
Logs and displays a notification whenever the IP address changes.
<pre style="background-color: teal; color: white; border-radius: 10px; padding: 10px;">
 
Local variables
 
  
 +
''Example 2: Notify When IP Changes''
 +
  <pre class="trigger-style">Triggers
  
</pre><br>
+
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 {ip}]]

Latest 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