m
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Constraints are optional and can be used to allow or prevent a macro/action from running based on certain conditions.
+
<span style="color: #0E9549; font-size: 24px;">'''What is a constraint?'''</span>
  
Constraints can be placed on macros to allow or prevent the entire macro firing based on the set condition(s). You can also add constraints directly to individual triggers and actions from the 'Edit Macro' screen, by clicking on the trigger/action and selecting "Add constraint"
+
Constraints in MacroDroid are optional tools that allow you to control when a macro or a specific action is triggered.
  
A constraint is evaluated at the point a trigger fires or actions runs and a macro/action will only run if the <strong>constraint condition is true.</strong>
+
They are based on certain conditions that must be met to allow or prevent the execution of macros and actions.
  
By default if adding more than one constraint to a macro they will be combined with an AND condition (e.g. all added constraints must be true). This can be changed in the dropdown in the constraints title to an OR condition. In this case only one of the added constraints needs to be true for the macro to run.
 
  
<strong>Nesting constraints</strong>
+
<span style="color: #0E9549; font-size: 24px;">'''Apply to entire macros:'''</span>
 +
 
 +
You can apply constraints to an entire macro (at the bottom of the 'Constraints' tab).
 +
 
 +
This means that the macro will only be activated if the conditions set by the constraints are met.
 +
 
 +
<span style="color: #0E9549; font-size: 24px;">'''Restrictions on Triggers and Individual Actions:'''</span>
 +
 
 +
As well as being applied to an entire macro, constraints can be added directly to individual triggers and actions.
 +
 
 +
This is done from the 'Edit Macro' screen by selecting the trigger or action and selecting 'Add Constraint'.
 +
 
 +
<span style="color: #0E9549; font-size: 24px;">'''Nesting constraints'''</span>  
 +
 
 +
If you need more sophisticated logic applied to constraint there is a special AND/OR/XOR/NOT constraint that can be used.
 +
 
 +
Any constraints nested under the logic constraint will have that logic operator applied. It's also possible to nest multiple logic constraints to create complex logic.
 +
For example:
 +
 
  
If you need more sophisticated logic applied to constraint there is a special AND/OR/XOR/NOT constraint that can be used. Any constraints nested under the logic constraint will have that logic operator applied. It's also possible to nest multiple logic constraints to create complex logic. For example:
 
  
 
  AND
 
  AND
Line 17: Line 33:
 
       | - Constraint 3
 
       | - Constraint 3
  
 +
In the above example, Constraint 1 must always be true '''AND''' at least one of (Constraint 2 '''OR''' Constraint 3) must be true.
 +
 +
<span style="color: #0E9549; font-size: 24px;"><strong>List of Constraints</strong></span>
 +
 +
[[Constraint: ADB Hacked|ADB Hacked]]
 +
 +
[[Constraint: Airplane Mode|Airplane Mode]]
 +
 +
[[Constraint: AND / OR / XOR / NOT|AND / OR / XOR / NOT]]
 +
 +
[[Constraint: Application Running|Application Running]]
 +
 +
[[Constraint: Auto Rotate|Auto Rotate]]
 +
 +
[[Constraint: Auto Sync|Auto Sync]]
 +
 +
[[Constraint: Battery Level|Battery Level]]
 +
 +
[[Constraint: Battery Saver State|Battery Saver State]]
 +
 +
[[Constraint: Battery Temperature|Battery Temperature]]
 +
 +
[[Constraint: Bluetooth State|Bluetooth State]]
 +
 +
[[Constraint: Brightness|Brightness]]
  
== List of Constraints ==
+
[[Constraint: Calendar Entry|Calendar Entry]]
  
[[Airplane Mode]]
+
[[Constraint: Call State|Call State]]
  
[[AND / OR / NOT]]
+
[[Constraint: Category Enabled/Disabled|Category Enabled/Disabled]]
  
