Difference between revisions of "Constraint: Wifi State"

Tags: Mobile web edit Mobile edit
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<span style="color: #0E9549; font-size: 24px;">'''About this constraint '''</span>
+
<pre class="header-style">This constraint allows or prevents a macro/feature from running based on the current Wi-Fi state.</pre>
 +
<br>
  
This constraint can be used to allow a trigger to fire only when the Wifi connection is in a specific state.
+
<p style="color:#2465d0">'''Options'''</p>
  
You can specify that either the Wifi is on or off, or alternatively that the device is/is not connected to a particular network.
+
* '''Enabled''': Constraint passes only when Wi-Fi is on
 +
* '''Disabled''': Constraint passes only when Wi-Fi is off
 +
* '''Connected/Disconnected''': Optionally check connection state or SSID
 +
<br>
 +
 
 +
<p style="color:#2465d0">'''Example'''</p>
 +
 
 +
''Example 1: Enable mobile data only when Wi-Fi is disconnected''
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Application Launched/Closed - Launched (YouTube)</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Mobile Data On/Off (Enable)</pre>
 +
  <pre class="constraint-style">Constraints
 +
 
 +
Wifi State - Disconnected</pre>
 +
<br>
 +
 
 +
<p style="color:#2465d0">'''Requirements'''</p>
 +
* Connectivity Helper is installed<br>
 +
* Location permission for MacroDroid (must be set to "Allow all the time", not just "Allow only while using the app")<br>
 +
* Location is enabled<br>
 +
* Since Android 8.1 this functionality requires location permission and location services enabled
 +
<br>
 +
 
 +
<p style="color:#2465d0">'''See Also'''</p>
 +
 
 +
* [[Trigger: Wifi State Change|Wifi State Change Trigger]]
 +
* [[Action: Wifi Configure|Wifi Configure Action]]

Latest revision as of 04:58, 17 March 2026

This constraint allows or prevents a macro/feature from running based on the current Wi-Fi state.


Options

  • Enabled: Constraint passes only when Wi-Fi is on
  • Disabled: Constraint passes only when Wi-Fi is off
  • Connected/Disconnected: Optionally check connection state or SSID


Example

Example 1: Enable mobile data only when Wi-Fi is disconnected

Triggers

Application Launched/Closed - Launched (YouTube)
Actions

Mobile Data On/Off (Enable)
Constraints

Wifi State - Disconnected


Requirements

  • Connectivity Helper is installed
  • Location permission for MacroDroid (must be set to "Allow all the time", not just "Allow only while using the app")
  • Location is enabled
  • Since Android 8.1 this functionality requires location permission and location services enabled


See Also