Changes

no edit summary
Line 1: Line 1: −
<pre style="background-color: #ACC8E5; color: #112A46; 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, no configuration is required.
+
 
</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]