[[Constraints:Application Running|Application Running]]
+
[[Constraint: Cell Towers|Cell Towers]]
  
[[Auto Rotate]]
+
[[Constraint: Clipboard content|Clipboard content]]
  
[[Auto Sync]]
+
[[Constraint: Compare Values|Compare Values]]
  
[[Battery Level]]
+
[[Constraint: Dark Mode|Dark Mode]]
  
[[Battery Saver State]]
+
[[Constraint: Day of the Month|Day of the Month]]
  
[[Battery Temperature]]
+
[[Constraint: Day of the Week|Day of the Week]]
  
[[Bluetooth State]]
+
[[Constraint: Device Facing|Device Facing]]
  
[[Brightness]]
+
[[Constraint: Device Locked/Unlocked|Device Locked/Unlocked]]
  
[[Calendar Entry]]
+
[[Constraint: Device Orientation|Device Orientation]]
  
[[Call State]]
+
[[Constraint: Floating Button|Floating Button]]
  
[[Cell Towers]]
+
[[Constraint: Floating Text|Floating Text]]
  
[[Dark Mode]]
+
[[Constraint: Geofence|Geofence (Location)]]
  
[[Day of the Month]]
+
[[Constraint: GPS State|GPS State]]
  
[[Day of the Week]]
+
[[Constraint: Headphone Connection|Headphone Connection]]
  
[[Device Facing]]
+
[[Constraint: IP address|IP address]]
  
[[Device Locked/Unlocked]]
+
[[Constraint: Is Roaming|Is Roaming]]
  
[[Device Orientation]]
+
[[Constraint: Light Sensor|Light Sensor]]
  
[[GPS State]]
+
[[Constraint: Location Mode|Location Mode]]
  
[[Headphone Connection]]
+
[[Constraint: Macro Running|Macro Running]]
  
[[Is Roaming]]
+
[[Constraint: Macro(s) Enabled/Disabled|Macro(s) Enabled/Disabled]]
  
[[Light Sensor]]
+
[[Constraint: Macro(s) Invoked/Not invoked Recently|Macro(s) Invoked/Not invoked Recently]]
  
[[Location Mode]]
+
[[Constraint: MacroDroid Invocation Method|MacroDroid Invocation Method]]
  
[[Macro(s) Enabled/Disabled]]
+
[[Constraint: MacroDroid Mode|MacroDroid Mode]]
  
[[Macro(s) Invoked/Not invoked Recently]]
+
[[Constraint: MacroDroid Variable|MacroDroid Variable]]
  
[[MacroDroid Mode]]
+
[[Constraint: Mobile Data On/Off|Mobile Data On/Off]]
  
[[MacroDroid Variable]]
+
[[Constraint: Mobile Service Status|Mobile Service Status]]
  
[[Mobile Data On/Off]]
+
[[Constraint: Month of the Year|Month of the Year]]
  
[[Mobile Service Status]]
+
[[Constraint: Music Active|Music Active]]
  
[[Month of the Year]]
+
[[Constraint: NFC State|NFC State]]
  
[[Music Active]]
+
[[Constraint: Notification Present|Notification Present]]
  
[[NFC State]]
+
[[Constraint: Notification Volume|Notification Volume]]
  
[[Notification Present]]
+
[[Constraint: Phone Ringing|Phone Ringing]]
  
[[Notification Volume]]
+
[[Constraint: Power Connected|Power Connected]]
  
[[Phone Ringing]]
+
[[Constraint: Priority Mode / Do Not Disturb|Priority Mode / Do Not Disturb]]
  
[[Power Connected]]
+
[[Constraint: Proximity Sensor|Proximity Sensor]]
  
[[Priority Mode / Do Not Disturb]]
+
[[Constraint: Quick Tile State|Quick Tile State]]
  
[[Proximity Sensor]]
+
[[Constraint: Ringer Volume|Ringer Volume]]
  
[[Ringer Volume]]
+
[[Constraint: Roaming Enabled|Roaming Enabled]]
  
