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 Proximity Sensor trigger fires when the device's proximity sensor detects changes in distance. This can be used to detect when something (like your hand or face) is near or far from the device, as well as wave gestures for hands-free control.</pre>
This trigger will fire on a change to the proximity sensor.
     −
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 '''
</pre>
  −
'''''Supports the following events:'''''
  −
''It may not work on all devices or in certain scenarios, for example on samsung which keeps the sensor deactivated and this trigger will only work when the sensor is activated e.g. in a call.''
     −
* '' Near''
+
* '''Near''' - Fires when an object is detected close to the proximity sensor
* '' Far''
+
* '''Far''' - Fires when the proximity sensor detects that an object has moved away
* '' Slow Wave''
+
* '''Slow Wave''' - Fires when an object passes near the sensor with a wave gesture lasting 500ms or longer
* '' Fast wave''
+
* '''Fast Wave''' - Fires when an object passes near the sensor with a quick wave gesture under 500ms
 +
 
 +
''' Examples '''
 +
 
 +
''Example 1: Silence phone when placed face down''
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Proximity Sensor: Near</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Set Ringer Mode: Vibrate Only</pre>
 +
  <pre class="constraint-style">Constraints
 +
 
 +
Device Orientation: Face Down</pre>
 +
 
 +
''Example 2: Toggle flashlight with hand wave''
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Proximity Sensor: Fast Wave</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Toggle Flashlight</pre>
 +
 
 +
''Example 3: Answer call with wave gesture''
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Proximity Sensor: Slow Wave</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Answer Call
 +
Enable Speakerphone</pre>
 +
  <pre class="constraint-style">Constraints
 +
 
 +
Call State: Ringing</pre>
 +
 
 +
''' Wave Gesture Detection '''
 +
 
 +
Wave gestures work by detecting a near-to-far transition:
 +
* The timer starts when an object moves near the sensor
 +
* '''Fast Wave''': Completes if the object moves away within 500 milliseconds
 +
* '''Slow Wave''': Completes if the object moves away after 500 milliseconds or more
 +
 
 +
''' Notes '''
 +
 
 +
* By default, this trigger only works when the device's screen is on
 +
* You can enable the "Proximity sensor when screen off" setting in MacroDroid's trigger settings to allow detection when the screen is off
 +
* Device compatibility varies - some manufacturers (notably Samsung) keep the proximity sensor deactivated except during specific activities like phone calls
 +
* The proximity sensor is a binary sensor (near/far) on most devices, not a distance-measuring sensor
 +
* For the trigger to fire, the state must actually change (e.g., from far to near) - it won't fire repeatedly while an object remains near
 +
 
 +
''' See Also '''
 +
 
 +
* [[Constraint: Proximity Sensor]]
 +
* [[Trigger: Shake Device]]
 +
* [[Trigger: Flip Device]]