Difference between revisions of "Constraint: Proximity Sensor"

 
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 proximity sensor state.</pre>
  
This constraint can be used to allow a trigger to fire only when the proximity sensor is in the near/far state. Please note that this trigger will only work when the device's screen is on unless you modify the setting via the MacroDroid trigger settings.
+
''' Options '''
 +
 
 +
* '''Near''': Constraint passes only when something is close to the sensor
 +
* '''Far''': Constraint passes only when the sensor is clear
 +
 
 +
''' Example '''
 +
 
 +
''Example 1: Turn on the torch only when the phone is not in a pocket''
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Shake Device</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Torch On/Off (Turn On)</pre>
 +
  <pre class="constraint-style">Constraints
 +
 
 +
Proximity Sensor - Far</pre>
 +
 
 +
''' See Also '''
 +
 
 +
* [[Trigger: Proximity Sensor|Proximity Sensor Trigger]]
 +
* [[Action: Torch On/Off|Torch On/Off Action]]

Latest revision as of 13:41, 9 January 2026

This constraint allows or prevents a macro/feature from running based on the proximity sensor state.

Options

  • Near: Constraint passes only when something is close to the sensor
  • Far: Constraint passes only when the sensor is clear

Example

Example 1: Turn on the torch only when the phone is not in a pocket

Triggers

Shake Device
Actions

Torch On/Off (Turn On)
Constraints

Proximity Sensor - Far

See Also