[[Roaming Enabled]]
+
[[Constraint: Rooted Device|Rooted Device]]
  
[[Rooted Device]]
+
[[Constraint: Screen On/Off|Screen On/Off]]
  
[[Screen On/Off]]
+
[[Constraint: Speakerphone On/Off|Speakerphone On/Off]]
  
[[Speakerphone On/Off]]
+
[[Constraint: Stopwatch|Stopwatch]]
  
[[Stopwatch]]
+
[[Constraint: Sunrise/Sunset|Sunrise/Sunset]]
  
[[Sunrise/Sunset]]
+
[[Constraint: System Settings|System Settings]]
  
[[Time of Day]]
+
[[Constraint: Time of Day|Time of Day]]
  
[[Time Since Boot]]
+
[[Constraint: Time Since Boot|Time Since Boot]]
  
[[Torch On/Off]]
+
[[Constraint: Torch On/Off|Torch On/Off]]
  
[[Trigger Fired]]
+
[[Constraint: Trigger Fired|Trigger Fired]]
  
[[Volume Level]]
+
[[Constraint: Volume Level|Volume Level]]
  
[[VPN State]]
+
[[Constraint: VPN State|VPN State]]
  
[[Wifi HotSpot State]]
+
[[Constraint: Wifi HotSpot State|Wifi HotSpot State]]
  
[[Wifi State]]
+
[[Constraint: Wifi State|Wifi State]]

Latest revision as of 15:51, 23 April 2024

What is a constraint?

Constraints in MacroDroid are optional tools that allow you to control when a macro or a specific action is triggered.

They are based on certain conditions that must be met to allow or prevent the execution of macros and actions.


Apply to entire macros:

You can apply constraints to an entire macro (at the bottom of the 'Constraints' tab).

This means that the macro will only be activated if the conditions set by the constraints are met.

Restrictions on Triggers and Individual Actions:

As well as being applied to an entire macro, constraints can be added directly to individual triggers and actions.

This is done from the 'Edit Macro' screen by selecting the trigger or action and selecting 'Add Constraint'.

Nesting constraints

If you need more sophisticated logic applied to constraint there is a special AND/OR/XOR/NOT constraint that can be used.

Any constraints nested under the logic constraint will have that logic operator applied. It's also possible to nest multiple logic constraints to create complex logic. For example:


AND
 | - Constraint 1
 | - OR
     | - Constraint 2
     | - Constraint 3

In the above example, Constraint 1 must always be true AND at least one of (Constraint 2 OR Constraint 3) must be true.

List of Constraints

ADB Hacked

Airplane Mode

AND / OR / XOR / NOT

Application Running

Auto Rotate

Auto Sync

Battery Level

Battery Saver State

Battery Temperature

Bluetooth State

Brightness

Calendar Entry

Call State

Category Enabled/Disabled

Cell Towers

Clipboard content

Compare Values

Dark Mode

Day of the Month

Day of the Week

Device Facing

Device Locked/Unlocked

Device Orientation

Floating Button

Floating Text

Geofence (Location)

GPS State

Headphone Connection

IP address

Is Roaming

Light Sensor

Location Mode

Macro Running

Macro(s) Enabled/Disabled

Macro(s) Invoked/Not invoked Recently

MacroDroid Invocation Method

MacroDroid Mode

MacroDroid Variable

Mobile Data On/Off

Mobile Service Status

Month of the Year

Music Active

NFC State

Notification Present

Notification Volume

Phone Ringing

Power Connected

Priority Mode / Do Not Disturb

Proximity Sensor

Quick Tile State

Ringer Volume

Roaming Enabled

Rooted Device

Screen On/Off

Speakerphone On/Off

Stopwatch

Sunrise/Sunset

System Settings

Time of Day

Time Since Boot

Torch On/Off

Trigger Fired

Volume Level

VPN State

Wifi HotSpot State

Wifi State